Good comment!
I use kill -s HUP <pid> from the shell. I've also tried to do this from a unaffected script with:
kill "USR1", <pid>
So unless there are something I don't see here, Its not the problem :/ | [reply] [d/l] |
Why not kill -s USR1 <pid>?
In your example, you only specified a handler for USR1, not HUP...
| [reply] [d/l] |
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.
| [reply] [d/l] [select] |
| [reply] |