With the decline of access via serial line, the meaning of SIGHUP has changed somewhat on modern systems, often meaning a controlling
pseudo or virtual terminal has been closed. If a command is executed inside a terminal window and the terminal window is closed while the command process is still running, it receives SIGHUP. If the process receiving SIGHUP is a
Unix shell, then as part of
job control it will often intercept the signal and ensure that all stopped processes are continued before sending the signal to child processes (more precisely,
process groups, represented internally by the shell as a "job"), which by default terminates them. This can be circumvented in two ways. Firstly, the
Single UNIX Specification describes a shell utility called
nohup, which can be used as a wrapper to start a program and make it ignore SIGHUP by default. Secondly, child process groups can be "disowned" by invoking
disown with the
job id, which removes the process group from the shell's job table (so they will not be sent SIGHUP), or (optionally) keeps them in the job table but prevents them from receiving SIGHUP on shell termination. Different shells also have other methods of controlling and managing SIGHUP, such as the
disown facility of
ksh. Most modern
Linux distributions documentation specify using
kill -HUP to send the SIGHUP signal.
Daemon programs sometimes use SIGHUP as a signal to restart themselves, the most common reason for this being to re-read a configuration file that has been changed. ==Details==