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 -
Q6: http://www.tildeslash.com/monit/doc/faq.php).
The start program is not executed in shell - the arguments are
given to
execv(), thus the following construct in your configuration won't
work:
--8--
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"
--8--
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'"
Martin
--
Ramon Tayag
--
To unsubscribe:
http://lists.nongnu.org/mailman/listinfo/monit-general