Skip to content

End of Life Ruby 3.2 has reached end of life and gets no more fixes. Switch to Ruby 4.0 →

class method

Process.daemon

Process.daemon() → 0
Process.daemon(nochdir=nil,noclose=nil) → 0

Detach the process from controlling terminal and run in the background as system daemon. Unless the argument nochdir is true (i.e. non false), it changes the current working directory to the root (“/”). Unless the argument noclose is true, daemon() will redirect standard input, standard output and standard error to /dev/null. Return zero on success, or raise one of Errno::*.

See also .clock_gettime .detach .clock_getres .egid also in 4.1 · 4.0 · 3.4 · 3.3 · 3.1 · 3.0