monit-general
[Top][All Lists]
Advanced

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

[monit] My 'best practice' for init.d and monit


From: Jason L. Buberel
Subject: [monit] My 'best practice' for init.d and monit
Date: Thu, 13 Mar 2008 10:35:57 -0700
User-agent: Thunderbird 2.0.0.12 (X11/20080227)

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

reply via email to

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