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
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:
_monitor_daemon(daemon_pid)
# Running in daemon process
+ _die_if_already_running()
_make_pidfile()
def daemonize_complete():