[Date Prev][Date Next] [Thread Prev][Thread Next] [Date Index] [Thread Index]

Re: Ctrl-C and normal kill doesn't work.



Nope.
You will have to understand the "signals" mechanism underlying all that.
kill is just a program that sends a signal to a running process. Really, it doesn't
"kill" anything, it just sends a signal.

There are a bunch of signals defined on your system, that you can list with a 'kill
-l' .
When typing Ctrl-C, you're really sending a SIGQUIT to the running process. Same when
issuing 'kill' without argument.

The whole point is, the process must have implemented something to answer to the
signal you sent to it!
There are default behaviour, though: one of them is "ignore", the second is "quit
now" (roughly equivalent to "crash-bomb yourself").

Usually if not always, it is not possible to ignore SIGKILL (kill -9) and SIGTERM
(kill -15). Which is why it will kill the processes.
If a process is really stuck into a locked state, it won't even be able to trap
another signal, and thus not end, even if it has been told (by the programmer!) to do
something like quitting upon receiving a QUIT signal. This should explain your case.

BTW, there is one case where even kill -9 or kill -15 won't terminate a process: when
it is stuck in kernel-land and not in userland anymore (stuck in a system call that
doesn't return). Unfortunately, this is a case when you should restart your kernel if
you're not able to debug it (yeah, means "reboot").

HTH

John Pearson wrote:

>
> > When having a running process, ctrl-c or kill doesn't work on my system.
> > You have to use kill -9.
> >
> >
>
> It may be an stty problem; if you type
> stty -a
>

--
Thierry Michalowski                                     /
Edipresse Publications S.A                 \\\' ,      / //
Informatique de Production                  \\\//    _/ //'
33,av. de la gare                            \_-//' /  //'
1001 LAUSANNE SUISSE                           \ ///  //'
phone: +41 21 349 46 26                        /  >>   \\\`
mailto:Thierry.Michalowski@edipresse.ch       /,)-^>>  _\`
                                              (/   \\ / \\\
"Unix is user-friendly...                           //  //\\\
It is just selective about who its friends are"    ((`
============================================================================
This message has been checked with GRIMEsweeper which has detected a virus
embedded in this plain text message. You should now delete your entire hard
drive and rinse your eyes with soapy water to ensure it doesn't spread.



Reply to: