Visit Jeremy's Blog.
Go Back > Forums > Linux Forums > Linux - Newbie
User Name
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!


  Search this Thread
Old 05-29-2008, 04:28 PM   #1
Registered: Feb 2007
Posts: 197

Rep: Reputation: 30
killing process question


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, 04:29 PM   #2
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, 05:07 PM   #3
Senior Member
Registered: Dec 2005
Location: Florida
Distribution: CentOS/Fedora/Pop!_OS
Posts: 2,855

Rep: Reputation: 545Reputation: 545Reputation: 545Reputation: 545Reputation: 545Reputation: 545
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, 05:44 PM   #4
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, 06:05 PM   #5
Registered: Mar 2008
Posts: 73

Rep: Reputation: 16
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:
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, 06:17 PM   #6
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, 07:08 PM   #7
LQ Veteran
Registered: Aug 2003
Location: Australia
Distribution: Lots ...
Posts: 19,248

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

Rep: Reputation: 404Reputation: 404Reputation: 404Reputation: 404Reputation: 404
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.


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

All times are GMT -5. The time now is 01:06 AM.

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