ユニコードでホット展開するのに問題があります。正規のunicorn.rb
の設定を使用して、symlink'dフォルダを指すようにworking_directory
を設定しますが、何らかの形で実際に起動したときに実際のフォルダに詰まっているように見えます。unicorn working_directory with symlink
# config/unicorn.rb
if ENV['RAILS_ENV'] == 'production'
worker_processes 4
else
worker_processes 2
end
working_directory "/var/local/project/symlinkfolder"
# Listen on unix socket
listen "/tmp/unicorn.sock", :backlog => 64
pid "/var/run/unicorn/unicorn.pid"
stderr_path "/var/log/unicorn/unicorn.log"
stdout_path "/var/log/unicorn/unicorn.log"
preload_app true
before_fork do |server, worker|
# the following is highly recomended for Rails + "preload_app true"
# as there's no need for the master process to hold a connection
if defined?(ActiveRecord::Base)
ActiveRecord::Base.connection.disconnect!
end
# Before forking, kill the master process that belongs to the .oldbin PID.
# This enables 0 downtime deploys.
old_pid = "/var/run/unicorn/unicorn.pid.oldbin"
if File.exists?(old_pid) && server.pid != old_pid
begin
Process.kill("QUIT", File.read(old_pid).to_i)
rescue Errno::ENOENT, Errno::ESRCH
# someone else did our job for us
end
end
end
after_fork do |server, worker|
# the following is *required* for Rails + "preload_app true",
if defined?(ActiveRecord::Base)
ActiveRecord::Base.establish_connection
end
# this makes sure the logging-rails framework works when preload_app = true
Logging.reopen
# if preload_app is true, then you may also want to check and
# restart any other shared sockets/descriptors such as Memcached,
# and Redis. TokyoCabinet file handles are safe to reuse
# between any number of forked children (assuming your kernel
# correctly implements pread()/pwrite() system calls)
end
我々はUSR2
を発行すると、私たちはユニコーンログでこれを参照してください。実際のシンボリックリンクフォルダは、バージョン8の上にある間
executing ["/var/local/project/project.d/6/vendor/bundle/ruby/1.9.1/bin/unicorn_rails", "-E", "staging", "-D", "-c", "/var/local/project/symlinkfolder/config/unicorn.rb"│·
, {12=>#<Kgio::UNIXServer:fd 12>}] (in /var/local/project/project.d/8)
のでユニコーンは、バージョン6で何とか「立ち往生」..です。これは、working_directory
がsymlink'd FOLに設定されている
- ...とすぐに我々はいくつかが展開した後、バージョン6のフォルダを剪定として問題となります私たちは、
USR2
信号
私たちは何を逃したのを送る前にシンボリックリンクを更新正しく/var/local/project/project.d/[id]
フォルダ