nohup
A command that runs another command immune to the hangup signal, so it keeps running after you log out.
In more detail
If output would go to the terminal, nohup redirects it to a file called nohup.out. It is a quick fix, not a supervisor: nothing restarts the process if it crashes. For work that must survive reboots and failures, use a service manager such as systemd.
Example
pid=42 parent=1 stdout=log detached=yes describes a detached process whose output goes to a log.Related terms
- SIGHUP — The hangup signal, sent to programs when the terminal they were started from closes.
- background job — A command started with & at the end of the line, which runs while the shell immediately gives you the prompt back.
- process supervisor — A program that starts processes, watches them and restarts them if they exit, such as systemd or a container platform.
- standard output and standard error — The two channels a program writes normal output (stdout) and error messages (stderr) to, plus stdin for input.
Taught in
- Job Control, And Processes That Outlive You — Linux Fundamentals & Systems Administration
- The Reindex That Died With The VPN: Jobs, cron, at And Timers — CompTIA Linux+ (XK0-006) Exam Prep
- Down Until Morning: Unit Files, Drop-ins, Masks And systemd's Helpers — CompTIA Linux+ (XK0-006) Exam Prep