Sha256: be009d3f1d57f746926889b0a432ce68c3e9eec255fb8473bdb20ccb1a28fffd
Contents?: true
Size: 515 Bytes
Versions: 14
Compression:
Stored size: 515 Bytes
Contents
module Process def self.daemon(nochdir=false, noclose=false) exit if fork # Parent exits, child continues. Process.setsid # Become session leader. exit if fork # Zap session leader. See [1]. Dir.chdir "/" unless nochdir # Release old working directory. if !noclose null = File.open "/dev/null" STDIN.reopen null STDOUT.reopen null STDERR.reopen null end 0 end unless respond_to?(:daemon) end
Version data entries
14 entries across 14 versions & 1 rubygems