[Top][All Lists]

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

Re: [monit] Headaches with exec

From: Martin Pala
Subject: Re: [monit] Headaches with exec
Date: Sun, 22 Nov 2009 11:06:26 +0100

See reply inlined bellow:

On Nov 22, 2009, at 2:51 AM, Brian Katz wrote:

So after beating myself up the head for a couple of days with the exec command, I have come to some conclusions and just need either correction or validation.
I'm running monit 4.10.1 under Debian and just want to use it to launch a script if a checksum of a file has changed.
When I use absolute paths after the call to exec, I get pretty consistant results but strangely enough the log never tells me that it is doing the exec. The logs shows that the checksum on the file changed but not that it was doing the 'then' portion of the test. So for awhile I was uncertain as to whether the exec command was even firing. When I put in a dead simple fully qualified command in the script, it worked (if  I used /bin/bash -c in the command).
I guess my question is - will absolute paths always work even if they are outside the provisos of monit? (see below)

Yes - absolute path always works, provided the user under which Monit is running has access to that file.

For security reasons monit purges the environment and only sets a spartan PATH variable that contains /bin, /usr/bin, /sbin and /usr/sbin. If your program or script dies, the reason could be that it expects certainenvironment variables or to find certain programs via PATH. If this is the case you should set the environment variables you need directly in the start or stop script called by monit.
Can I do what ever I want in a script providing I always use absolute paths?

You can do whatever the user which is running Monit can do.

Please can you show part of the configuration with problematic exec?


reply via email to

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