Displaying 7 results from an estimated 7 matches for "oldbin".
Did you mean:
oldbit
2011 Oct 08
5
How to automate the restarting of Unicorn?
...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?
Please Cc me as I am not on the mailing list.
Please also let me k...
2010 Jul 13
4
SIGWINCH
...to the
old master followed by a QUIT to the new master, then:
1. the new master does die, and the old master does work again
2. the "old" master keeps running with a process name of "master (old)"
3. the "old" master keeps running with a pid file named unicorn.pid.oldbin
Because the file is now named unicorn.pid.oldbin a later attempt to
deploy using scripts is made rather difficult as they assume a pid file
named unicorn.pid.
How could I get unicorn to rename the pid file back to unicorn.pid ? I
see some code in method +reap_all_workers+ that suggests it wou...
2012 Dec 04
2
403 Forbidden from nginx when unicorn started in debug mode
...icorn.stderr.log"
stdout_path "/var/www/aceleathergoods/shared/log/unicorn.stdout.log"
end
before_fork do |server, worker|
if defined?(ActiveRecord::Base)
ActiveRecord::Base.connection.disconnect!
end
old_pid = "#{shared_path}/pids/unicorn.aceleathergoods.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|
if defined?(ActiveReco...
2009 Oct 02
0
[PATCH] configurator: update some migration examples
...rocess with SIGTTOU to avoid a
+ # # thundering herd (especially in the "preload_app false" case)
+ # # when doing a transparent upgrade. The last worker spawned
+ # # will then kill off the old master process with a SIGQUIT.
+ # old_pid = "#{server.config[:pid]}.oldbin"
+ # if old_pid != server.pid
+ # begin
+ # sig = (worker.nr + 1) >= server.worker_processes ? :QUIT : :TTOU
+ # Process.kill(sig, File.read(old_pid).to_i)
+ # rescue Errno::ENOENT, Errno::ESRCH
+ # end
+ #
+ # # optionally throttle the master from fo...
2010 Oct 02
2
Unicorn doesn't reload the app after the HUP signal
...true
timeout 30
listen File.expand_path(File.join(__FILE__,
"../../tmp/sockets/unicorn.sock")), :backlog => 2048
if GC.respond_to?(:copy_on_write_friendly=)
GC.copy_on_write_friendly = true
end
before_fork do |server, worker|
old_pid = RAILS_ROOT + ''/tmp/pids/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|
ActiveRecord::Base.establi...
2012 Jan 31
12
FreeBSD jail and unicorn
...oy/staging/unicorn.sock"
pid "/home/deploy/staging/unicorn.pid"
preload_app true
stderr_path "/home/deploy/staging/unicorn.stderr.log"
stdout_path "/home/deploy/staging/unicorn.stdout.log"
before_fork do |server, worker|
old_pid = "#{server.config[:pid]}.oldbin"
if old_pid != server.pid
begin
process_id = File.read(old_pid).to_i
puts "sending QUIT to #{process_id}"
Process.kill :QUIT, process_id
rescue Errno::ENOENT, Errno::ESRCH
end
end
end
---
I''ve tried without the before_fork-block, but I t...
2011 Jun 16
7
[PATCH] replace fchmod()-based heartbeat with raindrops
...nerous 60 seconds (same default as in Mongrel).
diff --git a/lib/unicorn/http_server.rb b/lib/unicorn/http_server.rb
index 059f040..0a9af86 100644
--- a/lib/unicorn/http_server.rb
+++ b/lib/unicorn/http_server.rb
@@ -373,7 +373,7 @@ class Unicorn::HttpServer
self.pid = pid.chomp(''.oldbin'') if pid
proc_name ''master''
else
- worker = WORKERS.delete(wpid) and worker.tmp.close rescue nil
+ worker = WORKERS.delete(wpid) and worker.close rescue nil
m = "reaped #{status.inspect} worker=#{worker.nr rescue ''unkno...