diff --git a/daemonize.py b/daemonize.py index 2585b09..d17b9a5 100644 --- a/daemonize.py +++ b/daemonize.py @@ -106,6 +106,8 @@ def start(self): self.logger.error("Unable to fork, errno: {0}".format(e.errno)) sys.exit(1) if process_id != 0: + with open(self.pid, "w") as pidfile: + pidfile.write(str(process_id)) if self.keep_fds: # This is the parent process. Exit without cleanup, # see https://github.com/thesharp/daemonize/issues/46