Signals
Cheat sheet · https://pcornel.dk/topic.php?topic=2696
Answer
Signals are notifications the kernel sends to processes: SIGINT (2, Ctrl+C), SIGTERM (15, polite stop), SIGKILL (9, cannot be caught), SIGHUP (1, hangup/reload), SIGSTOP/SIGTSTP (pause) and SIGCONT. kill sends them.
Remember
Send SIGTERM first and give the process time to clean up; use SIGKILL only if it hangs. A process stuck in D state (uninterruptible I/O) ignores even SIGKILL until the I/O finishes. Scripts can catch signals with trap.
First checks
kill -l— list signal names and numbersps -o pid,stat,cmd -p <pid>— process statebash -x script.sh— trace each expanded commandbash -n script.sh— syntax check onlyshellcheck script.sh— common bugs and quoting problemsecho $?— exit code of the last command
Commands
systemctl kill -s USR1 <unit>
Verify in this order
signal sent (kill, keyboard, kernel) → delivered → process handler runs or default action (terminate, stop, ignore)
Where it usually breaks
First mismatch in persistent intent → provider/parser/generator → kernel/userspace runtime → dependency/security context → logs/counters → consumer-visible read-back; preserve identity/native diagnostic/pre-state before mutation.
Read-only verification commands unless stated otherwise. Confirm syntax for your platform and release. Full reference: https://pcornel.dk/topic.php?topic=2696