1 $stdin.sync = $stdout.sync = $stderr.sync = true
4 class Unicorn::Launcher
6 # We don't do a lot of standard daemonization stuff:
7 # * umask is whatever was set by the parent process at startup
8 # and can be set in config.ru and config_file, so making it
9 # 0000 and potentially exposing sensitive log data can be bad
11 # * don't bother to chdir("/") here since unicorn is designed to
12 # run inside APP_ROOT. Unicorn will also re-chdir() to
13 # the directory it was started in when being re-executed
14 # to pickup code changes if the original deployment directory
15 # is a symlink or otherwise got replaced.
17 $stdin.reopen("/dev/null")
19 # We only start a new process group if we're not being reexecuted
20 # and inheriting file descriptors from our parent
21 unless ENV['UNICORN_FD']
26 # $stderr/$stderr can/will be redirected separately in the Unicorn config
27 $stdout.reopen("/dev/null", "a")
28 $stderr.reopen("/dev/null", "a")
30 $stdin.sync = $stdout.sync = $stderr.sync = true