From dc60ca25aa72bcee0becc4cdebb1be67acc5b5b5 Mon Sep 17 00:00:00 2001 From: Eric Wong Date: Sun, 12 Apr 2009 23:16:20 -0700 Subject: Don't bother restoring ENV or umask across reexec If someone changes ENV or umask in the master process (via before_fork or when loading the config), assume it was intentional and just preserve it across reexec. --- lib/unicorn.rb | 4 ---- 1 file changed, 4 deletions(-) diff --git a/lib/unicorn.rb b/lib/unicorn.rb index 9a87e50..9ce7fc1 100644 --- a/lib/unicorn.rb +++ b/lib/unicorn.rb @@ -32,8 +32,6 @@ module Unicorn # symlink dirs are the default with Capistrano... :cwd => `/bin/sh -c pwd`.chomp("\n"), :zero => $0.dup, - :environ => {}.merge!(ENV), - :umask => File.umask, }.freeze Worker = Struct.new(:nr, :tempfile) unless defined?(Worker) @@ -338,10 +336,8 @@ module Unicorn end @reexec_pid = fork do - ENV.replace(@start_ctx[:environ]) listener_fds = @listeners.map { |sock| sock.fileno } ENV['UNICORN_FD'] = listener_fds.join(',') - File.umask(@start_ctx[:umask]) Dir.chdir(@start_ctx[:cwd]) cmd = [ @start_ctx[:zero] ] + @start_ctx[:argv] -- cgit v1.2.3-24-ge0c7