[Kea-users] keactrl: returns 0 when a deamon fails to start

Patrik Lundin patrik at sigterm.se
Wed May 4 21:22:26 UTC 2016


On Thu, Apr 21, 2016 at 10:27:53PM +0200, Patrik Lundin wrote:
> 
> Because it takes a while for the process to initialize it is not as easy
> as just checking if it is running inside start_server() directly
> after executing the binary in question. Are there any ideas how this
> might be implemented?
> 

I have been thinking about this some more: would it be feasible to add a
"background" flag to the daemons? If this was done they might
be able to do pre-flight checks prior to letting go of the shell.

I have taken a brief look at the dhcp4 code, and maby
daemonizing actions could be performed somewhere after calling
server.init(config_file); if requested by such a flag? This way the
process could block the terminal until after checking the configuration,
and either exit with a failure code, or go into the background.

If adding another way of running the process is frowned upon, maby a
"check the configuration and exit" mode could be added as some other
flag?

Just throwing the ideas out there, I might of course be missing some
obvious reason why none of these would be good solutions :).

-- 
Patrik Lundin



More information about the Kea-users mailing list