3

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?

5
  • should go on superuser.
    – Claudiu
    May 18, 2011 at 15:37
  • superuser.com/questions/107543/…
    – Chris Nava
    May 18, 2011 at 16:48
  • Never trust "friend from school" recommendations, kill -9 process_id is quite a poor practice.
    – jlliagre
    May 18, 2011 at 20:19
  • @jlliagre so what would you suggest as the correct practice? Jul 16, 2011 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, 2011 at 14:20

1 Answer 1

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

You must log in to answer this question.