[python-daemon-Bugs][315211] Cannot control exit of parent process

python-daemon-bugs at alioth.debian.org python-daemon-bugs at alioth.debian.org
Tue Oct 27 20:41:15 UTC 2015


python-daemon-Bugs item #315211, was opened at 2015-10-27 20:41 by Robie Basak
You can respond by visiting: 
https://alioth.debian.org/tracker/?func=detail&atid=413098&aid=315211&group_id=100328

Status: Open
Priority: 3
Submitted By: Robie Basak (rbasak-guest)
Assigned to: Nobody (None)
Summary: Cannot control exit of parent process 


Initial Comment:
Thank you for python-daemon. It makes the common case really easy to implement.

I'd like to register one shortcoming I found with the current specification and implementation. It is assumed that the caller wants the parent process to exit 0 immediately after forking. But this is quite limiting.

In the Sys V init.d world, at the point the parent exits, the daemon is expected to be ready. But sometimes this needs interaction with the daemon (the child or grandchild process) to make sure this is the case. A standard Unix method might be to create a pipe for communication between the parent and grandchild to ensure that the parent exits only after the child signals that it is ready. But this isn't possible with the current spec.

Can I suggest that you add a callback as an option to replace the "os._exit(0)" in the current implementation, leaving "os._exit(0)" as the default behaviour? Then the caller can control what happens to the parent after it forks, as well as control the exit status of the parent when it does exit.

----------------------------------------------------------------------

You can respond by visiting: 
https://alioth.debian.org/tracker/?func=detail&atid=413098&aid=315211&group_id=100328



More information about the python-daemon-bugs mailing list