Latest LQ Deal: Latest LQ Deals
Go Back > Forums > Linux Forums > Linux - Newbie
User Name
Linux - Newbie This Linux forum is for members that are new to Linux.
Just starting out and have a question? If it is not in the man pages or the how-to's this is the place!


  Search this Thread
Old 12-24-2006, 07:48 AM   #1
Registered: Oct 2004
Location: /usr/home
Distribution: Mint, Ubuntu server, FreeBSD, Android
Posts: 362

Rep: Reputation: 32
shell script terminates as zombie, ie, <defunct>

Hi all,

A shell script of mine which runs on a regular basis appears not to exit properly; if I run ps -e, I see more than a dozen instances of it marked as <defunct>. I don't suppose it matters as they don't appear to be using CPU or memory, but still I suspect it must be something fairly simple to fix.

Adding "exit" at the bottom of the script has no effect. What else could it be?


Last edited by Kropotkin; 12-25-2006 at 09:48 AM.
Old 12-24-2006, 08:01 AM   #2
Senior Member
Registered: Jan 2005
Location: Manalapan, NJ
Distribution: Fedora x86 and x86_64, Debian PPC and ARM, Android
Posts: 4,593
Blog Entries: 2

Rep: Reputation: 344Reputation: 344Reputation: 344Reputation: 344
Defunct processes (also called zombies) are the result of a process dying, but not being "reaped" by the parent process. To reap defunct processes, the parent process must call wait. See 'man bash' or the man page for whatever shell you are using.
Old 02-19-2007, 04:51 AM   #3
Registered: Mar 2006
Location: South Africa
Distribution: Ubuntu, Slackware, openSuse
Posts: 44

Rep: Reputation: 15
Hi Guys,

I am experiencing the same problem. Does anyone have an idea as to what causes a script to go into a 'defunct' state? My script is running off cron and the only way I am able to terminate it is by stopping the cron daemon.
Old 02-20-2007, 12:15 AM   #4
Registered: Feb 2007
Location: Bangalore
Distribution: Fedora
Posts: 33

Rep: Reputation: 15
If your shell script has capability of forking the process, then this problem will occur..Normally the child process can only be killed/terminated by the parent process. But if the parent process got killed due to some reason, then the child process cannot be killed unless recieving a kill signal from parent, so this will never happen and the child becomes zombie.


Thread Tools Search this Thread
Search this Thread:

Advanced Search

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is Off
HTML code is Off

Similar Threads
Thread Thread Starter Forum Replies Last Post
Shell Scripting: Getting a pid and killing it via a shell script topcat Programming 15 10-28-2007 02:14 AM
killev script not killing defunct evolution ender42 Ubuntu 1 05-06-2006 10:00 AM
I made a shortcut to a shell script and it is using default shell icon... shlinux Linux - Software 2 04-20-2006 06:29 AM
Alias or shell script to confirm 'exit' commands from a shell rose_bud4201 Programming 2 03-08-2006 02:34 PM
shell script problem, want to use shell script auto update IP~! singying304 Programming 4 11-29-2005 05:32 PM > Forums > Linux Forums > Linux - Newbie

All times are GMT -5. The time now is 03:54 AM.

Main Menu
Write for LQ is looking for people interested in writing Editorials, Articles, Reviews, and more. If you'd like to contribute content, let us know.
Main Menu
RSS1  Latest Threads
RSS1  LQ News
Twitter: @linuxquestions
Open Source Consulting | Domain Registration