SIG=SIGNAL – a signal is the means Linux uses for sending information between processes or between the kernel and a process.
This is most important (to me) :
0 SIGNULL Null Check access to pid
1 SIGHUP Hangup Terminate; can be trapped
2 SIGINT Interrupt Terminate; can be trapped
3 SIGQUIT Quit Terminate with core dump; can be trapped
9 SIGKILL Kill Forced termination; cannot be trapped (forced terminate)
15 SIGTERM Terminate Terminate; can be trapped (not forced terminate)
24 SIGSTOP Stop Pause the process; cannot be trapped
25 SIGTSTP Terminal stop Pause the process; can be trapped
26 SIGCONT Continue Run a stopped process
I use “-9” a lot 😉
If as a process PID you put “0” (no quotation marks) all processes on server will be killed, except some special system ones.
If you use “-3”, it leaves a data “dump” in the log of the killed process, or it creates a file with name “core” which will have in it a memory image of the process when it received a kill signal.
How to see supported signals on the system :
General syntax :
#kill -SIGNAL PID
What is “trap” for : Trap will allow us to trap some or all of these signals, and perform operations on the trapped signal (There might be situations when you don’t want users of your scripts to exit untimely using keyboard abort sequences, for example because input has to be provided or cleanup has to be done. The trap statement catches these sequences and can be programmed to execute a list of commands upon catching those signals).