Operating System - HP-UX
1833750 Members
3150 Online
110063 Solutions
New Discussion

Re: SG debug mode and resource management

 
hpuxrocks
Advisor

SG debug mode and resource management

Hi
to start a cluster in "debug mode" one would have to place a file called "debug" in the /etc/cmcluster/ directory.

This would presumeably allow the package applications to be taken down without the package going down as well.

My questions are:

1. is it possible to put this in effect without restarting the whole cluster;

2. I have seen a scenario in the past where I placed a file called "debug" into the correct directory but the package didnt stay up when the underlying applications were down. The syslog complained of resource issues. I removed resource monitoring and the package stayed up without the applications running. Was this behaviour and solution normal ?

I assumed that simply putting the debug file in place was the cure-all for allowing the apps to be shutdown with the package following suit. .....or could I have achieved the same end by turning off the resource monitoring without the debug file .....or do both things (debug + resource monitoring off) need to be in effect ?

Thanks in advance !

2 REPLIES 2
hpuxrocks
Advisor

Re: SG debug mode and resource management

Sorry ...I forgot to add..

When you do add the "debug" file in place, what exactly does it tell SG to do or not do?, that is the specific elements/ commands that are run or not run ...
Matti_Kurkela
Honored Contributor

Re: SG debug mode and resource management

The "debug mode" is something implemented by the package startup/shutdown/service scripts, not by Serviceguard itself.

If you aren't using a toolkit, you can implement the debug file functionality yourself. Doing so would often be a good idea.

1.) Yes.

2.) In legacy-style Serviceguard configuration, resource monitoring is defined in the package configuration file. If RESOURCE_START is specified as AUTOMATIC, resource monitoring is started automatically and package scripts cannot affect it at all.

If RESOURCE_START is set to DEFERRED, I guess a customized package control script might be able to disable monitoring for these resources by not setting the corresponding DEFERRED_RESOURCE_NAME[n] variables when a debug file is detected. On the other hand, this might cause the package to remain in "starting" state, since the package configuration file tells Serviceguard to expect the package control script to activate monitoring for those resources.

Usually, the debug file would cause the package control script to skip any custom package startup/shutdown actions, and the service scripts to skip any application-related actions and just sleep instead. (To take the debug file into account, the service has to be a script or a Serviceguard toolkit component.)


If you have set up some resource monitoring conditions that won't be satisfied if the application isn't actually up, then I guess you would indeed have to turn off resource monitoring before shutting down the application.

If you have services monitoring the application (e.g. a service script that sleeps a while, then checks to make sure the application is still running), then the service script should check for the presence of the debug file, and skip all tests and just sleep when the debug file exists.

In other words, the service script would essentially have to be something like this:

-----
#!/bin/sh
INTERVAL=60 # sleep 60 s between checks
PKGNAME=

while true; do
sleep $INTERVAL
if [ -f /etc/cmcluster/$PKGNAME/debug ]; then
: # nothing, debug mode enabled
else
# add all application checks here
# if something is wrong, the script should exit
fi
done
-----

If you have both resource monitoring and services in your package, then yes, you'll have to both disable the resource monitoring and create the debug file before you can fiddle with the application.

MK
MK