Signals

A signal is a software interrupt to notify processes that an external event has occurred. In a normal execution, processes keeps running as expected. Now, for some reason, a user may want to cancel a running process. When the process is started from a terminal, it will terminate when we hit the Ctrl + c keys or run the kill command.

When we press Ctrl + c keys while process is running in a terminal, a signal SIGINT is generated and sent to the process running in foreground. Also, when the kill command is called on process, the SIGKILL signal is generated and the process is terminated.

Available signals

Among all available signals, we will discuss the frequently used signals here:

Signal name

Value

Default Action

Description

SIGHUP

Get Linux Shell Scripting Essentials now with the O’Reilly learning platform.

O’Reilly members experience books, live events, courses curated by job role, and more from O’Reilly and nearly 200 top publishers.