Project Home
Project Home
Wiki
Wiki
Discussion Forums
Discussions
Project Information
Project Info
Forum Topic - Why does launching inetd create a zombie process?: (10 Items)
   
Why does launching inetd create a zombie process?  
Hi:

We use the following script in our buildifs for starting up our network related resources:

ifconfig en0 10.13.129.77 netmask 255.255.252.0
route add 0.0.0.0 10.13.128.2
inetd /etc/inetd.conf &

If I instrument the above script with 'pidin' calls before and after the inetd calls, I  notice that a zombie process 
seems to get created:

pidin -F "%a %60N %e"
  .
  .
  .
 155673 bin/sh                                                          1
 159771 proc/boot/io-net                                           1
 172058 proc/boot/esh                                              155673
 188444 (Zombie)                                                     172058
 188445 proc/boot/pidin                                            172058
 188446 proc/boot/inetd                                           188444

The third column is the parent PID. As you can see the Zombie is owned by esh which runs the network init script. Esh in
 turn is spawned by the sh command which is launched by yet another higher level script in the buildifs.

After a short time, the zombie get taken over by the kernel and cleaned up some time later. However, in the meantime the
 existance of a zombie process causes other problems with our software.

Any idea what this zombie process is and why it gets created? I tried removing the ampersand when launching and it 
resolves the zombie creation problem however the inetd process is now stuck in a SIGSUSPEND state.




Re: Why does launching inetd create a zombie process?  
On Fri, Mar 27, 2009 at 02:49:43PM -0400, Robert D'Attilio wrote:
> Hi:
> 
> We use the following script in our buildifs for starting up our network related resources:
> 
> ifconfig en0 10.13.129.77 netmask 255.255.252.0
> route add 0.0.0.0 10.13.128.2
> inetd /etc/inetd.conf &
> 
> If I instrument the above script with 'pidin' calls before and after the inetd calls, I  notice that a zombie process 
seems to get created:
> 
> pidin -F "%a %60N %e"
>   .
>   .
>   .
>  155673 bin/sh                                                          1
>  159771 proc/boot/io-net                                           1
>  172058 proc/boot/esh                                              155673
>  188444 (Zombie)                                                     172058
>  188445 proc/boot/pidin                                            172058
>  188446 proc/boot/inetd                                           188444
> 
> The third column is the parent PID. As you can see the Zombie is owned by esh which runs the network init script. Esh 
in turn is spawned by the sh command which is launched by yet another higher level script in the buildifs.
> 
> After a short time, the zombie get taken over by the kernel and cleaned up some time later. However, in the meantime 
the existance of a zombie process causes other problems with our software.
> 
> Any idea what this zombie process is and why it gets created? I tried removing the ampersand when launching and it 
resolves the zombie creation problem however the inetd process is now stuck in a SIGSUSPEND state.
> 

I suspect the zombie is some artifact of using esh.  The SIGUSPEND is
entered when inetd doesn't have any sockets to listen on (nothing to
do).   Try 'inetd -d' (no ampersand) and see what it reports.

-seanb
RE: Why does launching inetd create a zombie process?  
Sean:

Substituting 'inetd -d' for 'inetd &' in my ip startup script ends up
hanging the startup script and I cannot telnet into the card because
inetd is not running or hung itself. I can still ping the card though.




-----Original Message-----
From: Sean Boudreau [mailto:community-noreply@qnx.com] 
Sent: Monday, March 30, 2009 11:29 AM
To: general-networking
Subject: Re: Why does launching inetd create a zombie process?

