Tip: zoombie process using Bluepill and Capistrano

307 views
Skip to first unread message

Daniel Lopes

unread,
Apr 16, 2010, 2:47:12 PM4/16/10
to Bluepill
Hello, this message is just to help people with same problem that I
had in this week.

When you use capistrano to restart (start/stop) your bluepill add some
seconds between stop and start. In my case the lack of this interval
produced zombie process that bluepill was unable to kill and many
times an email (for example) was delegated to one of this zombies.
Discover the reason why sometimes after deploy the process are no
killed was really hard and waste of time.

So, if you do things like this in your deploy.rb:

after "deploy:update" do
bluepill.quit
bluepill.start
end

namespace :bluepill do
desc "Stop processes that bluepill is monitoring and quit bluepill"
task :quit, :roles => :app do
sudo 'bluepill stop'
sudo 'bluepill quit'
end

desc "Load bluepill configuration and start it"
task :start, :roles => :app do
sudo "bluepill load #{current_path}/config/bluepill/
#{rails_env}.pill"
end

desc "Prints bluepills monitored processes statuses"
task :status, :roles => :app do
run "sudo bluepill status"
end
end

I recommend this:

after "deploy:update" do
bluepill.quit
bluepill.start
end

namespace :bluepill do
desc "Stop processes that bluepill is monitoring and quit bluepill"
task :quit, :roles => :app do
sudo 'bluepill stop'
sudo 'bluepill quit'
sleep 5
end

desc "Load bluepill configuration and start it"
task :start, :roles => :app do
sudo "bluepill load #{current_path}/config/bluepill/
#{rails_env}.pill"
end

desc "Prints bluepills monitored processes statuses"
task :status, :roles => :app do
run "sudo bluepill status"
end
end


--
Subscription settings: http://groups.google.com/group/bluepill-rb/subscribe?hl=en

Akzhan Abdulin

unread,
Apr 18, 2010, 4:05:02 PM4/18/10
to bluep...@googlegroups.com
Yet another choice - wrap all processes into runit (or daemon tools) service.

They use SIG_CHILD instead of pid monitoring that's more robust solution.

Bluepill monitors more sophicticated cases.

2010/4/16 Daniel Lopes <daniel...@gmail.com>
Reply all
Reply to author
Forward
0 new messages