in reply to Re^5: Signal to parent-process. Does it affect it's children?
in thread Signal to parent-process. Does it affect it's children?
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.
|
|---|
| Replies are listed 'Best First'. | |
|---|---|
|
Re^7: Signal to parent-process. Does it affect it's children?
by rapide (Beadle) on Sep 11, 2008 at 13:00 UTC | |
by shmem (Chancellor) on Sep 11, 2008 at 15:41 UTC | |
by rapide (Beadle) on Sep 11, 2008 at 16:47 UTC |