On Fri, Mar 27, 2009 at 02:49:43PM -0400, Robert D'Attilio wrote:
> Hi:
> 
> We use the following script in our buildifs for starting up our
network related resources:
> 
> ifconfig en0 10.13.129.77 netmask 255.255.252.0
> route add 0.0.0.0 10.13.128.2
> inetd /etc/inetd.conf &
> 
> If I instrument the above script with 'pidin' calls before and after
the inetd calls, I  notice that a zombie process seems to get created:
> 
> pidin -F "%a %60N %e"
>   .
>   .
>   .
>  155673 bin/sh
1
>  159771 proc/boot/io-net                                           1
>  172058 proc/boot/esh
155673
>  188444 (Zombie)
172058
>  188445 proc/boot/pidin
172058
>  188446 proc/boot/inetd
188444
> 
> The third column is the parent PID. As you can see the Zombie is owned
by esh which runs the network init script. Esh in turn is spawned by the
sh command which is launched by yet another higher level script in the
buildifs.
> 
> After a short time, the zombie get taken over by the kernel and
cleaned up some time later. However, in the meantime the existance of a
zombie process causes other problems with our software.
> 
> Any idea what this zombie process is and why it gets created? I tried
removing the ampersand when launching and it resolves the zombie
creation problem however the inetd process is now stuck in a SIGSUSPEND
state.
> 

I suspect the zombie is some artifact of using esh.  The SIGUSPEND is
entered when inetd doesn't have any sockets to listen on (nothing to
do).   Try 'inetd -d' (no ampersand) and see what it reports.

-seanb

_______________________________________________
General
http://community.qnx.com/sf/go/post25557
Re: Why does launching inetd create a zombie process?  
On Mon, Mar 30, 2009 at 12:16:02PM -0400, Robert D'Attilio wrote:
> Sean:
> 
> Substituting 'inetd -d' for 'inetd &' in my ip startup script ends up
> hanging the startup script and I cannot telnet into the card because
> inetd is not running or hung itself. I can still ping the card though.

-d is a debug flag.  One wouldn't use it in the field but I'm
curious as to what it spits out.  I suspect there's something wrong
with your inetd.conf file or you don't have perms to bind ...

-seanb
RE: Why does launching inetd create a zombie process?  
Started inetd -d from the command line and it spits out

# inetd -d /etc/inetd.conf
ADD : 3000 proto=tcp, wait:max=0.40, user:group=root. builtin=0
server=/bin/telnetd policy=
registered /bin/telnetd on 4

But it sits in the foreground now and takes over the shell (what I would
expect I guess since not putting it in the background with '&').

-----Original Message-----
From: Sean Boudreau [mailto:community-noreply@qnx.com] 
Sent: Monday, March 30, 2009 12:19 PM
To: general-networking
Subject: Re: Why does launching inetd create a zombie process?

On Mon, Mar 30, 2009 at 12:16:02PM -0400, Robert D'Attilio wrote:
> Sean:
> 
> Substituting 'inetd -d' for 'inetd &' in my ip startup script ends up
> hanging the startup script and I cannot telnet into the card because
> inetd is not running or hung itself. I can still ping the card though.

-d is a debug flag.  One wouldn't use it in the field but I'm
curious as to what it spits out.  I suspect there's something wrong
with your inetd.conf file or you don't have perms to bind ...

-seanb

_______________________________________________
General
http://community.qnx.com/sf/go/post25570


______________________________________________________________________
This email has been scanned by the MessageLabs Email Security System.
For more information please visit http://www.messagelabs.com/email 
______________________________________________________________________
Re: RE: Why does launching inetd create a zombie process?  
> Started inetd -d from the command line and it spits out
> 
> # inetd -d /etc/inetd.conf
> ADD : 3000 proto=tcp, wait:max=0.40, user:group=root. builtin=0
> server=/bin/telnetd policy=
> registered /bin/telnetd on 4
> 
> But it sits in the foreground now and takes over the shell (what I would
> expect I guess since not putting it in the background with '&').
> 

So in this case it looks like telnet was added
successfully so presumably this instance isn't in
SIGSUSPEND.  Do any differences come to mind
between this method and the way it's started
from your startup script?

-seanb
RE: RE: Why does launching inetd create a zombie process?  
The only difference is I manually invoked the following from the
command-line rather than from within a script:

# io-net -dppc405 mac=00019c00266e -ptcpip &
# ifconfig en0 10.13.129.77 netmask 255.255.252.0
# route add 0.0.0.0 10.13.128.2
# inetd /etc/inetd.conf 

For reference here are scripts used for starting the network components
from within our buildifs. /scripts/ip_config kicks everything off and is
called from within the .script section of the buildifs.

