Krill should be able to daemonize
To ease starting krill as a server, it would be nice to have it daemonise (as an option?), just like routinator. It simplifies startup scripts which doesn't use a mechanism such as systemd or launchctl.
Hi @Jakker,
Which particular functionality are you looking for when you say "daemonise"? Are you just referring to "forking" (Routinator does this for example) or also to other behaviours relating to working directory, user and group, logging, etc.?
Thanks,
Ximon
Just to run it as a server as in routinator server -d ... is what I would like. Als setting user, group etc is a "nice to have". Under FreeBSD routinator is started as
pidfile=${wrkdir}/${name}.pid
routinator_config=${routinator_conf:-"/usr/local/etc/routinator/routinator.conf"}
required_file=${routinator_config}
command_args="-c ${routinator_config} --rsync-command=/usr/local/bin/rsync server -d --user routinator --group routinator --pid-file=${pidfile} --working-dir=${wrkdir}"
(Code snipped from the startup file)
But if that is too much work I can use daemon(8) although that is FreeBSD specific and not used a lot. To have an option for server type tools to daemonize themselves is nicer to my taste.
There is also daemonize but that adds yet another dependency.
The upcoming https://github.com/NLnetLabs/daemonbase crate might be of use here.