The nohup command is a poor person who runs a process like a daemon. As Bruno Ranshart noted, when you run a command in an interactive shell, it has a control terminal and will receive a SIGHUP (hang) signal when the control process (usually your login shell) is completed. The nohup command arranges input with /dev/null , and for output and errors, nohup.out , and for a program, ignore interrupts, stop signals and hangs. In fact, it still has the same control terminal - it simply ignores the terminal controls. Please note: if you want the process to run in the background, you must tell the shell to run it in the background - at least on Solaris (that is, you type " nohup sleep 20 & "; without an ampersand, the process runs synchronously in the foreground )
Typically, a process running through nohup is something that takes time, but which does not freeze, waiting for interaction from other sources.
Usually (this means that if you try hard, you can find exceptions to these rules), the daemon process is something that is hiding in the background, disconnected from any terminal, but waiting for a response to some kind of input. Network daemons wait for connection requests or UDP messages to arrive over the network, do the appropriate job, and send the response again. Think of a web server, for example, or a DBMS.
When a process is completely dismounted, it goes through some steps that nohup code goes through; it reorders its inputs / outputs, so it is not connected to any terminal, it is not disconnected from the process group, it ignores the corresponding signals (which may mean that it does not ignore any signals, since there is no terminal to send any of the signals generated through the terminal). Typically, it expands once, and the parent completes successfully. A child process usually unfolds a second time after fixing its process group and session identifier, etc .; the baby will also come out. The grandson process is now standalone and will not appear in ps output for the terminal on which it was running.
You can watch Advanced Unix Programming , 3rd Edn by W Richard Stevens and Stephen A Rago, or Advanced Unix Programming, 2nd Edn by Marc J Rochkind for a discussion of demonization.
I have a daemonize program that will demonize a program that does not know how to self-determine it (correctly). It was written to fix defects in a program that was supposed to demonize itself, but did not work properly. Contact me if you want - see my profile.