Skip to content

Commit

Permalink
allow a daemonized process to be detached (run into some troubles whi…
Browse files Browse the repository at this point in the history
…le trying to restart agents from a capistrano deployment)
  • Loading branch information
jakimowicz committed Apr 9, 2009
1 parent 6ae29fe commit e65991c
Showing 1 changed file with 5 additions and 3 deletions.
8 changes: 5 additions & 3 deletions lib/nanite/daemonize.rb
Expand Up @@ -4,9 +4,11 @@ def daemonize
exit if fork
Process.setsid
exit if fork
#$stdin.reopen("/dev/null")
#$stdout.reopen(log.file, "a")
#$stderr.reopen($stdout)
Dir.chdir "/"
File.umask 0000
STDIN.reopen "/dev/null"
STDOUT.reopen "/dev/null", "a"
STDERR.reopen STDOUT
end
end
end

0 comments on commit e65991c

Please sign in to comment.