Operating System - HP-UX
1833767 Members
2692 Online
110063 Solutions
New Discussion

Serviceguard - how to stop existing package on failover

 
SOLVED
Go to solution
Adam Noble
Super Advisor

Serviceguard - how to stop existing package on failover

Hi all,

I'm a bit rusty with service-guard but seem to remember this was a relatively simple solution.

I have a production and development server each have a single package. All I want to do is ensure that when a failover occurs from production the dev servers package shuts down 1st. Is this a policy I configure within the packages or do I simply call the appropriate SG command within the startup process.

Cheers
5 REPLIES 5
Ivan Krastev
Honored Contributor

Re: Serviceguard - how to stop existing package on failover

You can add custom SG commands in the package control script to stop the second (DEV) package.
See more here - http://docs.hp.com/en/B3936-90100/ch06s02.html

regards,
ivan
Stephen Doud
Honored Contributor

Re: Serviceguard - how to stop existing package on failover

Current versions of Serviceguard do not automate package shutdown due to priority and package weights.

Therefore, it is necesary to script a test into the package control script to shutdown the dev package should the production package find it running.

Re: Serviceguard - how to stop existing package on failover

Adam,

If you have full ITRC knowledge base access, take a look at this KB article which might help:

http://www13.itrc.hp.com/service/cki/docDisplay.do?docLocale=en&docId=emr_na-c01182371-1

HTH

Duncan

I am an HPE Employee
Accept or Kudo
Rita C Workman
Honored Contributor

Re: Serviceguard - how to stop existing package on failover

At or near the top of your PRODUCTION package control script add this line:

/usr/sbin/cmhaltpkg -n $(/usr/bin/uname -n)

Now copy this over to your Dev box, like you would do normally for any change to your .cntl file.

So if your Prod pkg fails over the first thing it will do is look and see if on that box (now the Dev box) it is running the Dev-pkg - halt it.
Relax, you can stop & restart the prod pkg running on the prod box and it won't hurt dev.

Is that simple enough......got this from a former HP employee Ed Jones.

Regards,
Rita
Stephen Doud
Honored Contributor
Solution

Re: Serviceguard - how to stop existing package on failover

To match Rita's solution to your request ie. halt the dev package if the production package starts on the development server, the command to halt the dev package should be preceded by a check for the node on which the script is starting, such as
HN=`uname -n`
if [ $HN = ] ; then
/usr/sbin/cmhaltpkg -n $HN
fi