Hi,
Monit sets spartan environment/sandbox ... see FAQ no.6:
--8<--
6. Q: I'm having trouble getting monit to execute any "start" or
"stop" program commands. The log file says that they're being
executed, and I can't find anything wrong when I run monit in
verbose mode.
A: Monit did start the program but for some reason the service dies
later. Before we go on and introduce you to the fine art of
system debugging, it's worth to note that:
For security reasons monit purges the environment and only set 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 certain environment variables or to find certain
programs via the PATH. If this is the case you should set the
environment variables you need directly in the start or stop
script called by monit.
--8<--
Monit's working directory when running as deamon is "/". Since your
scripts use relative path to the binary, it won't be found. The
same problem is with the logfile.
If you'll set absolute paths, it should work fine.
Martin