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>
Mon, 4 Apr 2011 17:58:55 +0000 (10:58 -0700)
commit00c08589876b7c1cd8f57e5ebb3e66bb164c5a3d
tree975fd01be03267487ef2fc4317484ada0a5c27b0
parentaf9a144207eb1b4fdfd735b29f90c41f80aa9a2e
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