Displaying 5 results from an estimated 5 matches for "before_exec".
2011 Oct 08
5
How to automate the restarting of Unicorn?
...he restarting of Unicorn with the
following steps, and much appreciate your help.
Assumption: (i) "pid" is set to unicorn.pid in the config file; (ii) a
Unicorn process is already running.
(1) kill -USR2 `cat unicorn.pid` (via Capistrano deployment task for example)
(2) Inside the "before_exec" hook in the config file, do: kill -QUIT
`cat unicorn.pid.oldbin`
My question is: By the time the "before_exec" hook is executed, is it
guaranteed that unicorn.pid.oldbin ahas lready created (otherwise we
have a racing condition here)? Or is there a better way to achieve
what I want...
2010 Sep 09
4
Unicorn fails to restart gracefully on capistrano deploy
First off thanks very much for all the hard work on unicorn. Alas, we''ve encountered an issue where unicorn fails to spawn new workers that have loaded the incoming revision on a capistrano deploy. I''m not entirely sure the issue is due to unicorn as it appears that bundler was responsible for a similar issue in the past:
2013 Aug 23
5
Ruby 2.0 Bad file descriptor (Errno::EBADF)
hi. i''ve been trying to upgrade my stack to ruby 2.0 but keep getting this on ubuntu (not on my local os x):
/hello/shared/bundle/ruby/2.0.0/gems/unicorn-4.6.3/lib/unicorn/http_server.rb:746:in `for_fd'': Bad file descriptor (Errno::EBADF)
from /hello/shared/bundle/ruby/2.0.0/gems/unicorn-4.6.3/lib/unicorn/http_server.rb:746:in `block in inherit_listeners!''
from
2013 Dec 09
2
[PATCH] rework master-to-worker signaling to use a pipe
...reap_all_workers
end
@@ -498,6 +494,7 @@ class Unicorn::HttpServer
end
def after_fork_internal
+ SELF_PIPE.each { |io| io.close }.clear # this is master-only, now
@ready_pipe.close if @ready_pipe
Unicorn::Configurator::RACKUP.clear
@ready_pipe = @init_listeners = @before_exec = @before_fork = nil
@@ -517,6 +514,7 @@ class Unicorn::HttpServer
before_fork.call(self, worker)
if pid = fork
WORKERS[pid] = worker
+ worker.atfork_parent
else
after_fork_internal
worker_loop(worker)
@@ -531,9 +529,7 @@ class Unicorn::HttpSer...
2011 May 19
2
unicorn doesn't restart properly after cap deploy (not using Bundler)
...ser, target_gid)
? ? ? Process::GID.change_privilege(target_gid)
? ? ? Process::UID.change_privilege(target_uid)
? ? end
? rescue => e
? ? if RAILS_ENV == ''development''
? ? ? STDERR.puts "couldn''t change user, oh well"
? ? else
? ? ? raise e
? ? end
? end
end
before_exec do |server|
? STDERR.puts "BEFORE EXEC:"
? ENV["PATH"] =
"/usr/kerberos/sbin:/usr/kerberos/bin:/usr/local/sbin:/usr/local/bin:/sbin:/bin:/usr/sbin:/usr/bin:/root/bin:/usr/local:/opt/ruby-enterprise-1.8.7-2010.02/bin"
? STDERR.puts ENV.inspect
end
Below is the output...