Win a copy of Design for the Mind this week in the Design forum!
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic

Kill Statement

 
Abiodun Adisa
Ranch Hand
Posts: 495
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Pls How does one forcefully stop a process. I used kill 56766 but its still alive
 
Scott Johnson
Ranch Hand
Posts: 518
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Try:


[ August 10, 2006: Message edited by: Scott Johnson ]
 
Syedz -X-
Greenhorn
Posts: 3
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
The -9 (or -KILL) argument to kill(1) should never be used on Unix systems, except as a very last resort. The KILL signal does not allow a process to run any cleanup code, which means blasting away with kill -9 may leave child processes of a parent orphaned, temporary files open, shared memory segments active, and sockets busy. This leaves the system in a messy state, and could lead to unanticipated and hard to debug problems.

#kill pid
this will only suspend the pid, menawhile kill -1 pid will restart the process

for better killing process, use this steps
$ kill pid
$ kill -INT pid
$ kill -HUP pid
$ kill -KILL pid

or if you know the application and want to kill entire pid of that particular application
$killall application_name
[ August 14, 2006: Message edited by: Syedz -X- ]
 
Bear Bibeault
Author and ninkuma
Marshal
Pie
Posts: 64683
86
IntelliJ IDE Java jQuery Mac Mac OS X
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
"Syedz -X-"

There aren't many rules that you need to worry about here on the Ranch, but one that we take very seriously regards the use of proper names. Please take a look at the JavaRanch Naming Policy and adjust your display name to match it.

In particular, your display name must be a first and a last name separated by a space character, and must not be obviously fictitious.

Thanks!
bear
JavaRanch Sheriff
 
Jay Suttiruttana
Ranch Hand
Posts: 36
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Here's an example from kill man page on SunOS 5.9

Example 1: Sending the kill signal

Any of the commands:

example% kill -9 100 -165
example% kill -s kill 100 -165
example% kill -s KILL 100 -165

sends the SIGKILL signal to the process whose process ID is
100 and to all processes whose process group ID is 165,
assuming the sending process has permission to send that
signal to the specified processes, and that they exist.


OPTIONS

-s signal_name
Specifies the signal to send, using one of the sym-
bolic names defined in the <signal.h>

You should check out this web site for more info about kill using option "-9" http://www.speculation.org/garrick/kill-9.html
[ August 31, 2006: Message edited by: Jay Suttiruttana ]
 
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic