daemons icon indicating copy to clipboard operation
daemons copied to clipboard

Detatch doesn't consider external logging

Open johlym opened this issue 7 years ago • 0 comments

We're noticing with the daemons gem that when it detaches the process for daemonization, it closes all the file descriptors and I/O streams. On the surface that's fine, but when it re-opens them, it doesn't consider external I/O streams and only opens the STD* pipes and logging to files. It seems like there's an assumption that the only logging that would take place is internal via one of the STDs or to a file. An example would be using the papertrail/remote_syslog_loger gem and witnessing the stream cut off (RemoteSyslogLogger::UdpSender error: IOError: closed stream).

If I'm way off here or there's a workaround for this, let me know. We see this the most in relation to the use of the delayed_job gem, which uses daemons.

johlym avatar Jul 18 '18 23:07 johlym