daemon: Integrate checking for an existing pidfile into daemonize_start().
authorBen Pfaff <blp@nicira.com>
Thu, 31 Mar 2011 16:44:30 +0000 (09:44 -0700)
committerBen Pfaff <blp@nicira.com>
Fri, 29 Apr 2011 21:31:49 +0000 (14:31 -0700)
commit37865d539dabd50321ee252173d853676ee0a7d8
tree94905333603db18e5586d2ba626a3580e7d40460
parent8fb32694154c620dce9ff0379a744178f73c1c89
daemon: Integrate checking for an existing pidfile into daemonize_start().

Until now, it has been the responsibility of an individual daemon to call
die_if_already_running() at an appropriate time.  A long time ago, this
had to happen *before* daemonizing, because once the process daemonized
itself there was no way to report failure to the process that originally
started the daemon.  With the introduction of daemonize_start(), this is
now possible, but we haven't been taking advantage of it.

Therefore, this commit integrates the die_if_already_running() call into
daemonize_start() and deletes the calls to it from individual daemons.
13 files changed:
debian/ovs-monitor-ipsec
lib/daemon.c
lib/daemon.h
ovsdb/ovsdb-server.c
python/ovs/daemon.py
tests/test-daemon.py
tests/test-jsonrpc.c
tests/test-jsonrpc.py
utilities/ovs-controller.c
utilities/ovs-openflowd.c
vswitchd/ovs-brcompatd.c
vswitchd/ovs-vswitchd.c
xenserver/usr_share_openvswitch_scripts_ovs-xapi-sync