:: Re: [DNG] tiny service state api [W…
Página Inicial
Delete this message
Reply to this message
Autor: Didier Kryn
Data:  
Para: dng
Assunto: Re: [DNG] tiny service state api [WAS: Fwd: init system agnosticism]
Le 14/04/2017 à 10:57, Enrico Weigelt, metux IT consult a écrit :
> * srvmgt_report_state(...)
>    --> report the service state to the supervisor
>    --> states could be eg.
>     * SRVMGT_STATE_STARTUP     -- still within the startup phase
>     * SRVMGT_STATE_READY_LOCAL -- ready for local clients only
>     * SRVMGT_STATE_READY_ALL   -- ready for all clients
>     * SRVMGT_STATE_BUSY        -- too busy to process new requests
>     * SRVMGT_STATE_SHUTDOWN    -- shutting down, still finishing
>                                        queued requests
>     * SRVMGT_STATE_DEFERRED    -- temporarily can't accept new
>                                        requests (eg. overload)
>     * SRVMGT_STATE_WAITING     -- wait for resource (eg. printer
>                                        needs paper or ink)
>     * SRVMGT_STATE_OFFLINE     -- completely offline (eg. due some
>                                        fatal error)



     Reporting state is usefull, but this could be achieved by writing 
the state in plain text to stdout. It is up to the supervisr to 
establish a pipe between itself and the daemon's stdout. If there isn't 
a supervisor, then writing to /dev/null doesn't harm. Or why not write 
to a file in /run? Anyway, I don't think it deserves to link to a 
library to perform such a simple thing.


     Didier