PEP 3143 and customizations
Helmut Grohne
helmut at subdivi.de
Wed May 21 21:45:07 UTC 2014
On Wed, May 21, 2014 at 02:34:45PM -0700, Ethan Furman wrote:
> So, if I understood your latest post, one of the two things is that Parent
> doesn't exit until it knows that Child started up with no errors, and it
> gets this info via a pipe (according to your PoC); if Child does experience
> an error, the error text is passed through the pipe to be printed. Either
> way, Parent will exit fairly shortly after Child starts, just not
> immediately.
The pipe is an implementation detail and therefore replaceable. The
described behaviour is what I want. This behaviour is required by
systemd when setting Type=forking and generally useful for avoiding race
conditions in daemon startup.
> The second thing you want is for continued set up to happen in Child after
> Child is spawned... oh, wait -- I think I understand -- you want Parent to
> hang around and wait for the result of the continued set up in Child, so it
> can report any errors encountered... have I understood?
Yeah, if there was no need to do setup in the child, the whole problem
would go away. Just setup first and then daemonize. Unfortunately some
things must be set up in the child, but with the current implementation
the child can no longer signal any failures back to the user. All it can
do is fail silently. Bad.
I don't care how this is achieved and whether my POC is used (I donate
it under PSF-2+ in case you want it), just cover the use case in some
way please. The only way to do this with the current implementation is
to copy&paste DaemonContext.open or monkey-patch.
Helmut
More information about the python-daemon-devel
mailing list