[ovs-dev] [RFC] systemd notification integration
Christian Svensson
christian at cmd.nu
Wed Aug 10 15:27:09 UTC 2016
Hi,
As far as I understand, right now the daemonizing flow for an OVS process
is:
1. Process calls daemonize_start to fork into a child if running in
detached mode
Parent waits until daemonize_complete is called
2. Child (or parent if not daemonized) executes initialization
3. daemonize_complete is called when the process is confident that the
initialization was successful.
This causes the parent process to exit (or no-op if not daemonized).
This is all well for processes using --detach and 'Type=forking' in systemd
world.
However, the recommended practice is not to use forking but to use
systemd's notifications - calling sd_notify.
Would a patch to call sd_notify be welcome? Obviously this would be gated
on if the system has systemd (--with-systemd etc.).
The patch I'm thinking would be to add:
#ifdef HAVE_SYSTEMD
sd_notify(0, "READY=1");
#endif
in daemonize_complete (or other place if a better one is suggested).
And the equivalent for Python of course.
For further reading and discussions by smarter people than me for other
daemons:
https://sourceware.org/ml/libc-alpha/2014-02/msg00732.html
https://sourceware.org/ml/libc-alpha/2014-02/msg00738.html
https://lists.debian.org/debian-ssh/2015/05/msg00017.html
Thanks for your consideration,
More information about the dev
mailing list