Thanks Martin.
With verbose mode, I was able to see that monit was complaining about
missing "stop program" in the config file.
Got around the error and added a new script to handle start/stop of the
process. Still, its failing to restart.
Here is corresponding log entry:
===
[CST Dec 6 08:39:41] debug : 'whileTest' Error testing process id
[8075] -- No such process
[CST Dec 6 08:39:41] error : 'whileTest' process is not running
[CST Dec 6 08:39:41] info : 'whileTest' trying to restart
[CST Dec 6 08:39:41] debug : 'whileTest' Error testing process id
[8075] -- No such process
[CST Dec 6 08:39:41] debug : 'whileTest' Error testing process id
[8075] -- No such process
[CST Dec 6 08:39:41] info : 'whileTest' start: /tmp/monit.sh
[CST Dec 6 08:39:41] debug : 'whileTest' Error testing process id
[8075] -- No such process
[CST Dec 6 08:39:42] debug : 'whileTest' Error testing process id
[8075] -- No such process
[CST Dec 6 08:40:18] error : 'whileTest' failed to start
===
*
*
*Script:*
RETVAL=0
modulename="/tmp/whileTest"
start() {
cnt=$(ps -T | grep -c $modulename 2>/dev/null)
if [ $cnt -le 1 ] ; then
$modulename &
else
echo "$modulename already running"
echo
fi
return $RETVAL
}
stop() {
pkill -f "$modulename "
}
case "$1" in
start)
start
;;
stop)
stop
;;
esac
exit $?
--
To unsubscribe:
https://lists.nongnu.org/mailman/listinfo/monit-general