monit-dev
[Top][All Lists]
Advanced

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

Re: monit '-i' option?


From: Martin Pala
Subject: Re: monit '-i' option?
Date: Tue, 16 Sep 2003 07:38:10 +0200
User-agent: Mozilla/5.0 (X11; U; Linux i686; en-US; rv:1.4) Gecko/20030908 Debian/1.4-4

Jan-Henrik Haukeland wrote:

Jan-Henrik Haukeland <address@hidden> writes:
Are there other solutions, preferably simple? I know to little about
init, but can something be done there? I'm not thinking about e.g to
start monit in the last run level and stuff like that because that is
just a poorer variant of using the -i switch in monit.

The other solution could be, to modify startup rc scripts of critical services to block until the service will be realy up or timeout will occure. This can solve the problem too, because init wait for rc script (which starts particular runlevel scripts) to terminate:

id:2:initdefault:
...
l2:2:wait:/etc/init.d/rc 2
...
mo:2345:respawn:/usr/local/bin/monit -Ic /etc/monitrc

As you can see, init waits until rc will finish its work and then starts other services (such as monit). If you add monit behind rc in inittab and modify critical services's rc scripts to not return until they are realy running or broken, you can reach the requested behavior too + the race condition will not occure. The only problem with this solution is the *broken* case - monit will detect that the service is not running on its own (which will not occure in the case that the services are started from monit directly as explained earlier). This solution requires also modification of all rc scripts for "slow" critical services.

Conslusion: this is another option, where no race condition will occure - on the other hand it is less comfortable and practical then '-i' option and then starting services from monit directly as well (more work) - in addition it is less secure in the broken case.

In the case that the services are realy critical (such as database, which could be in recovery stage that can take very long time), it is better and more secure for it to use monit to start it unless you are monitoring this service in passive mode. This can prevent recovery interruption.

I think in the case that -i option will be re-added, we should mention the problem and recommend to start services from monit. If these services are not critical, '-i' option could be practical choice.

I'll keep my votes (+0 for extended '-i' and -1 for original implementation).

Martin














reply via email to

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