I stopped using the Unix process ctr + z. Then I tried to kill the process and did not work. A friend from school was recommended to use the kill -9 process_id. What is the magic combination?
Asked
Active
Viewed 76 times
3
-
should go on superuser. – Claudiu May 18 '11 at 15:37
-
http://superuser.com/questions/107543/bash-man-page-kill-pid-vs-kill-9-pid – Chris Nava May 18 '11 at 16:48
-
Never trust "friend from school" recommendations, `kill -9 process_id` is quite a poor practice. – jlliagre May 18 '11 at 20:19
-
@jlliagre so what would you suggest as the correct practice? – slotishtype Jul 16 '11 at 11:56
-
"-9" or more precisely SIGKILL is a last resort signal, not something to routinely use. The correct practice for a suspended process is to first resume it as already answered. Should you want to kill it then, start by sending the "-15" signal (a.k.a SIGTERM) which give a chance for the process to exit gracefully. – jlliagre Jul 16 '11 at 14:20
1 Answers
8
Just follow normal kill by a resume (SIGCONT or in shell, fg the job).
The signal will only be received after the process is resumed (it cannot receive the signal because... you suspended it :))
So,
kill -CONT $pid
to resume it if you no longer have access to the terminal or shell controlling the job
sehe
- 1,925
- 13
- 13