#12 Daemonise properly

open
nobody
5
2004-02-24
2004-02-24
Anonymous
No

Queued does not close stdin, stdout and stderr, which a
daemon should really do. This causes a problem when
starting queue via rsh (i.e. rsh host /etc/init.d/queue
start). I use rsh for controlling my cluster machines
as none of them have monitors/keyboards, but the
behaviour of rsh is to wait for queue to finish because
it does not close the standard file handles, causing
everything to hang.

This simple patch fixes the problem by closing fds 0,1
and 2, and re-opening them as /dev/null.

Submitted by Matthew Newton
<matthew01@newtoncomputing.co.uk>

Discussion

  • queued file descriptor close patch

     
    Attachments