From: kaliko Date: Sun, 22 May 2011 18:07:14 +0000 (+0200) Subject: Write pid before resetting umask X-Git-Tag: 0.2~3 X-Git-Url: https://git.kaliko.me/?a=commitdiff_plain;h=82bc69181956d577250d19894d325bb9f1aaca79;p=python-daemon.git Write pid before resetting umask --- diff --git a/src/daemon.py b/src/daemon.py index 787cb65..7489233 100644 --- a/src/daemon.py +++ b/src/daemon.py @@ -59,7 +59,6 @@ class Daemon(object): sys.stderr.write("fork #2 failed: %d (%s)\n" % (e.errno, e.strerror)) sys.exit(1) - self.write_pid() # redirect standard file descriptors sys.stdout.flush() sys.stderr.flush() @@ -114,6 +113,7 @@ class Daemon(object): sys.stderr.write(message % self.pidfile) sys.exit(1) + self.write_pid() # Start the daemon self.daemonize() self.run()