Jags Rao
2008-Jul-02 13:33 UTC
[Mongrel] deleting pid files on ubuntu restart due to power down
hi guys we are running a ubuntu machine as our demo server for serving Ruby on rails apps we are using mysql,nginx,mongrel for serving the sites. the problem is if for any reason the power fails out and comes back mysql and nginx get started fine but mongrel does not work due to some pid(mongrel.8000.pid mongrel.8001.pid mongrel.8002.pid) files existing in log folder. we then manually delete the files and start the cluster. is there anyway we can check during reboot of ubuntu server for any existing pid files in log folder and delete them and then start the mongrel cluster. thanks jags -- Posted via http://www.ruby-forum.com/.
Hassan Schroeder
2008-Jul-02 14:38 UTC
[Mongrel] deleting pid files on ubuntu restart due to power down
On Wed, Jul 2, 2008 at 6:33 AM, Jags Rao <lists at ruby-forum.com> wrote:> the problem is if for any reason the power fails out and comes backsounds like the first thing to do is get a UPS :-)> mysql and nginx get started fine but mongrel does not work due to > some pid(mongrel.8000.pid mongrel.8001.pid mongrel.8002.pid) files> is there anyway we can check during reboot of ubuntu server for any > existing pid > files in log folder and delete them and then start the mongrel cluster.Of course -- look in /etc/init.d for examples of scripts that are run at boot time (and/or shutdown). Write your own and link it to the appropriate run-level (rc*.d) directory. FWIW, -- Hassan Schroeder ------------------------ hassan.schroeder at gmail.com
Rafael G.
2008-Jul-02 14:42 UTC
[Mongrel] deleting pid files on ubuntu restart due to power down
New mongrel''s versions has the parameter "--clean". It do the work :) Jags Rao escribi?:> hi guys > > we are running a ubuntu machine as our demo server for serving Ruby on > rails apps > we are using mysql,nginx,mongrel for serving the sites. > > the problem is if for any reason the power fails out and comes back > mysql and nginx get started fine but mongrel does not work due to > some pid(mongrel.8000.pid mongrel.8001.pid mongrel.8002.pid) files > existing in log folder. > > we then manually delete the files and start the cluster. > > is there anyway we can check during reboot of ubuntu server for any > existing pid > files in log folder and delete them and then start the mongrel cluster. > > thanks > jags >-- Rafael Garcia Ortega -------------- next part -------------- A non-text attachment was scrubbed... Name: rgo.vcf Type: text/x-vcard Size: 241 bytes Desc: not available URL: <http://rubyforge.org/pipermail/mongrel-users/attachments/20080702/721da516/attachment-0001.vcf>
Brian Williams
2008-Jul-02 15:09 UTC
[Mongrel] deleting pid files on ubuntu restart due to power down
Ubuntu and debian mount /var/run/ directories using tmpfs, which means the /var/run directories are cleared out at boot time. That''s why debian packages write out pid files into subdirectories of /var/run. You might be able to configure your mongrel so that the pid files are written under /var/run --Brian 2008/7/2 Rafael G. <rgo at aspgems.com>:> New mongrel''s versions has the parameter "--clean". It do the work :) > > Jags Rao escribi?: > >> hi guys >> >> we are running a ubuntu machine as our demo server for serving Ruby on >> rails apps >> we are using mysql,nginx,mongrel for serving the sites. >> >> the problem is if for any reason the power fails out and comes back >> mysql and nginx get started fine but mongrel does not work due to >> some pid(mongrel.8000.pid mongrel.8001.pid mongrel.8002.pid) files >> existing in log folder. >> >> we then manually delete the files and start the cluster. >> >> is there anyway we can check during reboot of ubuntu server for any >> existing pid >> files in log folder and delete them and then start the mongrel cluster. >> >> thanks >> jags >> >> > > > -- > Rafael Garcia Ortega > > > _______________________________________________ > 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/20080702/341580df/attachment.html>