On Wed, Aug 10, 2016 at 11:51 PM, Ben Pfaff <b...@ovn.org> wrote: > > Hmm. I think that OVS actually solves all of these problems. First, > the return code of the parent should be correct, in that if the child > fails to start properly the parent exits with a nonzero exit code. > Second, observers can ensure that the pidfile is tied to a running > process by checking that the pidfile is locked (with fcntl) by the > process. >
While I do think you're right, that OVS is one of those examples where it actually have been implemented correctly (lock PID files, forbid forking, handle the parent-child IPC), I would prefer to execute the less complex code if possible. If nothing else because it's easier to reason about and that small point of consistency as we're trying to have other daemons not forking either. The nonzero exit code works fine when you detect a startup condition, but if you need to signal an abnormal exit during operation (post-fork) you're out of luck. I guess systemd is capable of reading this anyway, being the init process, but I would prefer not to have depend on that if we want to have something else managing these processes down the line. I guess in the end it's probably not a big deal to me to add this > systemd integration, assuming that whatever library systemd requires for > it is easy to integrate with and has a stable API/ABI. > FWIW, the protocol is: 1. Connect to the UNIX socket specified via the environment variable NOTIFY_SOCKET 2. Write 'READY=1' to it. I suggest sending a patch. > Will do, thanks. _______________________________________________ dev mailing list dev@openvswitch.org http://openvswitch.org/mailman/listinfo/dev