Skip to content
Open
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 2 additions & 0 deletions daemonize.py
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down