monit-general
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Restarting process based on log file match


From: Alain Kreienbuhl
Subject: Restarting process based on log file match
Date: Fri, 10 Oct 2014 17:29:05 +0200

Hello,

I'm try to restart a process based on a file match 

in the check file a added 
  start program = "/etc/init.d/my_service start"
  stop program = "/etc/init.d/my_service stop"
  
Somehow the start never really happened

[CEST Oct 10 17:09:35] info     : 'my_service-log' trying to restart
[CEST Oct 10 17:09:35] info     : 'my_service-log' stop: /etc/init.d/my_service
[CEST Oct 10 17:09:35] info     : 'my_service-log' start: /etc/init.d/my_service
[CEST Oct 10 17:10:35] error    : 'my_service' process is not running
[CEST Oct 10 17:10:36] info     : 'my_service' trying to restart
[CEST Oct 10 17:10:36] info     : 'my_service-log' stop: /etc/init.d/my_service
[CEST Oct 10 17:10:36] info     : 'my_service' start: /etc/init.d/my_service

I removed the start/stop program declaration and used 
exec "/etc/init.d/{{app[0]}} restart"
instead of 
restart 

Now I'm getting  process PID changed from 31350 to 31473  alert (with I can live with)

Is this the way to go ? 

Thanks 

Alain


reply via email to

[Prev in Thread] Current Thread [Next in Thread]