Trying to get monit to monitor a custom daemon we wrote, and it's just not working with the bash stop/start script. If I run the stop/start script by hand from the command line it's working 100% perfectly, every single time. If it get's executed through monit, the variables is empty. Extract from the script where I am having problems:
GETPID=$(ps aux | grep unicorn | grep master | cut -d" " -f7)
echo "getPID : $GETPID"
echo $GETPID > $PIDFILE
The $GETPID
variable is blank when this gets executed with monit. By hand it works perfectly.
Anyone have any ideas?