LinuxQuestions.org
Visit Jeremy's Blog.
Go Back   LinuxQuestions.org > Forums > Linux Forums > Linux - Software
User Name
Password
Linux - Software This forum is for Software issues.
Having a problem installing a new program? Want to know which application is best for the job? Post your question in this forum.

Notices


Reply
  Search this Thread
Old 01-05-2008, 12:31 AM   #1
trapeze
LQ Newbie
 
Registered: Jan 2008
Posts: 10

Rep: Reputation: 0
Angry cannot kill process, FC7


i'm root. i use ps to find out pid of processse i wanna kill. i type "kill xxx" but the process is still there ! what the heck ...!?
 
Old 01-05-2008, 12:50 AM   #2
Drakeo
Senior Member
 
Registered: Jan 2008
Location: Urbana IL
Distribution: Slackware, Slacko,
Posts: 3,716
Blog Entries: 3

Rep: Reputation: 483Reputation: 483Reputation: 483Reputation: 483Reputation: 483
killall

Quote:
Originally Posted by trapeze View Post
i'm root. i use ps to find out pid of processse i wanna kill. i type "kill xxx" but the process is still there ! what the heck ...!?
if you want to kill the program you dont need the pid in root. just type killall then the program name killall all together . if i want to stop my dialup program I type killall pppd
 
Old 01-05-2008, 01:48 AM   #3
Angry Penguin
LQ Newbie
 
Registered: Jan 2008
Location: Michigan
Distribution: Debian Etch/Testing/Unstable
Posts: 2

Rep: Reputation: 0
Try kill -9 'pid'. Kill uses TERM by default, and a running process might be hung and not respond to TERM, -9 is the KILL signal, and it terminates a process ungracefully.
 
Old 01-05-2008, 02:28 AM   #4
trapeze
LQ Newbie
 
Registered: Jan 2008
Posts: 10

Original Poster
Rep: Reputation: 0
Question

Quote:
Originally Posted by Angry Penguin View Post
Try kill -9 'pid'. Kill uses TERM by default, and a running process might be hung and not respond to TERM, -9 is the KILL signal, and it terminates a process ungracefully.
thanks.

[root@localhost /]# ps
PID TTY TIME CMD
4662 pts/0 00:00:00 bash
5732 pts/0 00:00:00 yum
5764 pts/0 00:00:00 yum
6854 pts/0 00:00:00 man
6876 pts/0 00:00:00 sh
6878 pts/0 00:00:00 less
6900 pts/0 00:00:00 man
6921 pts/0 00:00:00 sh <defunct>
6923 pts/0 00:00:00 less
6978 pts/0 00:00:00 man
6999 pts/0 00:00:00 sh <defunct>
7001 pts/0 00:00:00 less
7305 pts/0 00:00:00 man
7326 pts/0 00:00:00 sh <defunct>
7520 pts/0 00:00:00 ps

i tried "kill -9 PID" and those i tried are shown "defunct" above. if i ps again, it still shows this screen. however, when i wrote C programs under unix days ago i only needed to use "kill PID" only. Also, once i killed a process, the screen didn't show the one just killed(i mean the system cleared that entry immediately w/o displaying <defunct>) if i entered ps again. why !?

Last edited by trapeze; 01-05-2008 at 02:37 AM.
 
Old 01-05-2008, 02:35 AM   #5
trapeze
LQ Newbie
 
Registered: Jan 2008
Posts: 10

Original Poster
Rep: Reputation: 0
Unhappy

Quote:
Originally Posted by Drakeo View Post
if you want to kill the program you dont need the pid in root. just type killall then the program name killall all together . if i want to stop my dialup program I type killall pppd
thanks:

