Skip to content
This repository has been archived by the owner on Aug 26, 2019. It is now read-only.

Commit

Permalink
changed pidfile location because of security vulnerability, debian bu…
Browse files Browse the repository at this point in the history
…g #631912
  • Loading branch information
irmen committed Sep 1, 2011
1 parent 1df908f commit 554e095
Showing 1 changed file with 7 additions and 1 deletion.
8 changes: 7 additions & 1 deletion Pyro/ext/daemonizer.py
Original file line number Diff line number Diff line change
Expand Up @@ -47,7 +47,9 @@ class Daemonizer:
"""
def __init__(self, pidfile=None):
if not pidfile:
self.pidfile = "/tmp/%s.pid" % self.__class__.__name__.lower()
# PID file moved out of /tmp to avoid security vulnerability
# changed by Debian maintainer per Debian bug #631912
self.pidfile = "/var/run/pyro-%s.pid" % self.__class__.__name__.lower()
else:
self.pidfile = pidfile

Expand Down Expand Up @@ -121,12 +123,16 @@ def main_loop(self):

def process_command_line(self, argv, verbose=1):
usage = "usage: %s start | stop | restart | status | debug " \
"[--pidfile=...] " \
"(run as non-daemon)" % os.path.basename(argv[0])
if len(argv) < 2:
print usage
raise SystemExit
else:
operation = argv[1]
if len(argv) > 2 and argv[2].startswith('--pidfile=') and \
len(argv[2]) > len('--pidfile='):
self.pidfile = argv[2][len('--pidfile='):]
pid = self.get_pid()
if operation == 'status':
if self.is_process_running():
Expand Down

0 comments on commit 554e095

Please sign in to comment.