in reply to Re: Do infinite loops ever die?
in thread Do infinite loops ever die?
What is susposed to happen is that closing your telnet session notifies the server which then sends HUP (hang-up -- gee, can you tell that Unix is old) to the process group for that session which kills all processes that haven't arranged to ignore or catch SIGHUP/$SIG{HUP}. Putting it into the background shouldn't prevent it from getting killed (that is why there is a "nohup" command).
The reason that this didn't happen right away in your case is probably because your session wasn't sending any output. In the face of silence, TCP doesn't notice a broken connection for a long time. Actually, killing the telnet client should cause the operating system to close the socket. You would think that close would do the equivalent of shutdown(2), but this doesn't seem to always happen.
Wait 8 minutes and see if the loop is still running.
- tye (but my friends call me "Tye")
|
|---|