The UNIX and Linux Forums  

Go Back   The UNIX and Linux Forums > Top Forums > UNIX for Dummies Questions & Answers
Google UNIX.COM


UNIX for Dummies Questions & Answers If you're not sure where to post a UNIX or Linux question, post it here. All UNIX and Linux newbies welcome !!

More UNIX and Linux Forum Topics You Might Find Helpful
Thread Thread Starter Forum Replies Last Post
killing the process arthi UNIX for Dummies Questions & Answers 3 06-03-2008 05:57 AM
Killing of a process and send a mail if the process doesnot come up within 2 minutes Prince89 Shell Programming and Scripting 1 02-15-2008 03:10 PM
Reg process of killing shanshine SUN Solaris 6 12-05-2007 10:50 AM
Killing specific process benefactr Shell Programming and Scripting 6 10-25-2007 09:23 AM
killing a process pid jo calamine UNIX for Advanced & Expert Users 16 12-04-2006 03:43 AM

Reply
 
Submit Tools LinkBack Thread Tools Display Modes
  #1 (permalink)  
Old 06-01-2007
Registered User
 

Join Date: Jun 2007
Posts: 3
Stumble this Post!
killing a process

I can kill running processes on my linux red hat system using ctrl-c but cannot do it from command line of another terminal using kill -2 pid. Although I can kill them from command line using kill -9 pid and other signals. I would like to do it using the kill -2 pid.
Thanks for your suggestions
Reply With Quote
Forum Sponsor
  #2 (permalink)  
Old 06-01-2007
...@...
 

Join Date: Feb 2004
Location: NM
Posts: 3,812
Stumble this Post!
Does
Code:
kill -SIGINT <pid>
work? I am assuming that SIGINT may not be == 2 on your box.

my bad kill -int <pid> is the correct command, which you say does not work

Last edited by jim mcnamara; 06-02-2007 at 08:57 AM.
Reply With Quote
  #3 (permalink)  
Old 06-01-2007
Registered User
 

Join Date: Jun 2007
Posts: 3
Stumble this Post!
kill -SIGINT pid does not work, I get error saying "SIGINT unknown signal". then I typed kill -l to see list of options. Among several options were INT and TERM.
kill -TERM PID killed the process and so did kill -9 pid. But kill -2 pid and kill -INT pid fail. kill -HUP pid also works.
It maybe that all the kill options are not active on my system? Thanks for your response.
Reply With Quote
  #4 (permalink)  
Old 06-01-2007
Registered User
 

Join Date: Jan 2007
Posts: 2,965
Stumble this Post!
With the cmd line kill tool the symbols are INT, TERM, HUp, QUIT etc, as in the SIGxxx without the SIGxxx.

Any process can choose to ignore signals if it so wants (apart from 9).

You still need permission to send a signal, trying with signal zero will tell you if you have those permissions.
Reply With Quote
  #5 (permalink)  
Old 06-01-2007
Technorati Master
 

Join Date: Mar 2005
Location: Large scale systems...
Posts: 2,547
Stumble this Post!
Quote:
You still need permission to send a signal, trying with signal zero will tell you if you have those permissions.
This is not true.

Sending signal 0 to process will indicate only ' whether a process is alive or not and not about the permissions the users has with respect to the process '.

When a normal user sends signal to a process which is running as process owned by ' root ' ALIVE status ( indicating that the process is running ) would be returned.
Reply With Quote
  #6 (permalink)  
Old 06-01-2007
Registered User
 

Join Date: Jan 2007
Posts: 2,965
Stumble this Post!
Quote:
Originally Posted by matrixmadhan
Sending signal 0 to process will indicate only ' whether a process is alive or not and not about the permissions the users has with respect to the process '.
Solaris 10 does the following:

Code:
bash-3.00$ kill -0 515
bash: kill: (515) - Not owner
Looks like a permissions thing to me.
Reply With Quote
  #7 (permalink)  
Old 06-02-2007
reborg's Avatar
Administrator
 
Join Date: Mar 2005
Location: Ireland
Posts: 3,513
Stumble this Post!
In the case where either the process does not exists, or the user does not have the required permissions kill will exit > 0 . There is nothing to require any more information than this in POSIX. In general however the reason will be output to stderr.
Reply With Quote
Google The UNIX and Linux Forums
Reply

Tags
linux

Thread Tools
Display Modes




All times are GMT -7. The time now is 12:38 AM.


Powered by: vBulletin, Copyright ©2000 - 2006, Jelsoft Enterprises Limited.
The UNIX and Linux Forums Content Copyright ©1993-2008 The CEP Blog All Rights Reserved -Ad Management by RedTyger Visit The Global Fact Book

Content Relevant URLs by vBSEO 3.2.0