I was wondering if someone here might be able to help me out with my current monit problem. I’ve dug through the docs and I can’t seem to find what I’m doing wrong.
/bin/echo -n $$ > $FOOPID
echo 'restarting with '$$' as pid' >> $FOODATES
ls -l $FOOPID >> $FOODATES
cat $FOOPID >> $FOODATES
date >> $FOODATES
cat $FOOPID >> $FOODATES 2>&1
set daemon 10 # interval between polls, in seconds
set logfile "/tmp/monitlog.log"
set pidfile "/tmp/monitpid.pid"
set statefile "/tmp/monitstate.state"
set mailserver <REDACTED>
set httpd port 2812
check process test with pidfile /Users/marmel01/Documents/foo.pid
start program = "/Users/marmel01/Documents/monittest.sh"
stop program = "/bin/kill $(/bin/cat /Users/marmel01/Documents/foo.pid)”
However, when I run, while the script seems to be executing perfectly well, monit won’t seem to recognise the fact!
Here’s an excerpt form monit’s log
[GMT Nov 19 12:39:30] info : Monit daemon with PID 75079 awakened
[GMT Nov 19 12:39:53] error : 'test' failed to start (exit status -1) -- Program /Users/marmel01/Documents/monittest.sh timed out
[GMT Nov 19 12:39:53] info : Awakened by User defined signal 1
[GMT Nov 19 12:39:53] info : 'test' monitor action failed
[GMT Nov 19 12:39:53] error : 'test' process is not running
[GMT Nov 19 12:39:53] info : 'test' trying to restart
[GMT Nov 19 12:39:53] info : 'test' start: /Users/marmel01/Documents/monittest.sh
[GMT Nov 19 12:40:23] error : 'test' failed to start (exit status -1) -- Program /Users/marmel01/Documents/monittesh.sh timed out
[GMT Nov 19 12:40:33] error : 'test' process is not running
The pid file appears to be where it should be and is readable. I don’t know where to go from here.
I’m running the latest version of monit on Darwin.