On 14 Oct 2014, at 11:18, Alainkr <[email protected]> wrote:
> Martin Pala wrote
>> If i understand you corrently, you wanted CLI to not return before the
>> action is done by Monit?
>
> Thinking about it there's 2 aspect to it :
>
> (1) Wait until invocation of the "stop program" returns
> (2) Wait until the PID as specified in the pid file finishes
>
> both are interesting. My primary need was for (1).
Monit 5.9 uses both steps for start/stop/restart programs - unline the "exec"
action in the test rule, which returns immediately and lets the program finish
on the background.
I recommend to modify the configuration like this:
--8<--
check file myappcol-log with path /home/myappcol/tomcat/logs/catalina.out
mode manual
group myappcol
depends on myappcol
if match "ERROR" then alert
if match "ERROR" for 10 cycles then unmonitor
if match "OutOfMemoryError" then exec '/usr/bin/monit restart myappcol'
# note: this restarts the myappcol service via monit (fix the monit path if
not present in /usr/bin/)
--8<--
Regards,
Martin
--
To unsubscribe:
https://lists.nongnu.org/mailman/listinfo/monit-general