I have followed this CentOS 5.2 Mongrel Cluster tutorial for starting mongrel_cluster at reboot on CentOS 5.2. However, I have to manually start mongrel_cluster at reboot.
Since that didn't work, I followed the advice in Set up Mongrel as a service and start it automatically on Centos 5.2. The key bits are:
chkconfig -add mongrel_cluster
chkconfig –level 345 mongrel_cluster on
Again... This sidn't work: I still have to manually start mongrel_cluster at boot. Finally, I tried adding "@reboot ..." to my crontab as so:
RAILS_ROOT=/path/to/root
# Restart Ferret Drb server on host reboot:
@reboot ${RAILS_ROOT}/script/ferret_server --root=${RAILS_ROOT} -e production start
# Restart rails apps (via Mongrel) on host reboot:
@reboot /etc/init.d/mongrel_cluster start
but again... I have to manually restart both Mongrel and Ferret!
Finally, I have followed the How to launch DRb server on reboot (linux) instructions, but I have to manually launch the Ferret DRb at reboot...
This is my first sysadmin gig, so I'm not even sure which logfile(s) to be looking at... If you need more information to help, please help me out & let me know where to look!
The answers to another question gave me an idea that seems to have worked. I've added the following to my /etc/rc.local file:
... and whammy! Mongrel & Ferret DRb servers seem to reboot!
Is there a corresponding script to call when the system is shutting down (i.e. to properly kill mongrel_cluster & ferret_server)?
Pete - you can always stop the mongrel_cluster by using a similar command in your rc script:
That's standard initrc script handling. You'll usually find that a '/etc/init.d/scriptname' can be followed at least by either 'start' 'stop' or 'restart' (the last command almost always attempts to run the stop section of the script followed by the start script.
However, you shouldn't need to do this. When the system shuts down, all running processes are sent a termination signal which means they should terminate normally on shutdown. You can see this on the terminal outpout as it shuts down, although I'm not sure if it's logged by default on CentOS. (except if mongrel or ferret are configured to make logs)
Hope that helps.