Safari Books Online is a digital library providing on-demand subscription access to thousands of learning resources.
When a controlling process loses its terminal connection, the kernel sends it a SIGHUP signal to inform it of this fact. (A SIGCONT signal is also sent, to ensure that the process is restarted in case it had been previously stopped by a signal.) Typically, this may occur in two circumstances:
When a “disconnect” is detected by the terminal driver, indicating a loss of signal on a modem or terminal line.
When a terminal window is closed on a workstation. This occurs because the last open file descriptor for the master side of the pseudoterminal associated with the terminal window is closed.