On 21/03/10 13:47, Anders Johansson wrote:
On Sun, 2010-03-21 at 13:18 +0200, arygroup@gmail.com wrote:
I didn't read the kill manual, but I have a doubt. Is killing a program the same, as I close it in a legal way?
Depends on the program.
"kill" is really one of the worst named programs anywhere. It should have been called something like "signal", because that is what it does - it sends a signal to a given process. The signal INT (2) is the one sent by a shell when you press ctrl-c for example.
Most signals can be "caught" by an application, and many programs will catch the INT signal and do a controlled exit. Usually the same happens with the TERM signal, which is the default one sent by the kill command if you don't specify something else.
The HUP signal is used by some applications to trigger a re-read of the configuration without having to restart. Postfix for example uses this
Some signals can't be caught, for example SIGKILL (9). If that is sent to a process, it will exit immediately and no further instructions from it will be executed (with one exception, if the process is currently inside a kernel syscall it usually can't be interrupted, so the process will exit as soon as the syscall finishes). This should normally not be used except in extreme circumstances
How a particular program behaves when a signal is sent to it should be described in the documentation.
For modern kde and gnome applications, the intended method of sending commands to programs from scripts is with dbus.
Anders
Thanks for the explanation! So there is no way to make what I want in a legal way if I'm not sure how all the programs in my list handle the signals, right? -- To unsubscribe, e-mail: opensuse+unsubscribe@opensuse.org For additional commands, e-mail: opensuse+help@opensuse.org