"be consistent" | |
PerlMonks |
lost signalsby Xanatax (Scribe) |
on Jul 20, 2001 at 14:59 UTC ( [id://98370]=perlquestion: print w/replies, xml ) | Need Help?? |
Xanatax has asked for the wisdom of the Perl Monks concerning the following question:
i have a server, which forks children to deal with connections, but when i send INT signals to the server the children do not always get them. my server, which forks and deals with each incoming connection. when i send the server an INT (ie i hit ^C on the console) it is supposed to stop doing everything, but i found the children continue... i altered the parent's responce to a SIGINT to send all the children a SIGINT as well. to do this i set then send the INT back to the whole process group with i don't know that this is the most elegant way, but after doing this i find that i send an INT to the server both it and it's children all do down. this is what i want, except, if the child is in the middle of a command, it completely misses getting the signal. the command fails, and the child keeps on running. and will continue to respond to more commands. i am guessing this has to do with the child being in a system() call when it gets the INT... the next trick is, if i change the above code to the children get teh signal no matter what, but the parent doesn't ignore it, gets it twice and seg faults... so i would like input on remedies to this problem, or alternatives means of interrupting the server that do not have this problem...
Back to
Seekers of Perl Wisdom
|
|