From 66a99327d91e3dd1974e615aa985759f984c5c64 Mon Sep 17 00:00:00 2001 From: Eric Wong Date: Sun, 1 Nov 2009 19:50:09 +0000 Subject: Do not override Dir.chdir in config files Even if START_CTX[:cwd] is pointing to another directory, avoid overriding the user's decision to Dir.chdir if they do it in either the Unicorn config file or the config.ru. --- lib/unicorn.rb | 7 ------- 1 file changed, 7 deletions(-) diff --git a/lib/unicorn.rb b/lib/unicorn.rb index 8e3bf32..94be9d2 100644 --- a/lib/unicorn.rb +++ b/lib/unicorn.rb @@ -490,13 +490,6 @@ module Unicorn def spawn_missing_workers (0...worker_processes).each do |worker_nr| WORKERS.values.include?(worker_nr) and next - begin - Dir.chdir(START_CTX[:cwd]) - rescue Errno::ENOENT => err - logger.fatal "#{err.inspect} (#{START_CTX[:cwd]})" - SIG_QUEUE << :QUIT # forcibly emulate SIGQUIT - return - end worker = Worker.new(worker_nr, Unicorn::Util.tmpio) before_fork.call(self, worker) WORKERS[fork { worker_loop(worker) }] = worker -- cgit v1.2.3-24-ge0c7