Code-Memo

Signals and process control

What are signals?

Signals are async notifications sent to processes (e.g., terminate, reload, stop).

Common signals

Sending signals

kill -TERM 1234
kill -KILL 1234
kill -HUP 1234

By name:

pkill -TERM nginx
killall -HUP nginx

Inspect signals / process state

ps -o pid,stat,cmd -p 1234
cat /proc/1234/status | grep -E 'State|Sig'

systemd and signals

Systemd usually sends SIGTERM then waits TimeoutStopSec and escalates.