Bug #36568 Adjust Init Start/Stop Script to Start Multiple Agents on the Same Server
Submitted: 7 May 2008 17:29
Reporter: Chris Calender
Status: Verified
Category:Monitoring: Agent Severity:S4 (Feature request)
Version:All OS:Any
Assigned to: Jan Kneschke Target Version:
Tags: mem, start script, stop script, init script, multiple agents, start multiple agents
Triage: D5 (Feature request) / R2 (Low) / E2 (Low)

[7 May 2008 17:29] Chris Calender
Description:
Please add a feature so that multiple agents are supported with the automatically
deployed init script.

With MEM an init script is added to the system to start the agent.

The documentation mentions how multiple agents can be configured on a server and how to
start them.  However no init script is created for this situation and indeed only the
"main" agent is started.

We have a development server which runs about 10 instances and after rebooting none of
the agents are restarted.

We use config file names such as
/opt/mysql/enterprise/agent/etc/mysql-service-agent.<instance_name>.ini

It would be very convenient if the init script started ALL instances rather than the
default one with the
/opt/mysql/enterprise/agent/etc/mysql-service-agent.ini file.

How to repeat:
N/A

Suggested fix:
N/A
[8 Jun 21:21] Kay Roepke
I cannot see how this should work.
The init.d script cannot guess the naming scheme of the config files reliably, and it is
a very simple change to the init.d script to make it work today.
[8 Jun 22:54] Simon Mudd
Please first if you are going to support multiple instances running on the same server at
the same time, and if you wish that these instances are started at the same time when the
system is started.

If you want this I would suggest something like the oracle /etc/oratab (see
http://www.orafaq.com/faq/what_is_oratab_and_what_is_it_used_for) file which basically
has something to name an agent instance, it's path, the user to use and then whether it
should be started on boot or not.

Then make the system start stop script use this file to determine which individual
instances should be started.

The agent installers would then add an entry to the /etc/"merlintab" file if the entry
does not exist. It would also allow you to start or stop an agent by name rather than
having to worry about a full path to the local init script.

You could even adjust this concept so that if the installer is run from a non-root
account a $HOME/etc/"merlintab" would be used instead, thus maintaining a consistent
behaviour.

The "global" init script would then be used as 

whatevername start
whatevername status
whatevername stop
whatevername restart

all of these commands working on all "active" instances, but taking an optional "agent
instance name" which would only affect the given name.

You could make the names start at merlin1, merlin2, .... unless some installation
parameter is used to define a specific agent instance name.

This would be me functional description of what would be useful.