monit-general
[Top][All Lists]
Advanced

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

Re: Rapid stop/start problem in Monit 4.8


From: Martin Pala
Subject: Re: Rapid stop/start problem in Monit 4.8
Date: Fri, 16 Feb 2007 20:04:20 +0100
User-agent: Mozilla/5.0 (X11; U; Linux i686; en-US; rv:1.8.0.9) Gecko/20061219 Iceape/1.0.7 (Debian-1.0.7-2)

Hi,

i think you should try the monit 4.9-beta1 (which will be release as final 4.9 next week).

The http interface of monit <= 4.8.1 may block when you call for example stop method, until the program is stopped or the method timed out.

The mechanism was changed in 4.8.2 (i recommend 4.9-beta1, since it has many important fixes).

Martin



David Fletcher wrote:
Hi,

I have a script which worked well with Monit 4.4, but has stopped working
with Monit 4.8. The script copies a backup database into the MySQL data
directories by stopping the MySQL server, copying the data, and then
restarting. Previously this worked, but after upgraded of Monit the
MySQL process does not re-start.

Here is an example of the script which fails, and a fixed version:
-----------------------------------------------------------------------
#!/bin/sh
/usr/local/bin/monit stop mysql
#Code to copy back-up into data directory here
#Backup script
#Backup script
/usr/local/bin/monit start mysql
--------------------------------------------------------------------

The addition of 'sleep' makes it work:
-----------------------------------------------------------------------
#!/bin/sh
/usr/local/bin/monit stop mysql
#Code to copy back-up into data directory here
#Backup script
#Backup script
sleep 5
/usr/local/bin/monit start mysql
--------------------------------------------------------------------

The second version works, but why is this now required? The first version
used to work. Did Monit change the way it handles stop/start? Copying
the database only takes 1-2 seconds. Monit returns, and the rest of the
script completes in both cases. Checking /var/log/messages shows for
this first script:

Feb 16 09:47:56 server monit[22956]: monit daemon at 21711 awakened
Feb 16 09:47:56 server monit[21711]: Awakened by User defined signal 1
Feb 16 09:47:56 server monit[21711]: 'mysql' stop: /etc/rc.d/mysqld
Feb 16 09:47:58 server monit[22956]: monit daemon at 21711 awakened
Feb 16 09:47:59 server monit[21711]: Awakened by User defined signal 1

But the 'mysql' start line is missing.

Here is my MySQL section from monitrc:

 set daemon  120           # Poll at 120 sec (2-minute) intervals
 check process mysql with pidfile /usr/local/mysql/data/server.pid
        group www
        start program = "/etc/rc.d/mysqld start"
        stop program = "/etc/rc.d/mysqld stop"
        #if failed host localhost port 3306 then restart
        if failed unixsocket /tmp/mysql.sock protocol mysql timeout 20
seconds then restart
        if 5 restarts within 5 cycles then timeout

Thanks for any help,

David.

-----------------------------
address@hidden
-----------------------------


--
To unsubscribe:
http://lists.nongnu.org/mailman/listinfo/monit-general




reply via email to

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