Casper Fabricius
2007-Sep-07 07:30 UTC
[Mongrel] Fails to restart mongrel cluster after Capistrano rollback (PIDs not deleted)
Hi, I am deploying a Rails website using Capistrano to a VPS running the site through Apache and Mongrel. ''cap deploy'' works fine, and mongrels are restarted. When I execute ''cap deploy:rollback'', however, my script fails to restart the mongrels giving this error: !!! PID file tmp/pids/mongrel.5000.pid already exists. Mongrel could be running already. Check your log/mongrel.5000.log for errors. I have a hunch that the error is related to the fact that I link /tmp/ pids into the shared directory upon each release in the "after_update" task, but I''m not sure how I end up with this problem, as the old dir I''m rolling back also has the link setup. The mongrels are stopped, but for some reason they don''t clean up their PID files, and thus they fail to start again. The full output of the rollback looks like this: http://pastie.caboo.se/94602 My deploy.rb looks like this: http://pastie.caboo.se/94600 Any help on this issue would be appreciated - thanks! Best regards, Casper Fabricius
Wayne E. Seguin
2007-Sep-07 16:15 UTC
[Mongrel] Fails to restart mongrel cluster after Capistrano rollback (PIDs not deleted)
On Sep 07, 2007, at 03:30 , Casper Fabricius wrote:> Hi, > > I am deploying a Rails website using Capistrano to a VPS running the > site through Apache and Mongrel. > > ''cap deploy'' works fine, and mongrels are restarted. When I execute > ''cap deploy:rollback'', however, my script fails to restart the > mongrels giving this error: > !!! PID file tmp/pids/mongrel.5000.pid already exists. Mongrel could > be running already. Check your log/mongrel.5000.log for errors. > > I have a hunch that the error is related to the fact that I link /tmp/ > pids into the shared directory upon each release in the > "after_update" task, but I''m not sure how I end up with this problem, > as the old dir I''m rolling back also has the link setup. The mongrels > are stopped, but for some reason they don''t clean up their PID files, > and thus they fail to start again. > > The full output of the rollback looks like this: > http://pastie.caboo.se/94602 > > My deploy.rb looks like this: > http://pastie.caboo.se/94600 > > Any help on this issue would be appreciated - thanks! > > Best regards, > Casper Fabricius > ________________________________________Casper, I''d rewrite the default rollback task to: 1. Stop mongrel cluster 2. Rollback 3. Restart mongrel cluster Between 2-3 you might also want to ensure that the new (old) "current" directory links the pid directory correctly. ~Wayne s///g Wayne E. Seguin Sr. Systems Architect & Systems Administrator -------------- next part -------------- An HTML attachment was scrubbed... URL: http://rubyforge.org/pipermail/mongrel-users/attachments/20070907/f6484653/attachment.html
Casper Fabricius
2007-Sep-11 07:31 UTC
[Mongrel] Fails to restart mongrel cluster after Capistrano rollback (PIDs not deleted)
Thanks Wayne, That does the trick for me! I simply added this: task :rollback do stop rollback_code start end Cheers, Casper On 07/09/2007, at 18:15, Wayne E. Seguin wrote:> On Sep 07, 2007, at 03:30 , Casper Fabricius wrote: >> Hi, >> >> I am deploying a Rails website using Capistrano to a VPS running the >> site through Apache and Mongrel. >> >> ''cap deploy'' works fine, and mongrels are restarted. When I execute >> ''cap deploy:rollback'', however, my script fails to restart the >> mongrels giving this error: >> !!! PID file tmp/pids/mongrel.5000.pid already exists. Mongrel could >> be running already. Check your log/mongrel.5000.log for errors. >> >> I have a hunch that the error is related to the fact that I link / >> tmp/ >> pids into the shared directory upon each release in the >> "after_update" task, but I''m not sure how I end up with this problem, >> as the old dir I''m rolling back also has the link setup. The mongrels >> are stopped, but for some reason they don''t clean up their PID files, >> and thus they fail to start again. >> >> The full output of the rollback looks like this: >> http://pastie.caboo.se/94602 >> >> My deploy.rb looks like this: >> http://pastie.caboo.se/94600 >> >> Any help on this issue would be appreciated - thanks! >> >> Best regards, >> Casper Fabricius >> ________________________________________ > > Casper, > > I''d rewrite the default rollback task to: > 1. Stop mongrel cluster > 2. Rollback > 3. Restart mongrel cluster > > Between 2-3 you might also want to ensure that the new (old) > "current" directory links the pid directory correctly. > > ~Wayne > > s///g > Wayne E. Seguin > Sr. Systems Architect & Systems Administrator > > _______________________________________________ > Mongrel-users mailing list > Mongrel-users at rubyforge.org > http://rubyforge.org/mailman/listinfo/mongrel-users-------------- next part -------------- An HTML attachment was scrubbed... URL: http://rubyforge.org/pipermail/mongrel-users/attachments/20070911/e459260c/attachment.html
Wayne E. Seguin
2007-Sep-11 15:08 UTC
[Mongrel] Fails to restart mongrel cluster after Capistrano rollback (PIDs not deleted)
On Sep 11, 2007, at 03:31 , Casper Fabricius wrote:> Thanks Wayne, > > That does the trick for me! I simply added this: > > task :rollback do > stop > rollback_code > start > end > > Cheers, > CasperCasper, Excellent! I am glad that worked. Thank you for sharing your solution. Regards, ~Wayne s///g Wayne E. Seguin Sr. Systems Architect & Systems Administrator -------------- next part -------------- An HTML attachment was scrubbed... URL: http://rubyforge.org/pipermail/mongrel-users/attachments/20070911/bf156885/attachment-0001.html