LinuxQuestions.org
Visit Jeremy's Blog.
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 12-12-2014, 11:32 AM   #1
clstanton
LQ Newbie
 
Registered: May 2008
Posts: 27

Rep: Reputation: 0
Order of PIDs in kill command


The question comes up yesterday and I have Googled unsuccessfully. In what order does the kill command use when executing multiple PIDs?
 
Old 12-12-2014, 02:57 PM   #2
rknichols
Senior Member
 
Registered: Aug 2009
Distribution: Rocky Linux
Posts: 4,779

Rep: Reputation: 2212Reputation: 2212Reputation: 2212Reputation: 2212Reputation: 2212Reputation: 2212Reputation: 2212Reputation: 2212Reputation: 2212Reputation: 2212Reputation: 2212
I've never seen evidence of any order other than the ordering of the arguments on the command line. But note two things:
  • Unless you explicitly execute /bin/kill, you are probably getting your shell's built in kill command, so the result is dependent on your shell.
  • kill just sends a signal to each process. That signal will not be handled until that process is next scheduled for execution, and you have little control over what that sequence might be.
 
1 members found this post helpful.
Old 12-12-2014, 03:49 PM   #3
clstanton
LQ Newbie
 
Registered: May 2008
Posts: 27

Original Poster
Rep: Reputation: 0
Thanks. That makes sense. So entry order really would not have control over the termination.
We were told to kill two processes at one time and we were wondering would the order make a difference as the were related.

Thanks again
 
Old 12-12-2014, 06:37 PM   #4
rknichols
Senior Member
 
Registered: Aug 2009
Distribution: Rocky Linux
Posts: 4,779

Rep: Reputation: 2212Reputation: 2212Reputation: 2212Reputation: 2212Reputation: 2212Reputation: 2212Reputation: 2212Reputation: 2212Reputation: 2212Reputation: 2212Reputation: 2212
It's especially true when you consider what each process might need to do to "terminate". The first process that gets the signal might have multiple I/O buffers to flush, and thus terminate some time after a second process that had less cleanup to do.
 
  


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
top: order pids by memory instead of CPU usage dourk Linux - Newbie 8 10-17-2013 09:23 AM
[SOLVED] How to Kill The Process Without Kill Command ? bala.linuxtech Linux - Server 9 11-30-2012 01:28 PM
How to kill pids for all sessions for a specific user except their current one? jasonws Programming 3 10-22-2010 03:39 PM
how to pidof a runing script (user) in order to kill it? frenchn00b Programming 12 01-07-2009 07:54 PM
killing pids obtained from ps command sanjith11 Programming 9 06-30-2004 12:13 PM

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

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