On Sun, 18 Feb 2007, Amos Shapira wrote:

That's why you must use both a reaper and select() with timeout.

What's the point of select(2) with a timeout? How long should the timeout be
set and what should be checked when it's reached? Why wouldn't a child
reaper be enough in the situation Baruch describes?

In general - I'm very vey unfond of solutions which involve busy waits (and
a select with a timeout is busy wait in my dictionary).

This is not a busy wait at all. Select with a timeout yields until one of the sockets needs attention.

It is very possible and very likely that there will be no SIGCHLD from a properly written deaemon child because it will become a process group leader. Also many daemons whose source is not available will go into the background and become a pgld as above and thus anything forking them will exit and give off a SIGCHLD.

There is NO way to tell if a daemon is 'alive' or stuck etc excepting when it sends or receives data through a socket. The only part of the system that is able to detect this is the network subsystem, using iptables or the method applied by SE Linux. iptables can be 'booby trapped' to call a user mode application when packets are detected on certain ports. This can be used to open the firewall when needed if desired (like windows firewalls do).

Peter

=================================================================
To unsubscribe, send mail to [EMAIL PROTECTED] with
the word "unsubscribe" in the message body, e.g., run the command
echo unsubscribe | mail [EMAIL PROTECTED]

Reply via email to