What to do when capistrano/mongrel go off the rails

What do do when capistrano/mongrel go off the rails:

So capistrano is awesome right? Right. Mongrel? yeah thats awesome
too.
Things are great until it’s a peak hour of traffic and you want to cap
deploy a ‘quick fix’. Reload the site, 503. WTF!? Capistrano is
spitting
out all sorts of .pid!!'s at you, the client is calling, you’re
frantically
hitting reload (maybe even opening it up in safari just on a whim).
This
isn’t a fun position to be in, but you need to know what to do to get
things
on track. Rather than mess around with cap stop_app/start_app I usually
ssh
into the box:

Check if any mongrels are running:

ps -ax | grep mongrel

if you see any, kill -9 them.

Go to your log directory:

ls | grep mongrel

any mongrel.xxxx.pid files in there? If so, rm each of them.

You should be set to start the app now:

sudo mongrel_rails cluster::start -C /path/to/your/mongrel_cluster.yml

reload…phewww

Or, until mongrel gets more obedient in the stopping department, you
could take the set of steps you just outlined and make them part of
your cap task. :slight_smile: