LinuxQuestions.org
Welcome to the most active Linux Forum on the web.
Home Forums Tutorials Articles Register
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 03-10-2011, 08:37 AM   #1
MODYSAMA
Member
 
Registered: Dec 2010
Posts: 144

Rep: Reputation: 0
Question kill Process inquires --need help


Hello,
I have many question. It'd be great to get reply.
OS: Kubuntu 10.10
Code:
sok@sok-HP-ProBook-4520s:~$ pidof motion
24986
sok@sok-HP-ProBook-4520s:~$ pidof 24986
sok@sok-HP-ProBook-4520s:~$ sudo su
root@sok-HP-ProBook-4520s:/home/sok# kill 24986
root@sok-HP-ProBook-4520s:/home/sok# pidof /bin/sh /home/sok/Scripts/check.sh
24982 7386 3749 3590 1439
root@sok-HP-ProBook-4520s:/home/sok# kill 24982
root@sok-HP-ProBook-4520s:/home/sok#
Q1: Why pidof /bin/sh /home/sok/Scripts/check.sh
return several ids and the first one only is one, which is used to kill the process.
Q2: What is that several ids stand for?
Q3: Why being not root can't always kill a specified process?
.
Thanks in advance.

Last edited by MODYSAMA; 03-10-2011 at 09:52 AM. Reason: need reply
 
Old 03-10-2011, 09:09 AM   #2
siranjeevi
Member
 
Registered: May 2010
Location: India
Posts: 79

Rep: Reputation: 7
Hi,

Here are your answers,

Q1, and Q2 -- I think that the first one is Parent process[PPID] and the remaining is your child processes, a single process will divide into multiple small processes. But I am not sure, may be someone will come up with answers for you.

Q3 -- You need to be a root user to kill many processes because those process may be running with a different user permission, say if another user "sam" is using a process, he is the owner of the process and you cannot kill his process. Only a root user can do that.
 
1 members found this post helpful.
Old 03-10-2011, 09:48 AM   #3
MODYSAMA
Member
 
Registered: Dec 2010
Posts: 144

Original Poster
Rep: Reputation: 0
Thank you.
Quote:
Originally Posted by siranjeevi View Post
Q3 -- You need to be a root user to kill many processes because those process may be running with a different user permission, say if another user "sam" is using a process, he is the owner of the process and you cannot kill his process. Only a root user can do that.
Even there is only one user?

---------- Post added 03-10-11 at 10:48 AM ----------

Q4: Why the system of one user doesn't be consider that user as root?

Last edited by MODYSAMA; 03-10-2011 at 09:50 AM.
 
Old 03-10-2011, 10:52 AM   #4
siranjeevi
Member
 
Registered: May 2010
Location: India
Posts: 79

Rep: Reputation: 7
Hi,

BY default linux creates some users while you install OS. Some of those user processes cannot be killed by a normal users, the following are some default users which i pasted from "/etc/passwd" file.

Quote:
root:x:0:0:root:/root:/bin/bash
daemon:x:1:1:daemon:/usr/sbin:/bin/sh
bin:x:2:2:bin:/bin:/bin/sh
sys:x:3:3:sys:/dev:/bin/sh
sync:x:4:65534:sync:/bin:/bin/sync
games:x:5:60:games:/usr/games:/bin/sh
man:x:6:12:man:/var/cache/man:/bin/sh
lp:x:7:7:lp:/var/spool/lpd:/bin/sh
mail:x:8:8:mail:/var/mail:/bin/sh
news:x:9:9:news:/var/spool/news:/bin/sh
uucp:x:10:10:uucp:/var/spool/uucp:/bin/sh
proxy:x:13:13roxy:/bin:/bin/sh
 
1 members found this post helpful.
Old 03-10-2011, 12:22 PM   #5
MODYSAMA
Member
 
Registered: Dec 2010
Posts: 144

Original Poster
Rep: Reputation: 0
Arrow

siranjeevi,
Thank you a lot for being helpful.

Quote:
Originally Posted by MODYSAMA View Post
OS: Kubuntu 10.10
Code:
sok@sok-HP-ProBook-4520s:~$ pidof motion
24986
sok@sok-HP-ProBook-4520s:~$ pidof 24986
sok@sok-HP-ProBook-4520s:~$ sudo su
root@sok-HP-ProBook-4520s:/home/sok# kill 24986
root@sok-HP-ProBook-4520s:/home/sok# pidof /bin/sh /home/sok/Scripts/check.sh
24982 7386 3749 3590 1439
root@sok-HP-ProBook-4520s:/home/sok# kill 24982
root@sok-HP-ProBook-4520s:/home/sok#
Q1: Why pidof /bin/sh /home/sok/Scripts/check.sh
return several ids and the first one only is one, which is used to kill the process.
Q2: What is that several ids stand for?
.
Any suggestion, please??

Last edited by MODYSAMA; 03-10-2011 at 12:23 PM.
 
Old 03-10-2011, 02:52 PM   #6
MODYSAMA
Member
 
Registered: Dec 2010
Posts: 144

