Running Mongrel on startup

Hi

I have a mongrel server running, but it stops whenever i reboot my
machine

Is there a way of starting the mongrel server on bootup?

Thanks

I use this one in my local startup script:

http://www.simplisticcomplexity.com/2006/11/29/mongrel_processes-updated-to-06/

mongrel_cluster comes with a init script which works well. On my
Fedora/Red Hat/CentOS systems, the script is found at
/usr/lib/ruby/gems/1.8/gems/mongrel_cluster-1.0.5/resources/mongrel_cluster

Now if I could find out a way to also get 'script/backgroundrb start' to
automatically run as user, that would be nice.

Craig

i’ve used Monit for that.

my mongrel configuration:

check process mongrel_8001

with pidfile /tmp/mongrel/8001.pid
start program = “/usr/bin/mongrel_rails cluster::start -C <RAILS_ROOT>/config/mongrel_cluster.production.yml --clean --only 8001”
stop program = “/usr/bin/mongrel_rails cluster::stop -C <RAILS_ROOT>/config/mongrel_cluster.production.yml --clean --only 8001”

if totalmem is greater than 80.0 MB for 4 cycles then restart
if cpu is greater than 50% for 2 cycles then alert
if cpu is greater than 80% for 4 cycles then restart
if loadavg(5min) greater than 10 for 8 cycles then restart

if 20 restarts within 20 cycles then timeout
if failed port 8001 protocol http with timeout 60 seconds then restart
group

and my backgroundrb configuration:

check process backgroundrb
with pidfile /tmp/backgroundrb.pid
start program = "/bin/su -c ‘cd <RAILS_ROOT> && RAILS_ENV=production script/backgroundrb start’ "
stop program = "/bin/su -c ‘cd <RAILS_ROOT> && RAILS_ENV=production script/backgroundrb stop && sleep 3 && pkill -9 -f backgroundrb && rm /tmp/backgroundrb.pid’ "

if cpu > 60% for 2 cycles then alert
if cpu > 90% for 5 cycles then restart
group

after that, run "sudo /etc/init.d/monitrc start all -g "

Felipe Mesquita
http://felipemesquita.com
http://emailfax.com.br
http://gettingdoc.com

I'm running Ubuntu

All I wanted was a script that, when the server restarted, deleted the
PID file and could be restarted automatically.

I'll take a look around at the examples you've given me

Thanks