Bug preventing HUP completion.

Just a bit of cruft from the pidfile updates.
This commit is contained in:
Paul J. Davis 2010-05-16 14:02:55 -04:00
parent a52a6fda17
commit 1a03c3f36e
2 changed files with 4 additions and 4 deletions

View File

@ -287,7 +287,7 @@ class Arbiter(object):
Relaunch the master and workers.
"""
if self.pidfile is not None:
self.pidfile.rename("%s.oldbin" % self.pidfile.path)
self.pidfile.rename("%s.oldbin" % self.pidfile.fname)
self.reexec_pid = os.fork()
if self.reexec_pid != 0:

View File

@ -42,17 +42,17 @@ class Pidfile(object):
def rename(self, path):
self.unlink()
self.path = path
self.fname = path
self.create(self.pid)
def unlink(self):
""" delete pidfile"""
try:
with open(self.path, "r") as f:
with open(self.fname, "r") as f:
pid1 = int(f.read() or 0)
if pid1 == self.pid:
os.unlink(self.path)
os.unlink(self.fname)
except:
pass