deployment to mongrel best practices

Hi all,

I followed the example in AWDwR 2nd edition to deploy my rails app on Fedora Core 5/MySql/Apache/Mongrel and it wokrs great. The only problem is that when the server is restarted the mogrel pack does not come back up. What is the best solution to this? Do most people just put the mongrel::start statement into an rc.d folder thing that runs on startup?

Thanks, Abdullah

First you'll want to make sure mongrel_cluster start scripts are in /etc/init.d/

you can do this by symlinking the one provided by Bradley Taylor:

ln -s /usr/local/lib/ruby/gems/1.8/gems/mongrel_cluster-0.2.0/resources/mongrel_cluster /etc/init.d/mongrel_cluster

and then making it executable:

chmod +x /etc/init.d/mongrel_cluster

You can then issue the commands: /etc/init.d/mongrel_cluster start and stop.

you may also want to symlink your mongrel_cluster.yml configs to /etc/mongrel_cluster:

ln -s /path/to/your/app/config/mongrel_cluster.yml /etc/mongrel_cluster/yourapp.yml

Then to make sure it started on boot, on Fedora, you'd use chkconfig:

/sbin/chkconfig --level 345 mongrel_cluster on

to turn in on on runleves 3 4 5 (this is the same as):

/sbin/chkconfig mongrel_cluster on

another way, is to put a line your /etc/crontab file:

@reboot root /path/to/mongrel_cluster # etc.

cheers....