[][src]Function nix::unistd::daemon

pub fn daemon(nochdir: bool, noclose: bool) -> Result<()>

Daemonize this process by detaching from the controlling terminal (see daemon(3)).

When a process is launched it is typically associated with a parent and it, in turn, by its controlling terminal/process. In order for a process to run in the "background" it must daemonize itself by detaching itself. Under posix, this is done by doing the following:

  1. Parent process (this one) forks
  2. Parent process exits
  3. Child process continues to run.

nochdir:

noclose: