Welcome Guest | Login

My @reboot cron commands aren't working

When the hosting rails server has trouble and reboots, it seems that my cron reboot instructions aren't working; my apps stay offline until i notice the problem and manually restart them.

The reboot instructions in my crontab look like this (a different port for each app), which is taken from the instructions in the wiki:
@reboot cd /home/my_hr_username/apps/my_app/current/log && rm mongrel.pid -f
@reboot cd /home/my_hr_username/apps/my_app/current && /usr/local/bin/mongrel_rails start -e production -d -p 40661
Can you see anything wrong here?

2007-07-31 03:20 PM

That looks correct.  Do you have anything in your mongrel.log?  Did your mongrel.pid get cleared successfully?   We manually check and restart all non-restarted Mongrels after a reboot - there are occasions where a mongrel will not fire up, but usually you'll get an error in your mongrel.log.  

2007-07-31 05:29 PM

thanks, i will check that out

2007-07-31 05:41 PM

Hi, I had the same problem today, but I don't see any errors in my mongrel log.  My crontab is below...  (portnum replaced with XXXX).  Can anyone help?

Thanks!

Mike


#clear out pid file if it didn't get erased
@reboot cd /home/user/railsapp/log && rm mongrel.pid -f

#start up your Mongrel server
@reboot cd /home/user/railsapp && /usr/local/bin/mongrel_rails start -e production -p XXXX -d

2007-10-23 09:51 AM

Hi - I didn't see any issue with your reboot cron. I think it would be better if you can set up a cron to monitor your mongrel once every one hour or so. You can also refer the URL given below to set it up
http://www.hostingrails.com/forums/everything_else_thread/343

2007-10-23 12:54 PM

HostingRails Support
Thanks, Kumar.  I'll definitely do that, but --

An hour is a lot of downtime.  Why isn't the crontab getting hit when the machine restarts?  

The mongrel tutorial at hostingrails http://www.hostingrails.com/forums/wiki_thread/19) still reflects the idea that the @reboot crontab entry would be executed on reboot...

2007-10-23 11:29 PM

Hello,

Most of the crontabs work properly. Also the reasons for the crontab failing to start properly is depended on many factors.
Most commonly seen problem is that the rails app path is not specified properly.
In other cases removal of the mongrel.pid file fails which further causes failure in starting mongrels.

2007-10-24 12:22 AM

Regards,
Rahul

Hello Guest! In order to post you must be an active client with us, please log in or sign up today!