473,473 Members | 1,510 Online
Bytes | Software Development & Data Engineering Community
Create Post

Home Posts Topics Members FAQ

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 4285
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: Hystou | last post by:
There are some requirements for setting up RAID: 1. The motherboard and BIOS support RAID configuration. 2. The motherboard has 2 or more available SATA protocol SSD/HDD slots (including MSATA, M.2...
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...
1
by: Hystou | last post by:
Overview: Windows 11 and 10 have less user interface control over operating system update behaviour than previous versions of Windows. In Windows 11 and 10, there is no way to turn off the Windows...
0
tracyyun
by: tracyyun | last post by:
Dear forum friends, With the development of smart home technology, a variety of wireless communication protocols have appeared on the market, such as Zigbee, Z-Wave, Wi-Fi, Bluetooth, etc. Each...
1
isladogs
by: isladogs | last post by:
The next Access Europe User Group meeting will be on Wednesday 1 May 2024 starting at 18:00 UK time (6PM UTC+1) and finishing by 19:30 (7.30PM). In this session, we are pleased to welcome a new...
0
by: conductexam | last post by:
I have .net C# application in which I am extracting data from word file and save it in database particularly. To store word all data as it is I am converting the whole word file firstly in HTML and...
0
by: 6302768590 | last post by:
Hai team i want code for transfer the data from one system to another through IP address by using C# our system has to for every 5mins then we have to update the data what the data is updated ...

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.