monit newbie problem

I'm not sure you need to include the '/usr/bin/ruby' in your start
program. The following setup works for me:

check process mongrel-8007 with pidfile /var/zena/current/log/mongrel. 8007.pid    start program = "/var/lib/gems/1.8/bin/mongrel_rails start -d -e
production -p 8007 -a 127.0.0.1 -P log/mongrel.8007.pid -c /var/zena/ current" --user www-data --group www-data    stop program = "/var/lib/gems/1.8/bin/mongrel_rails stop -P log/ mongrel.8007.pid -c /var/zena/current"

Gaspard

Gaspard Bucher wrote:

I'm not sure you need to include the '/usr/bin/ruby' in your start program. The following setup works for me:

check process mongrel-8007 with pidfile /var/zena/current/log/mongrel. 8007.pid    start program = "/var/lib/gems/1.8/bin/mongrel_rails start -d -e production -p 8007 -a 127.0.0.1 -P log/mongrel.8007.pid -c /var/zena/ current" --user www-data --group www-data    stop program = "/var/lib/gems/1.8/bin/mongrel_rails stop -P log/ mongrel.8007.pid -c /var/zena/current"

Gaspard

i have updated my monitrc file :

Try running your start program without any environment variables (as
it is probably run by monit):

# env -i /usr/bin/mongrel_rails start -d -e development -p 3003 -a
127.0.0.1 -P /home/seb/railsproject/cpericard/log/mongrel.3003.pid -c / home/seb/railsproject/cpericard

Make sure "which mongrel_rails" gives /usr/bin/mongrel_rails

I had to use (debian) /var/lib/gems/1.8/bin/mongrel_rails

Gaspard

Gaspard Bucher wrote:

Try running your start program without any environment variables (as it is probably run by monit):

# env -i /usr/bin/mongrel_rails start -d -e development -p 3003 -a 127.0.0.1 -P /home/seb/railsproject/cpericard/log/mongrel.3003.pid -c / home/seb/railsproject/cpericard

Make sure "which mongrel_rails" gives /usr/bin/mongrel_rails

I had to use (debian) /var/lib/gems/1.8/bin/mongrel_rails

Gaspard

that's better, monit is starting but ... not my rails app

my monitrc file :

You misunderstood me. Try running your command * in the shell * to test it first. You also get any error messages. So you should type:

# env -i /usr/bin/mongrel_rails start -d -e development -p 3003 -a 127.0.0.1 -P /home/seb/railsproject/cpericard/log/mongrel.3003.pid -c / home/seb/railsproject/cpericard

and see how it works.

Setting "env -i" in the shell reproduces the environment used in
monit, so it lets you test your command as if it was run by monit.

Gaspard

Gaspard Bucher wrote:

You misunderstood me. Try running your command * in the shell * to test it first. You also get any error messages. So you should type:

# env -i /usr/bin/mongrel_rails start -d -e development -p 3003 -a 127.0.0.1 -P /home/seb/railsproject/cpericard/log/mongrel.3003.pid -c / home/seb/railsproject/cpericard

and see how it works.

Setting "env -i" in the shell reproduces the environment used in monit, so it lets you test your command as if it was run by monit.

Gaspard

sorry ! and thanks for your help gaspard

i tried this command and mongrel is starting.

Frioffol Friofool wrote:

Gaspard Bucher wrote:

You misunderstood me. Try running your command * in the shell * to test it first. You also get any error messages. So you should type:

# env -i /usr/bin/mongrel_rails start -d -e development -p 3003 -a 127.0.0.1 -P /home/seb/railsproject/cpericard/log/mongrel.3003.pid -c / home/seb/railsproject/cpericard

and see how it works.

Setting "env -i" in the shell reproduces the environment used in monit, so it lets you test your command as if it was run by monit.

Gaspard

sorry ! and thanks for your help gaspard

i tried this command and mongrel is starting.

now it's working !

i didn't change anything.

my definitive conf file is :

set daemon 60

set httpd port 2812 and     use address 127.0.0.1     allow 127.0.0.1

check process mongrel-3003 with pidfile /home/seb/railsproject/cpericard/log/mongrel.3003.pid   start program = "/usr/bin/mongrel_rails start -d -e development -p 3003 -a 127.0.0.1 -P /home/seb/railsproject/cpericard/log/mongrel.3003.pid -c /home/seb/railsproject/cpericard"   stop program = "/usr/bin/mongrel_rails stop -P /home/seb/railsproject/cpericard/log/mongrel.3003.pid -c /home/seb/railsproject/cpericard" group mongrel

thanks for all your help !