I've got a complex PERL application running and it has a CLI. Part of this CLI is that you can hit CTRL-C to stop the current process and return to the command-line. Now, I'm trapping SIGINT by doing a
my $abort = 0; my $old_sig_int = $SIG{'INT'} || ''; $SIG{'INT'} = sub { $abort = 1; };
and handling $abort later in the code. Now, on occasion, one of my users has noticed that if he hits CTRL-C, he actually causes a SIGTERM in the select() call I use to act as my heartbeat timer. Why would this happen? I've read through all the books I have and cannot find why this would be.

The big problem with this is that Perl 5.005_2 doesn't remove the job from Solaris 2.6. As the application is a resource hog, this causes the server to come to a slow and grinding halt.

1) Is trapping $SIG{'TERM'} going to be useful? 2) Why is select() throwing a SIGTERM in the first place? 3) Why is it just one account and not another? I cannot reproduce it from my account, but can from his at will.

(Yes, I know I should be using Sockets, but I haven't upgraded the application to do so. Perl5.6 isn't coming for a while, so I have to make do with what I've got.)


In reply to Handling SIGTERM by satchboost

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.