473,387 Members | 1,326 Online
Bytes | Software Development & Data Engineering Community
Post Job

Home Posts Topics Members FAQ

Join Bytes to post your question to a community of 473,387 software developers and data experts.

Child process does not exit after receiving SIGTERM

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
Nov 14 '05 #1
4 4282
Teresa <te***********@yahoo.com> spoke thus:
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.

--
Christopher Benson-Manica | I *should* know what I'm talking about - if I
ataru(at)cyberspace.org | don't, I need to know. Flames welcome.
Nov 14 '05 #2
Teresa <te***********@yahoo.com> spoke thus:
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.

--
Christopher Benson-Manica | I *should* know what I'm talking about - if I
ataru(at)cyberspace.org | don't, I need to know. Flames welcome.
Nov 14 '05 #3
te***********@yahoo.com (Teresa) wrote in message news:<f2**************************@posting.google. com>...
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
Nov 14 '05 #4
te***********@yahoo.com (Teresa) wrote in message news:<f2**************************@posting.google. com>...
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
Nov 14 '05 #5

This thread has been closed and replies have been disabled. Please start a new discussion.

Similar topics

1
by: Tung Wai Yip | last post by:
I've build the following utility. It works so far but I want to make sure I'm doing the right thing. I am running Python 2.3 on windows 2000. def execute(cmd): """ execute cmd in sub-process,...
6
by: Bob Swerdlow | last post by:
My application starts up a number of processes for various purposes using: self.popen = popen2.Popen3("/usr/local/bin/python -O "myscript.py") and then shuts them down when appropriate with...
5
by: Natan | last post by:
Hi. I have a python script under linux where I poll many hundreds of interfaces with mrtg every 5 minutes. Today I create some threads and use os.system(command) to run the process, but some of...
0
by: Teresa | last post by:
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...
10
by: I. Myself | last post by:
Suppose we spawn a child process with Popen. I'm thinking of an executable file, like a compiled C program. Suppose it is supposed to run for one minute, but it just keeps going and going. Does...
13
by: Academic | last post by:
I have a MDI form, sometimes child forms and sometimes forms that are neither If I close the app the child forms closing and closed event happens followed by the Mdi form receiving the...
15
by: Thomas Dybdahl Ahle | last post by:
Hi, When I do a small program like from subprocess import Popen popen = Popen() from time import sleep sleep(100) start it and kill it, the ping process lives on. Is there a way to ensure...
4
by: jewel87 | last post by:
Hi everyone! I'm writing some code in C under UNIX, which should give some output like this: PARENT: pid = 10063 CHILD: my pid = 10064 CHILD: my parent's pid = 10063 CHILD: Sleeping... PARENT:...
0
by: Cameron Simpson | last post by:
On 24Jul2008 17:30, Robert Rawlins <robert.rawlins@thinkbluemedia.co.ukwrote: | but mind the caveats: | | Thanks Tim, the main caveat which worries me is the fact that it doesn't get | called...
0
by: taylorcarr | last post by:
A Canon printer is a smart device known for being advanced, efficient, and reliable. It is designed for home, office, and hybrid workspace use and can also be used for a variety of purposes. However,...
0
by: Charles Arthur | last post by:
How do i turn on java script on a villaon, callus and itel keypad mobile phone
0
by: ryjfgjl | last post by:
If we have dozens or hundreds of excel to import into the database, if we use the excel import function provided by database editors such as navicat, it will be extremely tedious and time-consuming...
0
by: emmanuelkatto | last post by:
Hi All, I am Emmanuel katto from Uganda. I want to ask what challenges you've faced while migrating a website to cloud. Please let me know. Thanks! Emmanuel
0
BarryA
by: BarryA | last post by:
What are the essential steps and strategies outlined in the Data Structures and Algorithms (DSA) roadmap for aspiring data scientists? How can individuals effectively utilize this roadmap to progress...
1
by: nemocccc | last post by:
hello, everyone, I want to develop a software for my android phone for daily needs, any suggestions?
0
marktang
by: marktang | last post by:
ONU (Optical Network Unit) is one of the key components for providing high-speed Internet services. Its primary function is to act as an endpoint device located at the user's premises. However,...
0
Oralloy
by: Oralloy | last post by:
Hello folks, I am unable to find appropriate documentation on the type promotion of bit-fields when using the generalised comparison operator "<=>". The problem is that using the GNU compilers,...
0
jinu1996
by: jinu1996 | last post by:
In today's digital age, having a compelling online presence is paramount for businesses aiming to thrive in a competitive landscape. At the heart of this digital strategy lies an intricately woven...

By using Bytes.com and it's services, you agree to our Privacy Policy and Terms of Use.

To disable or enable advertisements and analytics tracking please visit the manage ads & tracking page.