def get_pidfile():
"""Returns an absolute path to the configured pidfile, or None if no
- pidfile is configured. The caller must not modify or free the returned
- string."""
+ pidfile is configured."""
return _pidfile
def set_no_chdir():
if os.WIFSIGNALED(status):
for signame in ("SIGABRT", "SIGALRM", "SIGBUS", "SIGFPE", "SIGILL",
"SIGPIPE", "SIGSEGV", "SIGXCPU", "SIGXFSZ"):
- if (signame in signal.__dict__ and
- os.WTERMSIG(status) == signal.__dict__[signame]):
+ if os.WTERMSIG(status) == getattr(signal, signame, None):
return True
return False
logging.warning("%s: failed to delete stale pidfile"
% (pidfile, e.strerror))
return -e.errno
-
- logging.debug("%s: deleted stale pidfile" % pidfile)
- file.close()
- return 0
+ else:
+ logging.debug("%s: deleted stale pidfile" % pidfile)
+ file.close()
+ return 0
except IOError, e:
if e.errno not in [errno.EACCES, errno.EAGAIN]:
logging.warn("%s: fcntl: %s" % (pidfile, e.strerror))