Operating System - HP-UX
1827294 Members
2057 Online
109717 Solutions
New Discussion

Re: Implementing rc start/stop scripts within Service Guard

 
SOLVED
Go to solution
Jack C. Mahaffey
Super Advisor

Implementing rc start/stop scripts within Service Guard

We have Service Guard implemented on two servers. The service guard stuff basically adds the IP, activates volume groups and does mounts.

What are the normal steps to add rc startup/shutdown scripts into the cluster startup/shutdown? Is it typical to include the steps in the normal /sbin/rc?.d/S* and /sbin/rc?-1.d/K* directories or would this information typically be in a cmcluster subdirectory or configuration file?

Any recommendations?

Thanks...

Jack...

8 REPLIES 8
Hai Nguyen_1
Honored Contributor

Re: Implementing rc start/stop scripts within Service Guard

Jack,

Shutdown/startup should now be handled by the cluster. Refer to the book "managing MC/ServiceGuard" for how to create a script for a package.

Hai
John Poff
Honored Contributor

Re: Implementing rc start/stop scripts within Service Guard

Hi Jack,

If you are talking about the scripts that would run when you start or stop a package, you'll find two sections in the package control file named 'customer_defined_run_cmds' and 'customer_defined_halt_cmds'. Put your stop and start commands in those sections and the package will execute them when you start and stop the package.

As for the rc scripts, you should have an /sbin/init.d/cmcluster script that will start and stop the MC/SG cluster during boot and shutdown. It should have the appropriate links in /sbin/rc2.d and /sbin/rc3.d to run the kill and start script. All this should be put in place automatically when you swinstall MC/SG.

JP
Massimo Bianchi
Honored Contributor

Re: Implementing rc start/stop scripts within Service Guard

Hi,
From your question it looks like you have not a clear concept of a "package" in HPUX... or am i wrong ?

However:


if you mean with rc start and stop script, the script used for starting your application, it's best practice (=compulsory) to create a directory under
/etc/cmcluster/DIR


put your control script there and whatever else is needed.

replicate this directory over the two nodes

create and apply the package

punt your custom commands in the customer_defined_start_function and customer_defined_halt_function

leaving the "test 51" and "test 52" there.


Start and stop script shall never be issued with start/stop of the server, they must be run from the cluster software, to avoid conflicts.


HTH,
Massimo
A. Clay Stephenson
Acclaimed Contributor

Re: Implementing rc start/stop scripts within Service Guard

You need to be careful here about exect meaning. The CLUSTER startup scripts should already be installed in the rc directories and there is a configuration file "cmcluster" in /etc/rc.config.d. These files are automatically installed during the MC/SG swinstall. You set the AUTOSTART_CMCLD value in the config file to 1 to have this node automatically join the cluster.

All other PACKAGE related startup/shutdown routines (including VG activation) should be handled by the package control scripts.

The other startup/shutdown file that will need some attention is /etc/lvmrc. You should set AUTO_VG_ACTIVATE=0 and then include explicit vgchange statements for the VG's (other than vg00) which are NOT under the control of a package.
If it ain't broke, I can fix that.
Jack C. Mahaffey
Super Advisor

Re: Implementing rc start/stop scripts within Service Guard

Massimo...

Do the start/stop scripts get placed before or after the test_return 51 / test_return 52?

Is it also best practice to create a single file with links for the start/stop arguments like /sbin/rc3.d/S... ?

I would have files/links something like
/etc/cmcluster/PACKAGENAME/informix
/etc/cmcluster/PACKAGENAME/S100informix
/etc/cmcluster/PACKAGENAME/K900informix.

The start/stop arguments would be passed to the links.

I would likely prefer to put the S*, K* links in rc subdirectories to be consisent with /sbin/rc?.d.


Thanks all.

I'll be assigning points shortly.

jack...


Jack C. Mahaffey
Super Advisor

Re: Implementing rc start/stop scripts within Service Guard

Clay, thanks for the additional info. Everything is properly set, e.g. /sbin/rc3.d/S800cmcluster with the exception of starting/stopping some background applications since the server was originally configured. It looks like some of the background processes were started as separate /sbin/rc3.S* links and some were manually started. I'd like to see about configuring the cluster to do all the starts/stops that rely on the cluster package within the cluster package.


Thanks to all..
Massimo Bianchi
Honored Contributor
Solution

Re: Implementing rc start/stop scripts within Service Guard

Hi,
start and stop are to be placed *before* the test 51 and 52.


These values are used to test the correctness of your scripts, examining the return code of the last command.


Pay attention in using commands inside remsh, because the return code of the remsh is 0 if the remsh works, 1 the other ways, and it takes in no consideration the command itself.

Massimo

Massimo Bianchi
Honored Contributor

Re: Implementing rc start/stop scripts within Service Guard

Hi,
for the links: i prefer to create the script in the /etc/cmcluster/PACKAGENAME, and keep them aligned.

If you rely on the system part of the cluster, sooner or later someone will change this file on one server and not on the other, and it will be hard to understand.


If you use only the scripts in the /etc/cluster/*, it is easier to keep them on-line, and when you work with a cluster, specularity it a must.


HTH,
Massimo