LinuxQuestions.org
Latest LQ Deal: Latest LQ Deals
Home Forums Tutorials Articles Register
Go Back   LinuxQuestions.org > Forums > Linux Forums > Linux - General
User Name
Password
Linux - General This Linux forum is for general Linux questions and discussion.
If it is Linux Related and doesn't seem to fit in any other forum then this is the place.

Notices


Reply
  Search this Thread
Old 07-25-2007, 03:51 AM   #1
hondo
Member
 
Registered: Jul 2005
Location: norway
Posts: 198

Rep: Reputation: 33
Process not killed with -KILL (-9) signal


Hi

I have some processes (custom processes for customers) that doesnt get killed when i issue the command "kill -9 (PID)". I cant kill the PPID since its the init process. When i issue this command i dont get any information about any errors when trying to kill the process. A restart of the machine would take of this, but its not something i can do right now. Any ideas on how to kill processes that doesnt get killed with the -KILL signal (-9) ? This signal is suppose to kill everything "in its path".
 
Old 07-25-2007, 08:47 AM   #2
cconstantine
Member
 
Registered: Dec 2005
Distribution: RedHat, Ubuntu
Posts: 101

Rep: Reputation: 15
child processes

init can't/won't reap the process if it has children. The process [the one you signalled] will go away when the last of it's children exit. Look for other processes with parent-PID matching the process you're trying to kill... kill them too (or decide they should be allowed to finish.)

either way, once you kill-9 it, the process has no resources to speak of.

-c
 
Old 07-25-2007, 09:23 AM   #3
colucix
LQ Guru
 
Registered: Sep 2003
Location: Bologna
Distribution: CentOS 6.5 OpenSuSE 12.3
Posts: 10,509

Rep: Reputation: 1983Reputation: 1983Reputation: 1983Reputation: 1983Reputation: 1983Reputation: 1983Reputation: 1983Reputation: 1983Reputation: 1983Reputation: 1983Reputation: 1983
At least two kind of processes (regarding their status) cannot be killed: "defunct" and "in uninterruptible sleep". Defunct processes (also known as zombies) are childs whose parents do not receive notification about their fate: if the child dies and the parent does not take care of it, the only way to kill a zombie (without rebooting) is to quit or kill the parent (as cconstantine said).
A process in uninterruptable sleep is often a process waiting from a signal from a piece of hardware: if the hardware fails to send the signal, the process sleeps forever, unless you can manually restore the problem. For example, it can happen with floppy drivers and ejecting/reinserting the floppy disk could solve the situation.
You can check the status and the parenthood of the processes with the following ps command
Code:
ps -eO user -H
as an example, at this very moment I have a zombie generated from firefox and the related output from the above command is
Code:
13498 colucix  S ?        00:00:00   /bin/sh /usr/lib/firefox-1.5.0.10/firefox -UILocale en-US
13520 colucix  S ?        00:00:00     /bin/sh /usr/lib/firefox-1.5.0.10/run-mozilla.sh /usr/lib/firefox-1.5.0.10/firefox-bin -UILocale en-US
13525 colucix  S ?        00:01:31       /usr/lib/firefox-1.5.0.10/firefox-bin -UILocale en-US
13532 colucix  Z ?        00:00:00         [netstat] <defunct>
The third column is the status: Z means zombie, D means uninterruptible sleep. Hope this will help.

Last edited by colucix; 07-25-2007 at 09:25 AM.
 
  


Reply



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 On
HTML code is Off



Similar Threads
Thread Thread Starter Forum Replies Last Post
ld terminated by signal 9 [killed] rustyz82 Linux - Software 3 09-15-2015 08:14 AM
how a father process know which child process send the signal SIGCHLD icoming Programming 10 07-20-2010 07:26 AM
kill the process invoked from a shell script, when the script is killed kskkumar Linux - Software 8 05-23-2007 11:29 AM
cannot kill process (kill -9 does not work) mazer13a Linux - General 1 05-27-2005 02:32 PM
When I kill parent process, child isn't killed BengeBoy Linux - Software 0 08-19-2004 04:38 PM

LinuxQuestions.org > Forums > Linux Forums > Linux - General

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

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