Bug #29848 | Init.d scripts missing LSB compliant 'status' command | ||
---|---|---|---|
Submitted: | 17 Jul 2007 15:52 | Modified: | 3 Mar 2009 16:31 |
Reporter: | Harrison Fisk | Email Updates: | |
Status: | Closed | Impact on me: | |
Category: | MySQL Enterprise Monitor: Installing | Severity: | S4 (Feature request) |
Version: | 1.1.1, 2.0 | OS: | Linux |
Assigned to: | MC Brown | CPU Architecture: | Any |
Tags: | init.d, LSB, startup |
[17 Jul 2007 15:52]
Harrison Fisk
[24 Jul 2007 17:48]
Andy Bang
Keith, I've forwarded your proposal to Harrison. Please check in with him, and also with Jan since I think he did the initial script. Thanks, Andy
[24 Jul 2007 18:15]
Harrison Fisk
Patch to add status to etc/init.d/mysql-service-agent
Attachment: initd-status-patch.diff (text/x-patch), 1.08 KiB.
[24 Jul 2007 18:39]
Harrison Fisk
I have attached a patch to add the status option to the service agent init.d script. I'm working on a patch for the mysqlnetworkctl.sh file, but it is a bit more involved, due to the fact that tomcat doesn't write a PID right now.
[24 Jul 2007 20:24]
Harrison Fisk
Patch to add status to mysqlservicectl.sh
Attachment: initd-mysqlnetworkctl.diff (text/x-patch), 2.99 KiB.
[24 Jul 2007 20:26]
Harrison Fisk
The second patch adds status support to mysqlnetworkctl.sh. It also makes tomcat create a pid-file as apache-tomcat/temp/catalina.pid It will need to be changed to allow it to change automatically based on the installation directory during the installer.
[25 Jul 2007 15:31]
Harrison Fisk
Customer has confirmed that both of these status options appear to work fine with Red Hat Cluster suite.
[25 Jul 2007 17:22]
Peter Lavin
These patches will be applied to version 1.2 as well, correct? Version 1.2.0.6782 of the service agent doesn't have a status option.
[25 Jul 2007 21:43]
Harrison Fisk
mysqlnetworkctl.sh patch against 1.2.6801
Attachment: patch.against.1.2.6801.diff (text/x-patch), 1.08 KiB.
[25 Jul 2007 21:43]
Harrison Fisk
The last patch removes all of the apache support and fixes the tomcat status problem against 1.2.6801.
[31 Jul 2007 3:24]
Keith Russell
Patch installed in versions => 1.2.0.6839
[17 Dec 2007 12:12]
Carsten Segieth
tested OK with 1.3.0.8528: new option 'status' works for both server and agent, for the agent both with and without specifying an .ini file.
[17 Dec 2007 16:58]
Peter Lavin
Added to the changelog for version 1.2. Documented as follows: On Unix systems, the start up scripts for the agent and for the service manager, mysql-service-agent and mysqlmonitor.sh (formerly mysqlnetworkctl.sh) respectively, were not LSB compliant; both lacked a status option. You can now check the status of the agent or the service manager by passing in a status argument.
[8 May 2008 16:11]
Matthew Lord
Here's a patch that makes the init script work with heartbeat v2: diff -u /opt/mysql/enterprise/agent/etc/init.d/mysql-service-agent /etc/init.d/mysqlsa-initscript --- /opt/mysql/enterprise/agent/etc/init.d/mysql-service-agent 2008-05-08 12:10:29.000000000 -0400 +++ /etc/init.d/mysqlsa-initscript 2008-05-08 11:18:59.000000000 -0400 @@ -46,10 +46,10 @@ # # Use LSB init script functions for printing messages, if possible # -#lsb_functions="/lib/lsb/init-functions" -#if test -f $lsb_functions ; then -# source $lsb_functions -#else +lsb_functions="/lib/lsb/init-functions" +if test -f $lsb_functions ; then + . $lsb_functions +else log_success_msg() { echo " SUCCESS! $@" @@ -58,7 +58,7 @@ { echo " ERROR! $@" } -#fi +fi # Override defaults, if we have the sysconfig file test -f /etc/sysconfig/mysql-service-agent && . /etc/sysconfig/mysql-service-agent @@ -169,23 +169,23 @@ ## pid-file exists, check if the process is still up if kill -0 `cat $MERLIN_AGENT_PID` 2> /dev/null; then ## program is running fine - echo "$MERLIN_AGENT_PSERVICE is running" + log_success_msg "$MERLIN_AGENT_PSERVICE is running" exit 0 else ## does the lock file exist if test -f "/var/lock/subsys/$MERLIN_AGENT_SERVICE" ; then ## program not running, but lock file exists - echo "$MERLIN_AGENT_PSERVICE is not running, but lock file exists" + log_failure_msg "$MERLIN_AGENT_PSERVICE is not running, but lock file exists" exit 2 else ## program not running, pid-file exists, but no lock file - echo "$MERLIN_AGENT_PSERVICE is not running, but pid-file exists" + log_failure_msg "$MERLIN_AGENT_PSERVICE is not running, but pid-file exists" exit 1 fi fi else - echo "$MERLIN_AGENT_PSERVICE does not appear to be running" - exit 4 + log_failure_msg "$MERLIN_AGENT_PSERVICE does not appear to be running" + exit 3 fi ;; start) @@ -225,15 +225,15 @@ daemon_pid=`cat $MERLIN_AGENT_PID` echo $echo_n "Shutting down $MERLIN_AGENT_PSERVICE service..." kill $daemon_pid - wait_for_pid remove + wait_for_pid remove; return_value=$? # delete lock for RedHat / SuSE if test -f "/var/lock/subsys/$MERLIN_AGENT_SERVICE" ; then rm -f "/var/lock/subsys/$MERLIN_AGENT_SERVICE" fi + exit $return_value else log_failure_msg "$MERLIN_AGENT_PSERVICE PID file could not be found!" - exit 1 fi ;; restart)
[11 Aug 2008 12:36]
Kay Roepke
Both status and force-reload are in the 2.0 init script now. The exit codes are like required by LSB as described at http://refspecs.freestandards.org/LSB_3.1.0/LSB-Core-generic/LSB-Core-generic/iniscrptact
[2 Mar 2009 17:13]
Diego Medina
Verified fixed on 2.0.5.7146 $ /Applications/mysql/enterprise/agent/etc/init.d/mysql-monitor-agent status ; echo "result: $?" MySQL Enterprise agent does not appear to be running result: 3
[3 Mar 2009 16:31]
Tony Bedford
An entry was added to the 2.0.5 changelog: The startup scripts supplied with MySQL Network Monitoring and Advisory tool did not supply all of the LSB init.d script options required. A list of the required options can be found at the following website http://refspecs.freestandards.org/LSB_3.1.0/LSB-Core-generic/LSB-Core-generic/iniscrptact.... The required options missing include status and force-reload. The option status is used by monitoring tools and cluster software such as Red Hat Cluster, to ensure that the service is still running. The force-reload option is an alias for restart.
[21 Jul 2010 14:34]
Leandro Morgado
http://bugs.mysql.com/bug.php?id=55404 is related to this one.