Bug #43803 mysqlmonitorctl.sh stop should wait until mysqld stops before exiting
Submitted: 23 Mar 2009 12:38 Modified: 22 May 2009 8:43
Reporter: Diego Medina Email Updates:
Status: Closed Impact on me:
None 
Category:MySQL Enterprise Monitor: Installing Severity:S3 (Non-critical)
Version:2.0.5.7153 OS:Any
Assigned to: MC Brown CPU Architecture:Any

[23 Mar 2009 12:38] Diego Medina
Description:
n *unix systems, executing 

./mysqlmonitorctl.sh stop  does not make sure that mysqld is really shutdown
before finishing.

You can end up with s situation like this:

# /opt/mysql/enterprise/monitor-2.0.0.7092/mysqlmonitorctl.sh stop
Using CATALINA_BASE:   /opt/mysql/enterprise/monitor/apache-tomcat
Using CATALINA_HOME:   /opt/mysql/enterprise/monitor/apache-tomcat
Using CATALINA_TMPDIR: /opt/mysql/enterprise/monitor/apache-tomcat/temp
Using JRE_HOME:       /opt/mysql/enterprise/monitor-2.0.0.7092/java
Stopping tomcat service ... [ OK ]
/opt/mysql/enterprise/monitor-2.0.0.7092/mysqlmonitorctl.sh : mysql stopped

and after a few minutes, I run this:

# /opt/mysql/enterprise/monitor-2.0.0.7092/mysqlmonitorctl.sh status
MySQL Network MySQL is running
MySQL Network Tomcat is not running

Note that the MySQL server is still running.

How to repeat:
1- install the service manager and agent and start them
2- Use the app for about 2-3 hours (the heavier the load, the more chances you will see
this behavior.
3- execute ./mysqlmonitorctl.sh stop
4- execute ./mysqlmonitorctl.sh status

Suggested fix:
Apply the same fix as in http://bugs.mysql.com/bug.php?id=40654
[23 Mar 2009 15:46] BitRock Merlin
Should this issue be fixed for 2.0 and 2.1 versions? Please specify the target version.
[24 Mar 2009 23:17] Andy Bang
Please fix in both 2.0 and 2.1.
[26 Mar 2009 9:13] BitRock Merlin
Patch sent to Keith.
[2 Apr 2009 19:32] Diego Medina
Verified fixed on 2.1.0.1022
[6 Apr 2009 19:07] Diego Medina
Verified fixed on 2.0.6.7158 as well
[22 May 2009 8:43] Tony Bedford
An entry was added to both the 2.0.6 and 2.1.0 changelogs:

On Unix systems, executing the command:

./mysqlmonitorctl.sh stop

did not make sure that mysqld was shutdown before finishing.

This resulted in a situation such as the following:

# /opt/mysql/enterprise/monitor-2.0.0.7092/mysqlmonitorctl.sh stop
Using CATALINA_BASE:   /opt/mysql/enterprise/monitor/apache-tomcat
Using CATALINA_HOME:   /opt/mysql/enterprise/monitor/apache-tomcat
Using CATALINA_TMPDIR: /opt/mysql/enterprise/monitor/apache-tomcat/temp
Using JRE_HOME:       /opt/mysql/enterprise/monitor-2.0.0.7092/java
Stopping tomcat service ... [ OK ]
/opt/mysql/enterprise/monitor-2.0.0.7092/mysqlmonitorctl.sh : mysql stopped

However, running the following command a few minutes later showed that the MySQL server was still running:

# /opt/mysql/enterprise/monitor-2.0.0.7092/mysqlmonitorctl.sh status
MySQL Network MySQL is running
MySQL Network Tomcat is not running