[Top][All Lists]

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: [monit] Monit and BackgroundRB

From: Martin Pala
Subject: Re: [monit] Monit and BackgroundRB
Date: Sun, 21 Sep 2008 12:01:01 +0200

As mentioned in the FAQ, all environment variables are stripped.

The absolute paths may be necessary inside the "/home/ramon/app/ current/script/backgroundrb" script ... in your case you've also set the HOME variable, thus it may be necessary as well. You can try the shell wrapping example.

Also it is possible that you start script requires additional environment variables ...

On Sep 21, 2008, at 11:49 AM, Ramon Miguel M. Tayag wrote:

Thanks Martin!  By absolute paths I suppose you mean:

start program = "/usr/bin/ruby
/home/ramon/app/current/script/backgroundrb start"

I get the exact same response :(  It starts if I do it through the
command line (but with "sudo" at the beginning) and "Execution failed"
if I use monit to start it.

On Sun, Sep 21, 2008 at 5:35 PM, Martin Pala <address@hidden> wrote:
For security reasons monit purges the environment and only sets spartan PATH variable that contains /bin, /usr/bin, /sbin and /usr/sbin (see monit FAQ -
The start program is not executed in shell - the arguments are given to execv(), thus the following construct in your configuration won't work:

start program = "/usr/bin/env
PATH=/bin:/usr/bin:/sbin:/usr/sbin:/usr/local/bin HOME=/home/ramon
/usr/bin/ruby /home/ramon/app/current/script/backgroundrb start"

You have several options:

1.) you can use absolute paths in your startup script or put the PATH
setting to the beginning of the script.
2.) you can wrap the start command in shell like this:
start program = "/bin/bash -c '/usr/bin/env
PATH=/bin:/usr/bin:/sbin:/usr/sbin:/usr/local/bin HOME=/home/ramon
/usr/bin/ruby /home/ramon/app/current/script/backgroundrb start'"


Ramon Tayag

To unsubscribe:

reply via email to

[Prev in Thread] Current Thread [Next in Thread]