T
Teresa
Platform: Unix Tru 64 OSF 4.0D
Problem:
I spawned 3 processes. Proc A, B and C. My problem is that the
parent process, proc A, sends SIGTERM to proc C; However, proc C
does not exit some of the time. Proc C becomes a zombie and init does
not clean it up.
The following is how proc A, B and C are set up.
Proc A
/ \
/ \
/ \ Connected_socket
Proc B <----> Proc C <---------------------> Some_other_server
Proc A is the parent of B and C. Proc B and C exchange data. Proc C
reads data from proc B, writes it to a conneted socket on another
server. Then proc C reads data from the connected socket and sends
this data to proc B.
Process B always ends first. When proc B, is done, it exits. The
parent, proc A, is notified proc B exited via waitpid(). Then the
parent, proc A, sends a SIGTERM to proc C. Proc C's SIGTERM handler
closes the connected socket and then calls exit(1); Hoever, sometimes
Proc C does not exit. Since the parent process, proc A, does not have
anymore children proceses, it exists leaving Proc C to be inherited by
init, process 1. The only way to end Proc C is to send SIGKILL from
the Unix prompt.
I appreatiate any ideas/solutions you may provide.
Thanks
-Teresa
Problem:
I spawned 3 processes. Proc A, B and C. My problem is that the
parent process, proc A, sends SIGTERM to proc C; However, proc C
does not exit some of the time. Proc C becomes a zombie and init does
not clean it up.
The following is how proc A, B and C are set up.
Proc A
/ \
/ \
/ \ Connected_socket
Proc B <----> Proc C <---------------------> Some_other_server
Proc A is the parent of B and C. Proc B and C exchange data. Proc C
reads data from proc B, writes it to a conneted socket on another
server. Then proc C reads data from the connected socket and sends
this data to proc B.
Process B always ends first. When proc B, is done, it exits. The
parent, proc A, is notified proc B exited via waitpid(). Then the
parent, proc A, sends a SIGTERM to proc C. Proc C's SIGTERM handler
closes the connected socket and then calls exit(1); Hoever, sometimes
Proc C does not exit. Since the parent process, proc A, does not have
anymore children proceses, it exists leaving Proc C to be inherited by
init, process 1. The only way to end Proc C is to send SIGKILL from
the Unix prompt.
I appreatiate any ideas/solutions you may provide.
Thanks
-Teresa