Linux signals

· 133 words · 1 minute read

Signals are software interrupts to processes (in POSIX-compliant systems).

SIGSTOP (19) stops the process, halts all execution but does not kill it. It cannot be trapped/ignored. SIGCONT (18) continues a process stopped with SIGSTOP. SIGINT (2) sends an interrupt to the process, which decides what to do with it. It can be trapped/ignored. Usually sent with ctrl+C. SIGTERM (15) sends an irq to kill the process. This is a graceful way to kill it and lets it do what it needs before shutting down (eg saving data). SIGKILL (9) ungracefully kills the process. It cannot be trapped/ignored.

The signals can be sent by eg

kill -15 2342

15 being the signal number, 2342 being the process ID (PID, from running a ps command).

I found this link to be very informative and educating.