Linux Signals
External
Internal
Overview
Signals are numeric messages sent to running applications by the operating system, other applications, or the user. The signals are sent asynchronously, and allows the kernel to communicate asynchronously with processes. A signal is managed in a cascading manner. It's sent to the application or script, then if the application doesn't have a specific handler, it's pushed back to the shell or operating system. Some signals can't be managed within individual apps: for example SIGKILL is caught by the operating system and immediately kills the running application. For the rest of the signals, processes may or may not intercept the signals.
To send a specific signal to a process:
kill -<signal-value> <pid>
kill -2 3345
Signals
SIGHUP (1)
POSIX signal. Hangup.
Hangup is the signal that is sent to the process when the terminal closes on a foreground process. The default action the process should respond with is "terminate".
Also see:
SIGINT (2)
Sends the process an interrupt. Guaranteed to be present on all systems. The default action a process should respond with is "terminate".
bash sends SIGINT to the process running in foreground when Ctrl-C is pressed.
SIGQUIT (3)
Will trigger a Java virtual machine to generate a thread dump.
SIGILL (4)
The SIGILL signal is sent to a process when it attempts to execute an illegal, malformed, unknown, or privileged instruction.
SIGTRAP (5)
SIGFPE (8)
SIGKILL (9)
POSIX. Kill the process. The signal cannot be caught or ignored. Guaranteed to be present on all systems.
SIGUSR1 (10)
Also see:
SIGSEGV (11)
SIGUSR2 (12)
SIGPIPE (13)
SIGALRM (14)
SIGTERM (15)
Also see:
SIGSTKFLT (16)
SIGCHLD (17)
SIGCONT (18)
POSIX. Continue executing, if stopped. This is the signal send to a stopped application by the fg command.
Also see:
SIGSTOP (19)
POSIX. Stop executing. The signal cannot be caught or ignored.
Also see:
SIGTSTP (20)
Suspends a process executing in foreground. bash sends SIGTSTP to the process running in foreground when Ctrl-Z is pressed.
SIGTTIN (21)
SIGTTOU (22)
SIGURG (23)
SIGXCPU (24)
SIGXFSZ (25)
SIGVTALRM (26)
SIGPROF (27)
SIGWINCH (28)
Also see: