thuehlinger / daemons

Ruby daemons gem official repository
MIT License
648 stars 71 forks source link

Detatch doesn't consider external logging #70

Open johlym opened 6 years ago

johlym commented 6 years ago

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.