in reply to Kill a child nicely
Usually, there is an escalation in signals you sent to a program to stop it. You start with SIGINT, if that does not help, you send SIGTERM after a while, and as a last resort, you send SIGKILL. On the receiver side, you can set up signal handlers for SIGINT and SIGTERM, but not for SIGKILL.
So, you propably want to set up a signal handler for SIGINT and/or SIGTERM. See %SIG in perlvar and "Signals" in perlipc. accept(), like almost all syscalls, will return with an error (EINTR) after a signal was sent to the process. In the signal handler, you set some "I want to exit" flag, and check that flag after accept() has returned an error.
Alexander
|
|---|