2 ms·
Ironically, this is yet another example of why "dæmonization" is a fallacy. Closing all open file descriptors broke the library code that was using a private f
by JdeBP 6y ago
Ironically, this is yet another example of why "dæmonization" is a fallacy. Closing all open file descriptors broke the library code that was using a private file descriptor to send things to the syslog server. It breaks that, other forms of logging, and indeed other library functions that might hold on to private file descriptors for whatever reason.
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.