nohup(1) nohup(1)NAME nohup - runs a command so that it can continue to run even after your session has ended SYNOPSIS nohup command-line & ARGUMENTS command-line Specifies a command line. & Specifies background mode. DESCRIPTION nohup executes command-line in such a way that it does not terminate when an end-of-transmission (EOT, CONTROL-D) signal is received from the controlling terminal. The end- of-transmission signal is also known as a hangup signal. With nohup, the priority is automatically incremented by 5. The nohup program should be used with processes running in the background (with &) in order to prevent them from responding to interrupts or stealing the input from the next person who logs in on the same terminal. In csh, processes run in the background are automatically immune to hangup signals. If output is not redirected by the user, both the standard output and standard error output are sent to a file named nohup.out. If nohup.out is not writable in the current directory, output is redirected to $HOME/nohup.out. EXAMPLES The command: nohup nroff -mm docsfile | lp & runs the nroff command shown, immune to hangups, quits, and interrupts. To apply nohup to pipelines or lists of commands, you need to create a shell script so that multiple commands can be run through a single filename reference. For example, when you enter nohup sh batchfile & the processing affected by nohup includes all of the commands inside of batchfile. To permit the running of this script more simply as nohup file & January 1992 1
nohup(1) nohup(1)you need to establish execute permission for batchfile by using chmod (see chmod(1)). For more information about background processing and scripts, see csh(1), ksh(1), and sh(1). WARNINGS Do not expect the reach of nohup to extend to commands after the first in a series, such as nohup command1; command2 Each of the following command lines is one possible remedy for this kind of problem: nohup (command1; command2) nohup command1; nohup command2 If you are not careful when you redirect the standard error output, you can create unexpected problems. Any error messages produced by the following command are sent to the same disk used for the archive, possibly corrupting the archive: nohup cpio -o < list > /dev/dsk/c8d0s0 2>&1 & To avoid possible corruption of the archive, redirect the error output to some other place, such as a file named errors: nohup cpio -o < list > /dev/dsk/c8d0s0 2>errors & FILES ./nohup.out Default file where standard output and standard error output are sent /bin/nohup Executable file SEE ALSO chmod(1), csh(1), ksh(1), nice(1), sh(1) nice(2), signal(3) in A/UX Programmer's Reference 2 January 1992