Operating System - HP-UX
1758588 Members
1795 Online
108872 Solutions
New Discussion юеВ

ServiceGuard Package Dependencies

 
SOLVED
Go to solution
Bruce Owen Lee
Occasional Advisor

ServiceGuard Package Dependencies

I need to shutdown several packages on another node before a package from yet another node starts (it uses the same mount points) on that node. Can I use package dependencies to do this? I other words, pkg A fails on node 1 and fails to node 2. Node 2 has pkg's C, D and E running and need to be halted before pkg A starts on node 2. How do I do this?

BTW: HP-UX 11.31 w/SG 11.18 Integrity SuperDome
6 REPLIES 6
Steven E. Protter
Exalted Contributor

Re: ServiceGuard Package Dependencies

Shalom,

For simplicity, I would build a single package that does multiple things.

Example.

If daemonA and daemonB must run on the same system, they should be in the same package.

There is nothing in Service Guard that prevents you from calling a script that starts two services.

That would be my approach.

SEP
Steven E Protter
Owner of ISN Corporation
http://isnamerica.com
http://hpuxconsulting.com
Sponsor: http://hpux.ws
Twitter: http://twitter.com/hpuxlinux
Founder http://newdatacloud.com
Greg Vaidman
Respected Contributor
Solution

Re: ServiceGuard Package Dependencies

Bruce,
I used to implement such functionality in earlier versions of MCSG with code such as the following in the package start script (running before the LVM stuff in the script):

cmviewcl -n `hostname` -p pgkC | grep -i running &&
cmhaltpkg -n `hostname` -p pkgC

(repeat for pkgD & pkgE)

I'm not in front of an MCSG box now, so please check my syntax, but I think it's pretty close.
Bruce Owen Lee
Occasional Advisor

Re: ServiceGuard Package Dependencies

Thanks Greg, that did the trick. BTW: the -n and -p options are mutually exclusive in SG 11.18 it worked well enough with just the following:

cmviewcl -p Prod_cup1 | grep running && cmhaltpkg -p Depl_usp1

I placed the code just before the volume group activation in the "start" section of the control script.
Bruce Owen Lee
Occasional Advisor

Re: ServiceGuard Package Dependencies

See last posting for solution.
Greg Vaidman
Respected Contributor

Re: ServiceGuard Package Dependencies

Bruce,
Be careful with that syntax - without the check that the package is running on a specific node, you could be shutting down packages pkgC, pkgD & pkgE running on another node. You may need to do extra parsing of the output if the -n and -p options are indeed mutually exclusive.
--Greg

Re: ServiceGuard Package Dependencies

Whilst the items mentioned will work, I susepct the "correct" way to do this in 11.18 is using package dependencies and package priorities that are available with modular packages:

http://docs.hp.com/en/B3936-90122/ch04s08.html#cihfgeaj

I haven't tried this myself yet, but it should be possible to setup the configuration you require with no special start/stop code (unfortunately all the examples are for dependencies on packages being *running*, not on them being *down*)

HTH

Duncan

I am an HPE Employee
Accept or Kudo