Re: [Speedycgi-users] Probem of terminating a forked process
Brought to you by:
samh
|
From: Chung-Kie T. <tu...@tu...> - 2003-11-07 15:44:39
|
On Fri, 7 Nov 2003 00:53:51 +0800, Chung-Kie Tung wrote
> -example 2--------------------------------
> #!/usr/local/bin/speedy
> $|=1;
> $SIG{CHLD}=sub { wait }; # prevent zombie
> print "parent $$\n";
> if (fork()==0) {
> print "child $$\n\n";
> exit 0;
> }
> -------------------------------------------
I have found one solution.
Just use $SIG{CHLD}='IGNORE';
instead of $SIG{CHLD}=sub { wait };
Then parent won't terminate and forked process won't be zombies.
But I am still wondering why sub { wait} would terminate the parent
speedycgi process. :(
Regards.
tung
--
Distributed System Laboratory (http://dslab.ee.ncku.edu.tw)
Department of Electrical Engineering
National Cheng Kung University, Tainan, Taiwan, R.O.C.
|