[root@localhost /]# ps
PID TTY TIME CMD
4662 pts/0 00:00:00 bash
5732 pts/0 00:00:00 yum
5764 pts/0 00:00:00 yum
6854 pts/0 00:00:00 man
6876 pts/0 00:00:00 sh
6878 pts/0 00:00:00 less
6900 pts/0 00:00:00 man
6921 pts/0 00:00:00 sh <defunct>
6923 pts/0 00:00:00 less
6978 pts/0 00:00:00 man
6999 pts/0 00:00:00 sh <defunct>
7001 pts/0 00:00:00 less
7305 pts/0 00:00:00 man
7326 pts/0 00:00:00 sh <defunct>
7780 pts/0 00:00:00 man
7801 pts/0 00:00:00 sh
7803 pts/0 00:00:00 less
7809 pts/0 00:00:00 man
7830 pts/0 00:00:00 sh
7831 pts/0 00:00:00 bzip2
7832 pts/0 00:00:00 less
7838 pts/0 00:00:00 man
7840 pts/0 00:00:00 sh
7842 pts/0 00:00:00 less
7852 pts/0 00:00:00 ps
[root@localhost /]# killall yum
[root@localhost /]# ps
PID TTY TIME CMD
4662 pts/0 00:00:00 bash
5732 pts/0 00:00:00 yum
5764 pts/0 00:00:00 yum
6854 pts/0 00:00:00 man
6876 pts/0 00:00:00 sh
6878 pts/0 00:00:00 less
6900 pts/0 00:00:00 man
6921 pts/0 00:00:00 sh <defunct>
6923 pts/0 00:00:00 less
6978 pts/0 00:00:00 man
6999 pts/0 00:00:00 sh <defunct>
7001 pts/0 00:00:00 less
7305 pts/0 00:00:00 man
7326 pts/0 00:00:00 sh <defunct>
7780 pts/0 00:00:00 man
7801 pts/0 00:00:00 sh
7803 pts/0 00:00:00 less
7809 pts/0 00:00:00 man
7830 pts/0 00:00:00 sh
7831 pts/0 00:00:00 bzip2
7832 pts/0 00:00:00 less
7838 pts/0 00:00:00 man
7840 pts/0 00:00:00 sh
7842 pts/0 00:00:00 less
7856 pts/0 00:00:00 ps
[root@localhost /]#

well.... yum's are still there. any ideas !?

Last edited by trapeze; 01-05-2008 at 02:38 AM.
 
Old 01-05-2008, 09:42 AM   #6
H_TeXMeX_H
LQ Guru
 
Registered: Oct 2005
Location: $RANDOM
Distribution: slackware64
Posts: 12,928
Blog Entries: 2

Rep: Reputation: 1301Reputation: 1301Reputation: 1301Reputation: 1301Reputation: 1301Reputation: 1301Reputation: 1301Reputation: 1301Reputation: 1301Reputation: 1301
You shouldn't have to remember 'kill -9', it's the same as 'kill -KILL' and the pid or you can use 'killall -KILL' and program name. If you wanted to kill all instances of yum you would run:

Code:
killall -KILL yum
as root.
 
Old 01-05-2008, 05:33 PM   #7
trapeze
LQ Newbie
 
Registered: Jan 2008
Posts: 10

Original Poster
Rep: Reputation: 0
Quote:
Originally Posted by H_TeXMeX_H View Post
You shouldn't have to remember 'kill -9', it's the same as 'kill -KILL' and the pid or you can use 'killall -KILL' and program name. If you wanted to kill all instances of yum you would run:

Code:
killall -KILL yum
as root.
thanks. it worked, too. i think both kill -9 xxx and killall -KILL name are feasible. however, i still wonder why i just needed to type kill pid under unix w/0 including -9 ???
 
Old 01-05-2008, 08:47 PM   #8
chrism01
LQ Guru
 
Registered: Aug 2004
Location: Sydney
Distribution: Rocky 9.2
Posts: 18,349

Rep: Reputation: 2750Reputation: 2750Reputation: 2750Reputation: 2750Reputation: 2750Reputation: 2750Reputation: 2750Reputation: 2750Reputation: 2750Reputation: 2750Reputation: 2750
As mentioned further up, normally
kill <pid>
is sufficient to tell a prog to close GRACEFULLY if you own it or you are root.
For emergencies and or if the prog is 'hung',
kill -9 <pid>
should kill it UNGRACEFULLY ie you risk open/corrupted files, broken sockets etc.
Occasionally you get processes so badly hung that they remain zombies until a reboot. This is rare, but has been known.
 
  


Reply


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
Process won't kill mrsolo Linux - Software 5 08-03-2007 12:45 PM
kill D process xrado Linux - General 4 07-04-2005 12:38 PM
cannot kill process (kill -9 does not work) mazer13a Linux - General 1 05-27-2005 02:32 PM
Cannot kill process Zeno McDohl Linux - General 13 04-14-2005 02:31 PM
kill a process for sure spuzzzzzzz Linux - General 1 06-05-2004 04:59 PM

LinuxQuestions.org > Forums > Linux Forums > Linux - Software

All times are GMT -5. The time now is 03:18 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