Operating System - HP-UX
1832242 Members
2943 Online
110041 Solutions
New Discussion

Re: Halting a service to work with package

 
SOLVED
Go to solution
Stefan Saliba
Trusted Contributor

Halting a service to work with package

I have an idea of how to handle a situation in SG but I am not sure it will work.

The problem is this. I have a package which when it starts, activates a VG and starts some processes. A service also starts with this package to monitor that these processes are infact running in memory, and if they do not it will failover to the other node. Pretty much the normal stuff.

The problem is this. There is a point when I would need to stop these prcoesses to run some scripts, BUT if I do this the service will notice that the program is not running and will de-activate the VG to go to the other node.

I do not want this, I tought that if I de-activate the service using cmhaltserv then the I can safely stop the prcesses without having the package going down.

Am I correct about this, can I do this then run the service and programs after when I am ready ?

Any help is welcome


5 REPLIES 5
melvyn burnard
Honored Contributor

Re: Halting a service to work with package

running the cmhaltserv command from the command line is NOT supported. It is only meant to be run by the package scripts, not a user.

To do what you are trying to do, you need to create some form of "maintenace Flag".

Simple example is where your user portion of the startup script does a check for a file, if it is there, it still does alll the file system activation etc, but does NOT start your application.
To then go into "maintenance mode" simply crreate the file you are looking for by using touch command.


When finished remove the file and halt/start the package again.


Another way is to have an infinite loop start up if it finds a file, which will start th epackage again, but not actually start the application, as it enters the loop and stays there if it finds the "flag". when finished, remove the flag, the loop detects the flag has gone, and now your package will start to completion.

This, by the way, is discussed in eth MC/ServiceGuard II course taught by HP Education
My house is the bank's, my money the wife's, But my opinions belong to me, not HP!
Nick Wickens
Respected Contributor

Re: Halting a service to work with package

For most of my packages we use scripts to restart the "package" outside of service guard.

However if all you want to do is close down the package and still have access to the files in the volume groups then simply restart the volume group once the package is down but remember you need to use the vgchange -a e option rather than -a y. Remember to deactivate the volume groups before re-starting the package.
Hats ? We don't need no stinkin' hats !!
Stephen Doud
Honored Contributor
Solution

Re: Halting a service to work with package

Hi Stefan,

Melvyn discusses one viable option to provide a way to leave the basic system (LVM) resources active when shutting down a package (see UXSGKBQA00000030
"How to keep package file systems mounted after a package halt").

Normally, the "service" associated with a complex package (such as Oracle) monitors the PID's that represent the application. The service dies if the monitor script determines any of the application-related PIDs has died.

To do what you want to do, the monitor script must be augmented to check for a WAIT flag-file if an application PID is gone. If WAIT is not found, proceed to exit normally, but if one is found, a NEW function must be entered to compile a new list of PIDs related to the application when the WAIT flag-file is removed (requiring another periodic check).

Please remember that the HP Response Center supports only HP's "out of the box" scripts, such as the Enterprise Cluster Master Toolkit version of the ORACLE.sh script. Any modifications to it are NOT SUPPORTED by HP.

-s.
Giri Sekar.
Trusted Contributor

Re: Halting a service to work with package

Hi:

I assume you want to have access to the files and the volumegroup. try this

cmhaltpkg

vgchange -a e (exclusive mode)
(ex. /dev/vg05)
mount the required file system on the volume group

work with the files
umount filesystem

after done do..
vgchange -a n (ex. /dev/vg05)

cmrunpkg
cmmodpkg -e

Thanks
Giri Sekar.

"USL" Unix as Second Language
Yvonne Butler
Regular Advisor

Re: Halting a service to work with package

Just a suggestion, but how about setting the service Max_Restarts to say 2 or 3 giving you more time before failover would occur, or would this jeopardise the package failover in real situations!?