Python daemon ate my syslog message
prgmr.com
prgmr.com
Had one thrown away the fallacious idea that one has to, or even can, "dæmonize" from a login session context to a dæmon context, this entire problem wouldn't have arisen, irrespective of whether one logged to syslog or to standard error (which is another factor in its own right).
It looks like daemon.DaemonContext() is the function to recommend avoiding here, not just os.close() of arbitrary file descriptors.
Closing random file descriptors in complex systems is extremely dangerous practice, and I had to debug the same bugs in C++ programs as well.
(The ancient advice to close all file descriptors on demonization only applies to simpler programs where the programmer knows each file descriptor used. Once third-party libraries come into play, this is no longer safe)
* http://jdebp.uk./FGA/unix-daemon-design-mistakes-to-avoid.ht...