class Daemonize

Defined in:

contrib/daemonize.cr

Constant Summary

VERSION = "0.1.0"

Class Method Summary

Class Method Detail

def self.daemonize(stdin : String = "/dev/null", stdout : String = "/dev/null", stderr : String = "/dev/null", dir : String = "/") #

Daemonizes the process

This method detaches the process from the terminal so the program may run in the backgound without the terminal.

By default STDIN, STDOUT, and STDERR are redirected to /dev/null. They may be redirected to a file to be read-in by STDIN, or written- to by STDOUT and STDERR.

By default, the daemonized process will change to root as a working directory. Another working directory can be provided.


[View source]
def self.setsid #

[View source]
def self.sid(pid : Int32 = 0) #

[View source]