Update: Because you said here, that you send a HUP, not a USR1.

Sending a HUP to a process that isn't prepared to catch a SIGHUP will terminate. Exactly what you described and a lot of the helpful people here couldn't reproduce with USR1.

You might like to add an additional HUP handler $SIG{HUP} = \&status; to print the status on HUP reception. But I would not recommend this, since HUP is a signal that will be send from the OS e.g. when the system is shut down or an interactive connection is closed. Using USR1 or USR2 is the usual way to do it.

So the right way to get the status information would be kill -s USR1 <pid> (where <pid> is a positive integer). You could add a line like print "Status info: kill -s USR1 $$\n" to your program to get the correct PID without having to look for it.

If that doesn't work, I do not have much more ideas... yet.


In reply to Re^6: Signal to parent-process. Does it affect it's children? by Perlbotics
in thread Signal to parent-process. Does it affect it's children? by rapide

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.