LinuxQuestions.org
Review your favorite Linux distribution.
Go Back   LinuxQuestions.org > Forums > Linux Forums > Linux - Newbie
User Name
Password
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!

Notices


Reply
  Search this Thread
Old 05-29-2008, 03:28 PM   #1
mokku
Member
 
Registered: Feb 2007
Posts: 197

Rep: Reputation: 30
killing process question


Hi,

I have run rpm command and it just hang, I was about to kill the pid ID, but parent ID is 1. Can I kill the the PID?
 
Old 05-29-2008, 03:29 PM   #2
mokku
Member
 
Registered: Feb 2007
Posts: 197

Original Poster
Rep: Reputation: 30
my question is if the parent id is 1, can we still kill?
 
Old 05-29-2008, 04:07 PM   #3
lleb
Senior Member
 
Registered: Dec 2005
Location: Florida
Distribution: CentOS/Fedora
Posts: 2,630

Rep: Reputation: 495Reputation: 495Reputation: 495Reputation: 495Reputation: 495
not sure i understand what you are asking, but i typically will run ps ax | grep (application name i am looking for) if nothing comes up, then i just run ps ax and scroll up looking for the PID, then i will try first kill -9 PID as that is supposed to kill the program + all other applications/programs that are running along with that PID.
 
Old 05-29-2008, 04:44 PM   #4
dv502
Member
 
Registered: Sep 2006
Location: USA - NYC
Distribution: Whatever icon you see!
Posts: 642

Rep: Reputation: 57
Another command to kill a process is top. First search for the PID, then enter the letter k, You will get a PID to kill prompt. Enter the PID and press enter.

Yet another way is pkill. With pkill you enter the application name.

pkill application name
 
Old 05-29-2008, 05:05 PM   #5
rlhartmann
Member
 
Registered: Mar 2008
Posts: 73

Rep: Reputation: 16
Quote:
Originally Posted by mokku View Post
my question is if the parent id is 1, can we still kill?
Yes, you can kill a process even if it's parent is "1" to kill a process, you must either own it or be the root user (i.e. sudo). There are a number of processes that show up with the name in brackets like:
Quote:
root 2 1 0 May27 ? 00:00:00 [migration/0]
root 3 1 0 May27 ? 00:00:00 [ksoftirqd/0]
root 4 1 0 May27 ? 00:00:00 [migration/1]
root 5 1 0 May27 ? 00:00:00 [ksoftirqd/1]
root 6 1 0 May27 ? 00:00:00 [events/0]
root 7 1 0 May27 ? 00:00:00 [events/1]
root 8 1 0 May27 ? 00:00:00 [khelper]
root 9 1 0 May27 ? 00:00:00 [kthread]
These are actually parts of the kernel and should not be killed.
 
Old 05-29-2008, 05:17 PM   #6
pinniped
Senior Member
 
Registered: May 2008
Location: planet earth
Distribution: Debian
Posts: 1,732

Rep: Reputation: 50
"my question is if the parent id is 1, can we still kill?"

Yes; that initiates a shutdown.
 
Old 05-29-2008, 06:08 PM   #7
syg00
LQ Veteran
 
Registered: Aug 2003
Location: Australia
Distribution: Lots ...
Posts: 15,533

Rep: Reputation: 2041Reputation: 2041Reputation: 2041Reputation: 2041Reputation: 2041Reputation: 2041Reputation: 2041Reputation: 2041Reputation: 2041Reputation: 2041Reputation: 2041
I don't think the OP is asking if [s]he can kill init, but a task owned by init.
 
Old 05-29-2008, 06:34 PM   #8
i92guboj
Gentoo support team
 
Registered: May 2008
Location: Lucena, Córdoba (Spain)
Distribution: Gentoo
Posts: 4,072

Rep: Reputation: 384Reputation: 384Reputation: 384Reputation: 384
You can find that the answer to this question is so simple when you notice that, technically, ALL the processes are sons of init (which pid is always 1).

You can easily check that graphically with pstree.
 
  


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
Killing a process through terminal. urbansaint Linux - Newbie 2 05-20-2008 10:56 PM
Process still running even after killing coolguy_iiit Linux - Newbie 1 07-30-2006 08:30 AM
Killing a process by its name rabeea Linux - Networking 3 03-17-2005 05:30 AM
Killing child process coolfrog Programming 3 09-28-2004 02:58 PM
Really Killing a Process! lazlow69 Linux - Newbie 14 05-10-2003 10:31 PM


All times are GMT -5. The time now is 02:15 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
Facebook: linuxquestions Google+: linuxquestions
Open Source Consulting | Domain Registration