krill icon indicating copy to clipboard operation
krill copied to clipboard

Krill should be able to daemonize

Open Jakker opened this issue 4 years ago • 3 comments

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.

Jakker avatar Apr 13 '21 11:04 Jakker

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

ximon18 avatar Apr 13 '21 12:04 ximon18

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.

Jakker avatar Apr 13 '21 13:04 Jakker

The upcoming https://github.com/NLnetLabs/daemonbase crate might be of use here.

ximon18 avatar Dec 06 '23 14:12 ximon18