1 |
Frank Peters posted on Sat, 29 Aug 2009 10:52:47 -0400 as excerpted: |
2 |
|
3 |
> The names of all running processes are shown at the right. Once you |
4 |
> have found the process in question (firefox or evolution), make a note |
5 |
> of the number at the left. This is the process id, or PID. Then issue |
6 |
> the command: |
7 |
> |
8 |
> kill -s 9 PID |
9 |
> |
10 |
> This will terminate those processes. |
11 |
> |
12 |
> Sometimes, a process can be associated with several PID's. Make sure to |
13 |
> kill, using the above command, all of the PID's that are involved. |
14 |
|
15 |
Note that there's also the killall command, which according to the |
16 |
manpage, kills "processes by name". Of course, it'll kill /all/ the |
17 |
processes by that name, so may not be what you want if you have multiple |
18 |
separate firefox processes running at the same time, for instance, but |
19 |
it's very useful, none-the-less, since where it /can/ be used, it saves |
20 |
the step of looking up the pid. |
21 |
|
22 |
Also, with both kill and killall, the "s " shouldn't be needed. kill -9 |
23 |
PID or killall -9 name should work, tho both will also take the -s form, |
24 |
too. FWIW, they'll also take the named signal. -15/-TERM is the default |
25 |
if no signal is specified. That tries to kill an application gracefully, |
26 |
giving it time to save its work or whatever. As such, it may or may not |
27 |
work. -9/-KILL is the "kill and I really mean it" signal, NOT allowing |
28 |
the application a graceful exit, simply directing the kernel to kill it |
29 |
outright. |
30 |
|
31 |
There are, however, instances where even -KILL/-9 won't get rid of the |
32 |
process. Zombies are one (for them, killing the parent process works, |
33 |
where possible). "Uninterruptable sleep" is another, normally shown with |
34 |
a "D" in ps, top, and similar status outputs. "Uninterruptable sleep" is |
35 |
triggered for some types of I/O (input/output, reading/writing to the |
36 |
disk, for instance). Where this can become a problem is for example when |
37 |
you yanked the USB stick without unmounting (aka safely removing) it, and |
38 |
the application doesn't know it's gone -- it can get stuck in |
39 |
uninterruptable sleep in such a case, and rebooting is about the only fix |
40 |
for that. Another example would be the problems people had with certain |
41 |
external drives awhile back, where the drive was set for aggressive power- |
42 |
saving, but didn't conform to standards (the drivers solved it for MS |
43 |
users), so the kernel didn't know the drive had gone to sleep and |
44 |
couldn't properly wake it up. The app would therefore try to write |
45 |
something to it, and would hang indefinitely as a result. As mentioned, |
46 |
rebooting can be the only way to get rid of processes hung in |
47 |
"uninterruptable sleep" mode. |
48 |
|
49 |
The above is for Linux. The BSDs, Solaris, etc, may be slightly |
50 |
different. |
51 |
|
52 |
-- |
53 |
Duncan - List replies preferred. No HTML msgs. |
54 |
"Every nonfree program has a lord, a master -- |
55 |
and if you use the program, he is your master." Richard Stallman |