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")

In reply to (tye)Re: Do infinite loops ever die? by tye
in thread Do infinite loops ever die? by nysus

Title:
Use:  <p> text here (a paragraph) </p>
and:  <code> code here </code>
to format your post, it's "PerlMonks-approved HTML":



  • Posts are HTML formatted. Put <p> </p> tags around your paragraphs. Put <code> </code> tags around your code and data!
  • Titles consisting of a single word are discouraged, and in most cases are disallowed outright.
  • Read Where should I post X? if you're not absolutely sure you're posting in the right place.
  • Please read these before you post! —
  • Posts may use any of the Perl Monks Approved HTML tags:
    a, abbr, b, big, blockquote, br, caption, center, col, colgroup, dd, del, details, div, dl, dt, em, font, h1, h2, h3, h4, h5, h6, hr, i, ins, li, ol, p, pre, readmore, small, span, spoiler, strike, strong, sub, summary, sup, table, tbody, td, tfoot, th, thead, tr, tt, u, ul, wbr
  • You may need to use entities for some characters, as follows. (Exception: Within code tags, you can put the characters literally.)
            For:     Use:
    & &amp;
    < &lt;
    > &gt;
    [ &#91;
    ] &#93;
  • Link using PerlMonks shortcuts! What shortcuts can I use for linking?
  • See Writeup Formatting Tips and other pages linked from there for more info.