Contents of buildifs:
	[perms=+x] /scripts/ip_config = {
	#!/bin/sh    
	if [ -e /doc/mac_dbm_init ]
	then
  		echo macdbminit
  		esh /doc/mac_dbm_init
	else
  		echo macinit
  		esh /tmp/mac_init
	fi

	commonSlWaitForPro /dev/socket
    
	if [ -e /doc/ip_dbm_init ] 
	then
  		echo ipdbminit 
  		esh /doc/ip_dbm_init
	else
  		echo ipinit
  		esh /tmp/ip_init
	fi  
	}

Contents of /doc/mac_dbm_int:
	io-net -dppc405 mac=00019c00266e -ptcpip &

Contents of /doc/ip_dbm_init:
	ifconfig en0 10.13.129.77 netmask 255.255.252.0
	route add 0.0.0.0 10.13.128.2
	inetd /etc/inetd.conf &


I tried using just the regular shell (/bin/sh) instead of esh for
launching the two sub-scripts and I don't see the zombie but the console
spews out some garbled logs about 'something' not being found (I can't
decipher it - it's as if two processes are writing to the console at the
same time). However, the IP stack and inetd daemon appear to be working.
I'm thinking the garbled log is due to my syntax trying to invoke the
two subshells?

Robert


-----Original Message-----
From: Sean Boudreau [mailto:community-noreply@qnx.com] 
Sent: Tuesday, March 31, 2009 9:43 AM
To: general-networking
Subject: Re: RE: Why does launching inetd create a zombie process?

> Started inetd -d from the command line and it spits out
> 
> # inetd -d /etc/inetd.conf
> ADD : 3000 proto=tcp, wait:max=0.40, user:group=root. builtin=0
> server=/bin/telnetd policy=
> registered /bin/telnetd on 4
> 
> But it sits in the foreground now and takes over the shell (what I
would
> expect I guess since not putting it in the background with '&').
> 

So in this case it looks like telnet was added
successfully so presumably this instance isn't in
SIGSUSPEND.  Do any differences come to mind
between this method and the way it's started
from your startup script?

-seanb

_______________________________________________
General
http://community.qnx.com/sf/go/post25643
Re: RE: Why does launching inetd create a zombie process?  
On Tue, Mar 31, 2009 at 10:15:04AM -0400, Robert D'Attilio wrote:
> The only difference is I manually invoked the following from the
> command-line rather than from within a script:
> 
> # io-net -dppc405 mac=00019c00266e -ptcpip &
> # ifconfig en0 10.13.129.77 netmask 255.255.252.0
> # route add 0.0.0.0 10.13.128.2
> # inetd /etc/inetd.conf 
> 
> For reference here are scripts used for starting the network components
> from within our buildifs. /scripts/ip_config kicks everything off and is
> called from within the .script section of the buildifs.
> 
> Contents of buildifs:
> 	[perms=+x] /scripts/ip_config = {
> 	#!/bin/sh    
> 	if [ -e /doc/mac_dbm_init ]
> 	then
>   		echo macdbminit
>   		esh /doc/mac_dbm_init
> 	else
>   		echo macinit
>   		esh /tmp/mac_init
> 	fi
> 
> 	commonSlWaitForPro /dev/socket
>     
> 	if [ -e /doc/ip_dbm_init ] 
> 	then
>   		echo ipdbminit 
>   		esh /doc/ip_dbm_init
> 	else
>   		echo ipinit
>   		esh /tmp/ip_init
> 	fi  
> 	}
> 
> Contents of /doc/mac_dbm_int:
> 	io-net -dppc405 mac=00019c00266e -ptcpip &

Shouldn't need the ampersand above.

> 
> Contents of /doc/ip_dbm_init:

	
	waitfor /dev/socket/2
	if_up -p en0
> 	ifconfig en0 10.13.129.77 netmask 255.255.252.0
> 	route add 0.0.0.0 10.13.128.2
> 	inetd /etc/inetd.conf &

