Skip to content
koalaman edited this page Nov 1, 2015 · 1 revision

SIGKILL/SIGSTOP can not be trapped.

Problematic code:

trap 'echo "unkillable"' KILL

Correct code:

Not applicable. This is not possible.

Rationale:

SIGKILL and SIGSTOP can not be caught/ignored (according to POSIX and as implemented on platforms including Linux and FreeBSD). Trying to trap this signal has undefined results.

Exceptions:

None. If you come across one, please file an issue about it.

ShellCheck

Each individual ShellCheck warning has its own wiki page like SC1000. Use GitHub Wiki's "Pages" feature above to find a specific one, or see Checks.

Clone this wiki locally