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
$SIG{INT} = 'IGNORE';
then send the INT back to the whole process group with
kill -2, $$;
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
local $SIG{INT} = 'IGNORE';
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...
TIA,
xanatax.