[2 days left] What’s wrong with your cloud strategy? Learn why multicloud solutions matter with Nimble Storage.Register Now

x
?
Solved

killing defunct processes

Posted on 2002-04-15
16
Medium Priority
?
781 Views
Last Modified: 2013-12-06
How can I kill a defunct process without rebooting and when I get the following message after trying to kill it : "no such process"?
0
Comment
Question by:dgiessen
[X]
Welcome to Experts Exchange

Add your voice to the tech community where 5M+ people just like you are talking about what matters.

  • Help others & share knowledge
  • Earn cash & points
  • Learn & ask questions
  • 5
  • 4
  • 3
  • +3
16 Comments
 
LVL 11

Expert Comment

by:griessh
ID: 6942637
How do you try to kill the process.

Do a "ps -aef | grep <processname>" (or whatever your ps options are) and if you have the right you should be able to "kill -9 <PID>".

Are you the owner of the process of at least in the group that owns the process?

======
Werner
0
 
LVL 51

Expert Comment

by:ahoffmann
ID: 6942928
depends on your UNIX.
AFAIK not possible for SunOS, SOlaris, Irix, Linux, OSF
Not shure about AIX and HP-UX
0
 
LVL 14

Expert Comment

by:chris_calabrese
ID: 6942952
It's not possible on any UX system, including AIX and HP-UX.

On the other hand, defaunct processes are already dead, so there's really nothing to kill.

They just exist in the process tables because their parent process has not reaped them yet.

So, to directly anser the question, killing the parent will do the trick.
0
Concerto's Cloud Advisory Services

Want to avoid the missteps to gaining all the benefits of the cloud? Learn more about the different assessment options from our Cloud Advisory team.

 
LVL 51

Expert Comment

by:ahoffmann
ID: 6942965
> .. killing the parent will do the trick.
hmm, for deamons the parent is 1. It's also 1 if the parent died before.
So killing *this* parent (init) is a more crude way to do a reboot ;-)
0
 
LVL 11

Expert Comment

by:griessh
ID: 6942997
now I am confused ... I didn't get the feeling he is talking about a zombie process ...

======
Werner
0
 
LVL 14

Expert Comment

by:chris_calabrese
ID: 6943075
ahoffman - init will reap its children, so this should be a non-issue.

griessh - interesting comment.  I was picking up on the 'defunct' bit.  I _think_ the 'no such process' message sounds like a defunct process, but I'm not 100% on this.

dgiessen - are these 'defunct' processes according to 'ps'?
0
 

Author Comment

by:dgiessen
ID: 6943110
When I run ps -fu userx I get a listing showing a number of processes with various PID #'s, all associated with one PPID # and the CMD = <defunct> (for all).

If I run "kill 12345" (as root), I get "kill: 12345: no such process" ( a kill -9 12345 gives me the same result).

Seeing all the defunct processes out there is bad enough, but I also cannot log in under my ID because due to all the defunct processes, I'm getting an error at login saying "...max_proc_per_user (=64) exceeded..."

By the way, the OS is AIX.
0
 
LVL 14

Expert Comment

by:chris_calabrese
ID: 6943183
Yup, those are genuine defunct processes alright.

You need to kill the parent.
0
 
LVL 51

Expert Comment

by:ahoffmann
ID: 6943184
defunct processes cannot be killed anyhow, they are dead and alife ('til the parent removes them) --> zombie

> max_proc_per_user
can be changed with smitty
0
 
LVL 11

Expert Comment

by:griessh
ID: 6943250
Do you have an idea where those processes come from? I'm just curious, since I haven't seen more than 10 zombies on my AIX box since I'm working on it ...

======
Werner
0
 
LVL 14

Accepted Solution

by:
chris_calabrese earned 40 total points
ID: 6944705
They're caused by the process exiting but the parent never reaping them with the wait() family of system-calls.  Most likely you've got a program someone at your site wrote in C that fork()s a bunch of children and doesn't catch the SIG_CHLD signal that says one of them exited (and then you can call wait() in the signal handler...)
0
 
LVL 11

Expert Comment

by:griessh
ID: 6944760
chris

thanks for the reply. My question was actually for dgiessen ... I was curious if he is running some special software there.

======
Werner
0
 
LVL 14

Expert Comment

by:chris_calabrese
ID: 6944809
Oops, I was rifling through my mails and though the question was from dgiessen.

In that case, I second your question...
0
 

Author Comment

by:dgiessen
ID: 6944925
The only two "programs" associated with this particular user id are Cognos Impromptu report writer (which is run on a seperate Windows 2000 server) which accesses an Informix database on the AIX box and MS Access connecting from a Windows PC via ODBC to the same Informix database. Each application uses Informix ODBC drivers and seems to spawn the zombie processes.

When connecting through Access/ODBC, it spawns 1 process, regardless of how many times I reconnect to different databases within Informix. Through Cognos, I spawn 1 process for each different database I connect to.

At this point I'm also looking into how to get ODBC to cleanly close a table connection and not leave zombie processes and I'm trying to work with Cognos on the same issue.
0
 
LVL 21

Expert Comment

by:tfewster
ID: 7833714
No comment has been added lately, so it's time to clean up this Topic Area.
I will leave a recommendation for this question in the Cleanup topic area as follows:

- Answered by chris_calabrese

Please leave any comments here within the next 7 days

PLEASE DO NOT ACCEPT THIS COMMENT AS AN ANSWER !

tfewster (I don't work here, I'm just an Expert :-)
0
 

Expert Comment

by:modulo
ID: 7909036
Finalized as proposed

modulo

Community Support Moderator
Experts Exchange
0

Featured Post

Tech or Treat!

Submit an article about your scariest tech experience—and the solution—and you’ll be automatically entered to win one of 4 fantastic tech gadgets.

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

I promised to write further about my project, and here I am.  First, I needed to setup the Primary Server.  You can read how in this article: Setup FreeBSD Server with full HDD encryption (http://www.experts-exchange.com/OS/Unix/BSD/FreeBSD/A_3660-S…
Why Shell Scripting? Shell scripting is a powerful method of accessing UNIX systems and it is very flexible. Shell scripts are required when we want to execute a sequence of commands in Unix flavored operating systems. “Shell” is the command line i…
Learn how to find files with the shell using the find and locate commands. Use locate to find a needle in a haystack.: With locate, check if the file still exists.: Use find to get the actual location of the file.:
Learn how to navigate the file tree with the shell. Use pwd to print the current working directory: Use ls to list a directory's contents: Use cd to change to a new directory: Use wildcards instead of typing out long directory names: Use ../ to move…
Suggested Courses

649 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question