The signal in Linux or other UNIX like operating systems is a notification or message sent to a process to notify it that some event has occurred. Most of the commands executed by a user are run by his/her shell. The parent process of these commands or scripts is his shell, whose process ID can be checked with $$.
The SIGHUP signal is the hangup signal which is sent to a process when its controlling terminal or the controlling process is dead. The nohup command is the command that runs a process ignoring SIGHUP signal.
The syntax of the nohup command is:
nohup COMMAND [ARG]...
As the controlling terminal is closed, so there are some issues that need to be considered. First of all, the process continues to run even if the controlling terminal is closed. The second issue is the output of the command. By default the output of a command is displayed on the standard output device which is the terminal that initiated the process. But as the terminal may be closed during the life of the child process, so terminal cannot be the output device anymore. According to the info page of nohup command,
If standard output is a terminal, the command's standard output is appended to the file `nohup.out'; if that cannot be written to, it is appended to the file `$HOME/nohup.out'; and if that cannot be written to, the command is not run. Any `nohup.out' or `$HOME/nohup.out' file created by `nohup' is made readable and writable only to the user, regardless of the current umask settings.
Similarly for standard error,
If standard error is a terminal, it is normally redirected to the same file descriptor as the (possibly-redirected) standard output. However, if standard output is closed, standard error terminal output is instead appended to the file `nohup.out' or `$HOME/nohup.out' as above.
It means that by default both standard output and standard error are redirected to 'nohup.out' file. But if you wish to redirect the output to some other file, you can always do so by using redirect operator. For example, to catch the output of make,
nohup make > make.log
For standard input,
If standard input is a terminal, it is redirected from `/dev/null' so that terminal sessions do not mistakenly consider the terminal to be used by the command. This is a GNU extension; programs intended to be portable to non-GNU hosts should use `nohup COMMAND [ARG]...
The nohup command does not automatically put the command in background. This must be done explicitly with &.
nohup make > make.log &
Also, this command does not change the niceness (i.e. the priority) of a command. For this, nice is used. e.g. 'nohup nice COMMAND'.
Let's check exist status for nohup
125 if `nohup' itself fails, and `POSIXLY_CORRECT' is not set.
126 if COMMAND is found but cannot be invoked.
127 if COMMAND cannot be found.
the exit status of COMMAND otherwise.