Hi, On Wed, Aug 10, 2016 at 6:15 PM, Ben Pfaff <b...@ovn.org> wrote:
> This is how OVS works. > Only when specifically launched with --detach. It's not the binary default, which I feel is important to note. > What's the advantage of sd_notify? You say that sd_notify() is > "recommended". By whom, and where? And with what benefit? > The recommendation is by systemd developers argued in the threads I linked earlier. I think you actually quoted some of the drawbacks, but I'll explain some of the ones I'm aware off. Basically the reason forking is not great is that you lose access to a bunch of things like: 1. return code of the process 2. which PID is the master process Point 2 is solved by having PID files, but those are inherently painful and racy as well. Reading the PID to find out if the process is still running requires trickery like making sure the PID is: 1. Alive and 2. The same process as you expect (due to PID recycling). Furthermore, as you're doing a fork - you're limited in what you can do when. It's fundamentally more difficult to write software that uses threads that also need to use fork() for example. OVS has nice semantics for this, so assuming the developer uses the daemonize constructs provided correctly there should be no problem - but that could be said about a lot of things. And finally, to return to my initial point, it provides a way to run a service in the default mode - non-detached. _______________________________________________ dev mailing list dev@openvswitch.org http://openvswitch.org/mailman/listinfo/dev