Child process does not exit after receiving SIGTERM

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
 
C

Christopher Benson-Manica

Teresa said:
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.
I appreatiate any ideas/solutions you may provide.

Your post is off-topic for comp.lang.c. Please visit

http://www.ungerhu.com/jxh/clc.welcome.txt
http://www.eskimo.com/~scs/C-faq/top.html
http://benpfaff.org/writings/clc/off-topic.html

for posting guidelines and frequently asked questions. Thank you.
 
R

Rob Thorpe

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

Ask comp.unix.programmer
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Members online

No members online now.

Forum statistics

Threads
473,744
Messages
2,569,484
Members
44,903
Latest member
orderPeak8CBDGummies

Latest Threads

Top