X-Git-Url: http://git.onelab.eu/?a=blobdiff_plain;f=python%2Fovs%2Fdaemon.py;h=cfb417831421d20942eb20c33794d2d7347b6599;hb=37865d539dabd50321ee252173d853676ee0a7d8;hp=4df23715944e657e6664b0b284bd652c74de2e12;hpb=8fb32694154c620dce9ff0379a744178f73c1c89;p=sliver-openvswitch.git diff --git a/python/ovs/daemon.py b/python/ovs/daemon.py index 4df237159..cfb417831 100644 --- a/python/ovs/daemon.py +++ b/python/ovs/daemon.py @@ -89,9 +89,9 @@ def is_chdir_enabled(): return _chdir def ignore_existing_pidfile(): - """Normally, die_if_already_running() will terminate the program with a - message if a locked pidfile already exists. If this function is called, - die_if_already_running() will merely log a warning.""" + """Normally, daemonize() or daemonize_start() will terminate the program + with a message if a locked pidfile already exists. If this function is + called, an existing pidfile will be replaced, with a warning.""" global _overwrite_pidfile _overwrite_pidfile = True @@ -111,7 +111,7 @@ def set_monitor(): global _monitor _monitor = True -def die_if_already_running(): +def _die_if_already_running(): """If a locked pidfile exists, issue a warning message and, unless ignore_existing_pidfile() has been called, terminate the program.""" if _pidfile is None: @@ -343,6 +343,7 @@ def daemonize_start(): _monitor_daemon(daemon_pid) # Running in daemon process + _die_if_already_running() _make_pidfile() def daemonize_complete():