LinuxQuestions.org
Visit Jeremy's Blog.
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 08-18-2005, 08:28 PM   #1
Kanaflloric
Member
 
Registered: Jun 2004
Location: Canada
Distribution: Slackware 10.0
Posts: 80

Rep: Reputation: 15
Kill command could not kill


Hi

I made a mistake yesterday by exiting a program (python) using ctrl-Z and not ctrl-D. A python process stayed in memory, locking my CDROm.

I tried to kill it by entering something like :

$ kill 1234

It didn't work, so I tried the same under root. The process was still remaining in memory, and my cdrom was still locked. I had to reboot (like in windows).

Is there something I missed ? Isn't kill a "full powered" command, especially under root ?
 
Old 08-18-2005, 08:38 PM   #2
Bruce Hill
HCL Maintainer
 
Registered: Jun 2003
Location: McCalla, AL, USA
Distribution: Arch, Gentoo
Posts: 6,940

Rep: Reputation: 129Reputation: 129
# killall -9 python
 
Old 08-18-2005, 08:39 PM   #3
Matir
LQ Guru
 
Registered: Nov 2004
Location: San Jose, CA
Distribution: Debian, Arch
Posts: 8,507

Rep: Reputation: 128Reputation: 128
You could've sent it something like SIGCONT to make it keep running (undo Ctrl-Z), or SIGKILL (the strongest signal, also called a -9).
 
Old 08-18-2005, 08:42 PM   #4
PenguinPwrdBox
Member
 
Registered: Oct 2003
Posts: 568

Rep: Reputation: 31
Code:
kill -9 <PID>
-9 is the POSIX signal code for kill. This will stop all but the mightiest processes

man 7 signal for the rest...
 
Old 08-18-2005, 10:32 PM   #5
Matir
LQ Guru
 
Registered: Nov 2004
Location: San Jose, CA
Distribution: Debian, Arch
Posts: 8,507

Rep: Reputation: 128Reputation: 128
Also, kill -l for a quick reminder of the signals. Additionally, GNU kill supports -NAME for signal names, like -HUP for SIGHUP.
 
Old 08-19-2005, 06:39 AM   #6
imitheos
Member
 
Registered: May 2005
Location: Greece
Posts: 441

Rep: Reputation: 141Reputation: 141
Re: Kill command could not kill

Quote:
Originally posted by Kanaflloric
Hi

I made a mistake yesterday by exiting a program (python) using ctrl-Z and not ctrl-D. A python process stayed in memory, locking my CDROm.

I tried to kill it by entering something like :

$ kill 1234

It didn't work, so I tried the same under root. The process was still remaining in memory, and my cdrom was still locked. I had to reboot (like in windows).

Is there something I missed ? Isn't kill a "full powered" command, especially under root ?
I am sorry if i am wrong, but didn't ctrl-Z put it in background ?
If yes, you can run "fg" to bring it in foreground again and then press ctrl-D or do anything else you want.
 
Old 08-19-2005, 12:21 PM   #7
Kanaflloric
Member
 
Registered: Jun 2004
Location: Canada
Distribution: Slackware 10.0
Posts: 80

Original Poster
Rep: Reputation: 15
I didn't know that.
Thank you everybody.

Also, imitheos, I think you're right. I'll check that tonight.
 
Old 08-19-2005, 06:53 PM   #8
yongtin
LQ Newbie
 
Registered: Aug 2005
Posts: 7

Rep: Reputation: 0
Always do a man, man!
 
Old 08-21-2005, 05:29 AM   #9
LinuxSeeker
Member
 
Registered: Feb 2004
Location: Linuxland
Distribution: Ubuntu 5.10, KUbuntu 5.10, Mandrake 10.1 - Ubuntu 5.04 (Hoary)
Posts: 346

Rep: Reputation: 30
I use "kill -s sigkill <PID>"
 
Old 08-21-2005, 09:52 AM   #10
eddiebaby1023
Member
 
Registered: May 2005
Posts: 378

Rep: Reputation: 33
Quote:
Originally posted by LinuxSeeker
I use "kill -s sigkill <PID>"
Well, you obviously like typing!
 
Old 08-21-2005, 09:17 PM   #11
Matir
LQ Guru
 
Registered: Nov 2004
Location: San Jose, CA
Distribution: Debian, Arch
Posts: 8,507

Rep: Reputation: 128Reputation: 128
FYI, sending SIGKILL as a first try is a bad idea. SIGKILL should be reserved for the last thing you try on a hung process.
 
Old 08-22-2005, 07:18 AM   #12
LinuxSeeker
Member
 
Registered: Feb 2004
Location: Linuxland
Distribution: Ubuntu 5.10, KUbuntu 5.10, Mandrake 10.1 - Ubuntu 5.04 (Hoary)
Posts: 346

Rep: Reputation: 30
Quote:
Originally posted by eddiebaby1023
Well, you obviously like typing!
Well, considering that I currently use HAL91 to write a website in vi, I guess I love typing...
 
  


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
What if 'kill -9' fails to kill a task? chii-chan Linux - Newbie 15 03-27-2013 03:47 PM
how to use kill to kill a batch of processes with same name? dr_zayus69 Linux - Software 2 09-03-2005 06:35 PM
cannot kill process (kill -9 does not work) mazer13a Linux - General 1 05-27-2005 02:32 PM
The kill command tearinox Linux - Newbie 2 08-15-2003 04:40 PM
kill command... Sonny Linux - Newbie 2 01-28-2002 03:08 AM

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

All times are GMT -5. The time now is 02:49 PM.

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