1831636 Members
1715 Online
110027 Solutions
New Discussion

Service Guard question

 
Mike Duffy
Frequent Advisor

Service Guard question

Hello,

How do you stop service guard starting a package when the system halts. We have two packages and would like one to start and the other not to when the system is rebooted.
4 REPLIES 4
James R. Ferguson
Acclaimed Contributor

Re: Service Guard question

Hi Mike:

You would control this in your package control script [no pun intended]. This file should be:

# /etc/cmcluster//.cntl

Regards!

...JRF...
Brian M Rawlings
Honored Contributor

Re: Service Guard question

Mike: depending on the release of MC/SG you are running, there is a parameter in the package configuration file to enable or disable automatic startup of the package.

In older versions this was the poorly named variable "PKG_SWITCHING_ENABLED". In the current version, the parameter name is the much improved "AUTO_RUN". See below for an excerpt from the explanatory note in the package configuration file template:

...
# Enter the value for AUTO_RUN. Possible values are YES and NO.
# The default for AUTO_RUN is YES. When the cluster is started the
# package will be automaticaly started. In the event of a failure the
# package will be started on an adoptive node. Adjust as necessary.
#
# AUTO_RUN replaces obsolete PKG_SWITCHING_ENABLED.

AUTO_RUN YES
...

Regards, --bmr
We must indeed all hang together, or, most assuredly, we shall all hang separately. (Benjamin Franklin)
Martin Johnson
Honored Contributor

Re: Service Guard question

You can ue "cmmodpkg -d" to disable AUTO_RUN on a package. See man cmmodpkg.


HTH
Marty
Stephen Doud
Honored Contributor

Re: Service Guard question

Hey Mike,

To review, you want to prevent a particular package from failing over to a standby node when you shutdown the node. The shutdown scripts invoke /sbin/init.d/cmcluster, which essentially performs a cmhaltnode (causing packages to failover).

To override the package failover temporarily, perform a cmmodpkg -d

To override it permanently, you may want to either create a new script in /sbin/init.d/ that will do the following:
a) only be run when shutting down
(see
/sbin/rc2.d/K002cmcluster -> /sbin/init.d/cmcluster
b) disable package switching such as above

Or you can create a wrapper script for the 'shutdown' command that performs the cmmodnet command above before issuing the real shutdown command.

-s.