[ovs-git] Open vSwitch: daemon: Allow daemon child process to report success or failure to parent. (next)

dev at openvswitch.org dev at openvswitch.org
Fri Dec 18 21:47:45 UTC 2009

This is an automated email from the git hooks/post-receive script. It was
generated because a ref change was pushed to the repository containing
the project "Open vSwitch".

The branch, next has been updated
       via  95440284bdf8ac9a94c3e119d011d76acab577a7 (commit)
      from  058fd2a2741deff874db53f0d7cdbf743e1f2a0f (commit)

Those revisions listed above that are new to this repository have
not appeared on any other notification email; so we list those
revisions in full, below.

- Log -----------------------------------------------------------------
commit 95440284bdf8ac9a94c3e119d011d76acab577a7
Diffs: http://openvswitch.org/cgi-bin/gitweb.cgi?p=openvswitch;a=commitdiff;h=95440284bdf8ac9a94c3e119d011d76acab577a7
Author: Ben Pfaff <blp at nicira.com>
daemon: Allow daemon child process to report success or failure to parent.
There are conflicting pressures in startup of a daemon process:

    * The parent process should exit with an error code if the daemon
      cannot start up successfully.

    * Some startup actions must be performed in the child process, not in
      the parent.  The most obvious of these are file locking, since
      child processes do not inherit locks, and anything that requires
      knowing the child process's PID (e.g. unixctl sockets).

Until now, this conflict has usually been handled by giving up part of the
first property, i.e. in some cases the parent process would exit
successfully and the child immediately afterward exit with a failure code.

This commit introduces a better approach, by allowing daemons to perform
startup work in the child and only then signal the parent that they have
successfully started.  If the child instead exits without signaling
success, the parent passes this exit code along to its own parent.

This commit also modifies the daemons that can usefully take advantage of
this new feature to do so.


Summary of changes:
 lib/daemon.c               |   87 ++++++++++++++++++++++++++++++++------------
 lib/daemon.h               |    2 +
 ovsdb/ovsdb-server.c       |   42 ++++++----------------
 utilities/ovs-controller.c |    4 ++-
 utilities/ovs-openflowd.c  |    4 ++-
 vswitchd/ovs-brcompatd.c   |    4 ++-
 vswitchd/ovs-vswitchd.c    |    4 ++-
 7 files changed, 88 insertions(+), 59 deletions(-)

Open vSwitch

More information about the git mailing list