Bug #34123 Agent is not auto-started on reboot on all platforms
Submitted: 29 Jan 2008 3:43 Modified: 3 Jun 2010 18:22
Reporter: Andy Bang Email Updates:
Status: Closed Impact on me:
None 
Category:MySQL Enterprise Monitor: Installing Severity:S3 (Non-critical)
Version:1.3.0.8836 OS:Any
Assigned to: BitRock Merlin CPU Architecture:Any

[29 Jan 2008 3:43] Andy Bang
Description:
If you install as root, the agent installer configures the agent to be auto-started on reboot, but only on Windows (as a service) and non-Debian Linux distros (using chkconfig).  It should be configured to auto-start on as many platforms as possible.

How to repeat:
Either install the agent and observe whether or not the agent is installed as a service, or review the logic in the mysql-service-agent.xml BitRock project file.

Suggested fix:
1) Use the native service installer to configure the agent to auto-start on reboot on the following platforms (in addition to the ones already supported):

     AIX 5.2
     FreeBSD 6
     HP-UX
     Linux - Debian distros
     Mac OS X
     Solaris 8, 9, & 10

Please let us know if it would be difficult or impossible to support this on some of these platforms.

2) If the user has NOT installed as root, display the following text at the end of installation:

"You have not installed the MySQL Service Agent as the root user.  Therefore it could not be configured to auto-start on reboot.  See the Installation section of the MySQL Enterprise Monitor documentation for instructions on how to do this manually."

3) Peter, I think we need to slightly beef up the documentation in this regard.  Section 3.4.6. Starting and Stopping the Agent on Unix in the documentation currently says:

"If you installed the agent as an unprivileged user, you must manually start the agent on reboot or write a script to perform this task. To determine whether the agent is running or not navigate to the init.d directory and issue the command ./mysql-service-agent status."

Since we provide a reasonable init.d file, I think an extra sentence or two about copying ${installdir}/etc/init.d/mysql-service-agent to /etc/init.d/mysql-service-agent, and then running chkconfig, update-rc.d, etc., is warranted.
[4 Feb 2008 20:16] Andy Bang
It's too late in the 1.3 release cycle for this, so we'll get this done in the 2.0
release.
[14 Oct 2008 17:24] BitRock Merlin
Patch for Debian, RPM, OS X and Solaris platforms sent to Keith.
[15 Oct 2008 18:53] Keith Russell
Patch applied in versions => 2.0.0.7076.
[11 Nov 2008 11:15] BitRock Merlin
Patch for the Item #2 in the comment on [29 Jan 4:43] sent to Keith.
[12 Nov 2008 15:40] Keith Russell
Patch applied in build versions => 2.0.0.7094.
[12 Oct 2009 14:46] Keith Russell
Hi Andy,

Yes, the update that had this mod was installed.  It came in two different updates.  One on Oct. 14, and one on Nov. 11, 2008. It involved the install builder and xml as well as language files therefore unless the mods were specifically backed out, any subsequent updates would contain them also.

mysql-monitor-agent.xml
mysql-monitor-agent-jp.lng
mysql-monitor-agent-en.lng
installbuilder-enterprise-5.4.13-linux-x64-installer.bin

I noticed in the bug 'progress log' that it shows no record of ever being moved from 'qa testing' to 'documenting' or 'closed'.

The comments in the notification/links emails from Bitrock are included below.

Keith

***** comments from email Oct 14 start ****************
We have tested on Debian platforms, RPM based platforms and OS X but we could no test on Solaris (Intel or Sparc) because we could not execute the binaries. We are working with the 0.7.0.6002 version and these are the errors:

Solaris-Intel:
Error running /opt/mysql/enterprise/agent/bin/mysql-monitor-agent
--defaults-file=/opt/mysql/enterprise/agent/etc/mysql-monitor-agent.ini
--plugins=agent --agent-generate-uuid=true : 2008-10-14 17:17:22: (critical)
Conversion from character set '646' to 'UTF-8' is not supported
2008-10-14 17:17:22: (message) shutting down normally

Solaris-Sparc:
2008-10-14 16:32:29: (critical) chassis-mainloop.c:240: event_base_dispatch() failed: Invalid argument (22)

We believe this is an error from your agent.

About the OS X service installation we have some comments. We have checked the implemented solution and the agent is restarted when the machine is rebooted. The user can start/stop the service with the <installation_directory>/etc/init.d/mysql-monitor-agent script. The problem is that the administrator can not manage the service with the "launchctl" administrator tool. This happens because it is necessary that the script does not finish, I mean the script runs as a daemon. Please let us know if the implemented solution is valid for you.

As a next step for AIX, FreeBSD and HPUX we would need from you detailed documentation on what exact steps need to be done to install the agent as a service, so we can implement them in the installer. 

*****  comments from email Oct. 14 end - Nov 11 start *****************

#34123 Agent is not auto-started on reboot on all platforms. Display the following text at the end of the installation if the user has not installed as root:

"You have not installed the MySQL Service Agent as the root user.  Therefore it could not be configured to auto-start on reboot.  See the Installation section of the MySQL Enterprise Monitor documentation for instructions on how to do this manually."

Both sentences have been included in the English and the Japanese language files. Please let us know if you modify the Japanese files to update them on our side. 
*****  comments from email Nov. 11 end  *****************