Original Poster
Rep: Reputation: 0
Please, need reply.
 
Old 03-10-2011, 04:32 PM   #7
siranjeevi
Member
 
Registered: May 2010
Location: India
Posts: 79

Rep: Reputation: 7
Looks like no one is replied, okay I will try to resolve you.

Can you paste the output of
Quote:
ps -el |grep firstpidofprocess
?
 
1 members found this post helpful.
Old 03-11-2011, 06:00 AM   #8
MODYSAMA
Member
 
Registered: Dec 2010
Posts: 144

Original Poster
Rep: Reputation: 0
Thank you.
If you mean that
Code:
sok@sok-HP-ProBook-4520s:~$ ps -el | grep firstpidofprocess
sok@sok-HP-ProBook-4520s:~$
Code:
root@sok-HP-ProBook-4520s:/home/sok# ps -el | grep firstpidofprocess
root@sok-HP-ProBook-4520s:/home/sok#
It list nothing.
!
sorry for my bad.
 
Old 03-11-2011, 06:09 AM   #9
siranjeevi
Member
 
Registered: May 2010
Location: India
Posts: 79

Rep: Reputation: 7
Sorry the "firstpidofprocess" in the sense the pid number (i.e) in your previous o/p "24986"

So the command should be

Quote:
ps -el |grep 24986
 
1 members found this post helpful.
Old 03-11-2011, 07:16 AM   #10
MODYSAMA
Member
 
Registered: Dec 2010
Posts: 144

Original Poster
Rep: Reputation: 0
Here it is,
Code:
sok@sok-HP-ProBook-4520s:~$ pidof motion
1205
sok@sok-HP-ProBook-4520s:~$ sudo su
[sudo] password for sok: 
root@sok-HP-ProBook-4520s:/home/sok# ps -el | grep 1205
0 S  1000  1205  7985  1  80   0 - 12088 hrtime ?        00:00:01 motion
root@sok-HP-ProBook-4520s:/home/sok#
 
Old 03-11-2011, 10:34 PM   #11
siranjeevi
Member
 
Registered: May 2010
Location: India
Posts: 79

Rep: Reputation: 7
Hello,

Please post the o/p of

Quote:
root@sok-HP-ProBook-4520s:/home/sok# pidof /bin/sh /home/sok/Scripts/check.sh
along with this, so your next post should be o/ps of,

Quote:
sok@sok-HP-ProBook-4520s:~$ pidof motion
o/p
sok@sok-HP-ProBook-4520s:~$ sudo su
[sudo] password for sok:
root@sok-HP-ProBook-4520s:/home/sok# ps -el | grep 1205
o/p
root@sok-HP-ProBook-4520s:/home/sok#
root@sok-HP-ProBook-4520s:/home/sok# pidof /bin/sh /home/sok/Scripts/check.sh
o/p
 
Old 03-12-2011, 07:48 AM   #12
MODYSAMA
Member
 
Registered: Dec 2010
Posts: 144

Original Poster
Rep: Reputation: 0
Code:
sok@sok-HP-ProBook-4520s:~$ sudo su
[sudo] password for sok: 
root@sok-HP-ProBook-4520s:/home/sok# pidof motion
32536 1948
root@sok-HP-ProBook-4520s:/home/sok# ps -el | grep 32536
0 S  1000 32536 32294  0  80   0 - 11430 hrtime ?        00:00:01 motion
root@sok-HP-ProBook-4520s:/home/sok# pidof  /bin/sh /home/sok/Scripts/check.sh
32532 32188
root@sok-HP-ProBook-4520s:/home/sok# ps -el | grep 32532
0 S  1000 32532 32294  6  80   0 -   474 pipe_w ?        00:01:15 sh
 
Old 03-12-2011, 07:52 AM   #13
siranjeevi
Member
 
Registered: May 2010
Location: India
Posts: 79

Rep: Reputation: 7
Hi,

It seems that the other pids doesn't come with same parent process ids, so they don't belong to same process. Not sure why multiple processes are being created for single process. Sorry.!..
 
Old 03-12-2011, 11:14 AM   #14
MODYSAMA
Member
 
Registered: Dec 2010
Posts: 144

Original Poster
Rep: Reputation: 0
siranjeevi,
It'S okey.Many Thanks for you.
 
  


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



Similar Threads
Thread Thread Starter Forum Replies Last Post
how to kill or clean a Uninterruptible slept session leader process from process tabl golden_boy615 Linux - General 1 12-14-2010 10:47 AM
bash `kill`: process 'B' silently dies; but process 'A' = `kill` spews back debris! GrapefruiTgirl Programming 9 06-23-2009 09:42 AM
How to get the PID of the process giving kill signal to a process? hariprd Programming 2 11-27-2008 03:10 AM
Shell Script : Kill a running process when another process starts ashmew2 Linux - General 3 08-20-2008 03:47 AM
cannot kill process (kill -9 does not work) mazer13a Linux - General 1 05-27-2005 02:32 PM

LinuxQuestions.org > Forums > Linux Forums > Linux - Newbie

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