Davikar,

Your question/problem reminded me of the solution that I have adopted for invoking /etc/init.d/servicefoo scripts from monit.

In general, I make sure that all of our init.d scripts have three targets:

start:
- Performs normal service startup, using full pathnames, etc.

stop
- Performs 'monit unmonitor servicefoo'
- Performs normal service shutdown

monitstop
- Performs normal service shutdown

Inside of monitrc:

start - '/etc/init.d/servicefoo start'
stop -  '/etc/init.d/servicefoo monitostop'

What this combination does is it allows me to type '/etc/init.d/servicefoo stop' without having to worry about monit immediately restarting the service behind my back :)

And when monit needs to stop a service (by invoking 'monit stop servicefoo') it will not also accidentally unmonitor the service.

Hope this helps,
jason
--
To unsubscribe:
http://lists.nongnu.org/mailman/listinfo/monit-general

Reply via email to