again, shouldn't need the ampersand above.
> 
> 
> I tried using just the regular shell (/bin/sh) instead of esh for
> launching the two sub-scripts and I don't see the zombie but the console
> spews out some garbled logs about 'something' not being found (I can't
> decipher it - it's as if two processes are writing to the console at the
> same time). However, the IP stack and inetd daemon appear to be working.
> I'm thinking the garbled log is due to my syntax trying to invoke the
> two subshells?
> 
> Robert
> 
> 
> -----Original Message-----
> From: Sean Boudreau [mailto:community-noreply@qnx.com] 
> Sent: Tuesday, March 31, 2009 9:43 AM
> To: general-networking
> Subject: Re: RE: Why does launching inetd create a zombie process?
> 
> > Started inetd -d from the command line and it spits out
> > 
> > # inetd -d /etc/inetd.conf
> > ADD : 3000 proto=tcp, wait:max=0.40, user:group=root. builtin=0
> > server=/bin/telnetd policy=
> > registered /bin/telnetd on 4
> > 
> > But it sits in the foreground now and takes over the shell (what I
> would
> > expect I guess since not putting it in the background with '&').
> > 
> 
> So in this case it looks like telnet was added
> successfully so presumably this instance isn't in
> SIGSUSPEND.  Do any differences come to mind
> between this method and the way it's started
> from your startup script?
> 
> -seanb
> 
> _______________________________________________
> General
> http://community.qnx.com/sf/go/post25643
> 
> 
> _______________________________________________
> General
> http://community.qnx.com/sf/go/post25651
> 
RE: RE: Why does launching inetd create a zombie process?  
I wonder if there's some sort of race condition in there.

There should probably be a "waitfor /dev/io-net/en0 4" after the io-net
command and an "if_up en0" after the ifconfig.

	R.

-----Original Message-----
From: Robert D'Attilio [mailto:community-noreply@qnx.com] 
Sent: Tuesday, March 31, 2009 10:15 AM
To: general-networking
Subject: RE: RE: Why does launching inetd create a zombie process?

The only difference is I manually invoked the following from the
command-line rather than from within a script:

# io-net -dppc405 mac=00019c00266e -ptcpip & # ifconfig en0 10.13.129.77
netmask 255.255.252.0 # route add 0.0.0.0 10.13.128.2 # inetd
/etc/inetd.conf 

For reference here are scripts used for starting the network components
from within our buildifs. /scripts/ip_config kicks everything off and is
called from within the .script section of the buildifs.

Contents of buildifs:
	[perms=+x] /scripts/ip_config = {
	#!/bin/sh    
	if [ -e /doc/mac_dbm_init ]
	then
  		echo macdbminit
  		esh /doc/mac_dbm_init
	else
  		echo macinit
  		esh /tmp/mac_init
	fi

	commonSlWaitForPro /dev/socket
    
	if [ -e /doc/ip_dbm_init ] 
	then
  		echo ipdbminit 
  		esh /doc/ip_dbm_init
	else
  		echo ipinit
  		esh /tmp/ip_init
	fi  
	}

Contents of /doc/mac_dbm_int:
	io-net -dppc405 mac=00019c00266e -ptcpip &

Contents of /doc/ip_dbm_init:
	ifconfig en0 10.13.129.77 netmask 255.255.252.0
	route add 0.0.0.0 10.13.128.2
	inetd /etc/inetd.conf &


I tried using just the regular shell (/bin/sh) instead of esh for
launching the two sub-scripts and I don't see the zombie but the console
spews out some garbled logs about 'something' not being found (I can't
decipher it - it's as if two processes are writing to the console at the
same time). However, the IP stack and inetd daemon appear to be working.
I'm thinking the garbled log is due to my syntax trying to invoke the
two subshells?

Robert


-----Original Message-----
From: Sean Boudreau [mailto:community-noreply@qnx.com]
Sent: Tuesday, March 31, 2009 9:43 AM
To: general-networking
Subject: Re: RE: Why does launching inetd create a zombie process?

> Started inetd -d from the command line and it spits out
> 
> # inetd -d /etc/inetd.conf
> ADD : 3000 proto=tcp, wait:max=0.40, user:group=root. builtin=0 
> server=/bin/telnetd policy= registered /bin/telnetd on 4
> 
> But it sits in the foreground now and takes over the shell (what I
would
> expect I guess since not putting it in the background with '&').
> 

So in this case it looks like telnet was added successfully so
presumably this instance isn't in SIGSUSPEND.  Do any differences come
to mind between this method and the way it's started from your startup
script?

