Glossary

SIGHUP

Also known as: signal 1

SIGHUP (signal 1) originally meant "the controlling terminal has hung up", a carryover from the days when terminals were actual modems, and losing carrier would notify the shell and its children. When a login shell receives SIGHUP, it forwards it to its child jobs, which is why closing a terminal usually kills everything running in it.

Modern daemons repurpose SIGHUP as a "reload your configuration without restarting" signal. Sending kill -HUP nginx causes nginx to re-read its config, reopen log files, and start new worker processes without dropping existing connections. This is now the near-universal convention, which is ironic since the original hangup meaning has mostly faded.

kill -HUP $(pidof nginx)
systemctl reload nginx           # preferred; systemd knows the signal
nohup long-running-command &     # resist SIGHUP when terminal closes

The command nohup arranges for its child to ignore SIGHUP, so long-running jobs survive terminal disconnection. Modern alternatives include running work inside tmux or screen, which do not just ignore SIGHUP but keep the terminal session alive across disconnects.

Related terms: Signal, SIGTERM

Discussed in:

Also defined in: Textbook of Linux

Textbook of Linux — Learn Linux on iPhone — Download on the App Store