From 1a03c3f36e45ebd9a6097d640623486044177778 Mon Sep 17 00:00:00 2001 From: "Paul J. Davis" Date: Sun, 16 May 2010 14:02:55 -0400 Subject: [PATCH] Bug preventing HUP completion. Just a bit of cruft from the pidfile updates. --- gunicorn/arbiter.py | 2 +- gunicorn/pidfile.py | 6 +++--- 2 files changed, 4 insertions(+), 4 deletions(-) diff --git a/gunicorn/arbiter.py b/gunicorn/arbiter.py index ef9c2d5a..a2d5185e 100644 --- a/gunicorn/arbiter.py +++ b/gunicorn/arbiter.py @@ -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: diff --git a/gunicorn/pidfile.py b/gunicorn/pidfile.py index a8ba4c70..4684a772 100644 --- a/gunicorn/pidfile.py +++ b/gunicorn/pidfile.py @@ -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