-seanb

_______________________________________________
General
http://community.qnx.com/sf/go/post25643


_______________________________________________
General
http://community.qnx.com/sf/go/post25651
RE: RE: Why does launching inetd create a zombie process?  
"pidin fam" will tell you who is the parent of the zombie, that would
probably give you an idea.

-xtang 

> -----Original Message-----
> From: Robert Craig [mailto:community-noreply@qnx.com] 
> Sent: Tuesday, March 31, 2009 10:25 AM
> To: general-networking
> Subject: RE: RE: Why does launching inetd create a zombie process?
> 
> I wonder if there's some sort of race condition in there.
> 
> There should probably be a "waitfor /dev/io-net/en0 4" after 
> the io-net command and an "if_up en0" after the ifconfig.
> 
> 	R.
> 
> -----Original Message-----
> From: Robert D'Attilio [mailto:community-noreply@qnx.com]
> Sent: Tuesday, March 31, 2009 10:15 AM
> To: general-networking
> Subject: RE: RE: Why does launching inetd create a zombie process?
> 
> The only difference is I manually invoked the following from 
> the command-line rather than from within a script:
> 
> # io-net -dppc405 mac=00019c00266e -ptcpip & # ifconfig en0 
> 10.13.129.77 netmask 255.255.252.0 # route add 0.0.0.0 
> 10.13.128.2 # inetd /etc/inetd.conf 
> 
> For reference here are scripts used for starting the network 
> components from within our buildifs. /scripts/ip_config kicks 
> everything off and is called from within the .script section 
> of the buildifs.
> 
> Contents of buildifs:
> 	[perms=+x] /scripts/ip_config = {
> 	#!/bin/sh    
> 	if [ -e /doc/mac_dbm_init ]
> 	then
>   		echo macdbminit
>   		esh /doc/mac_dbm_init
> 	else
>   		echo macinit
>   		esh /tmp/mac_init
> 	fi
> 
> 	commonSlWaitForPro /dev/socket
>     
> 	if [ -e /doc/ip_dbm_init ] 
> 	then
>   		echo ipdbminit 
>   		esh /doc/ip_dbm_init
> 	else
>   		echo ipinit
>   		esh /tmp/ip_init
> 	fi  
> 	}
> 
> Contents of /doc/mac_dbm_int:
> 	io-net -dppc405 mac=00019c00266e -ptcpip &
> 
> Contents of /doc/ip_dbm_init:
> 	ifconfig en0 10.13.129.77 netmask 255.255.252.0
> 	route add 0.0.0.0 10.13.128.2
> 	inetd /etc/inetd.conf &
> 
> 
> I tried using just the regular shell (/bin/sh) instead of esh 
> for launching the two sub-scripts and I don't see the zombie 
> but the console spews out some garbled logs about 'something' 
> not being found (I can't decipher it - it's as if two 
> processes are writing to the console at the same time). 
> However, the IP stack and inetd daemon appear to be working.
> I'm thinking the garbled log is due to my syntax trying to 
> invoke the two subshells?
> 
> Robert
> 
> 
> -----Original Message-----
> From: Sean Boudreau [mailto:community-noreply@qnx.com]
> Sent: Tuesday, March 31, 2009 9:43 AM
> To: general-networking
> Subject: Re: RE: Why does launching inetd create a zombie process?
> 
> > Started inetd -d from the command line and it spits out
> > 
> > # inetd -d /etc/inetd.conf
> > ADD : 3000 proto=tcp, wait:max=0.40, user:group=root. builtin=0 
> > server=/bin/telnetd policy= registered /bin/telnetd on 4
> > 
> > But it sits in the foreground now and takes over the shell (what I
> would
> > expect I guess since not putting it in the background with '&').
> > 
> 
> So in this case it looks like telnet was added successfully 
> so presumably this instance isn't in SIGSUSPEND.  Do any 
> differences come to mind between this method and the way it's 
> started from your startup script?
> 
> -seanb
> 
> _______________________________________________
> General
> http://community.qnx.com/sf/go/post25643
> 
> 
> _______________________________________________
> General
> http://community.qnx.com/sf/go/post25651
> 
> 
> _______________________________________________
> General
>...