I'm not sure I understand what you mean by "daemon should duplicate all 
standard descriptors to
/dev/null." Perhaps you can help me in my ignorance.

Ah, yes. Usually, fully background daemons close 0, 1 and 2 (stdin, out and err) and dup() them to /dev/null, and also do a setsid().

This prevents accidentially opened ttys (and sessions) to be held open or msgs (e.g. perror()) going somewhere where they possibly shouldn't. One also could dup() them to a file, so all output goes there in case some library functions really wants to use stdout or -err.

I think closing stdin is quite crucial to correct operation, else the daemon could accidentially get blocked.

Cheers,
Ronny
_______________________________________________
mauiusers mailing list
[email protected]
http://www.supercluster.org/mailman/listinfo/mauiusers

Reply via email to