Operating System - HP-UX
1828586 Members
2573 Online
109983 Solutions
New Discussion

Shutdown cluster package with shutdown command

 
SOLVED
Go to solution
joseph51
Regular Advisor

Shutdown cluster package with shutdown command

Hi,

Is there any option to shutdown the package running with the shutdown -hy 0 command . In our environment we have many maintaince activity . I heard that if we copy some files to the /etc/cmcluster/rc directory then when we shutdown the server with shutdown 0hy 0 command it will first shutdown hte package and then shutdown the server.

Can sone one pls give a brief idea about this ,How its working and which are the files need to copy and from where
11 REPLIES 11
Torsten.
Acclaimed Contributor

Re: Shutdown cluster package with shutdown command

If configured correctly, the shutdown of the server will halt the package and node too (gracefully).

Hope this helps!
Regards
Torsten.

__________________________________________________
There are only 10 types of people in the world -
those who understand binary, and those who don't.

__________________________________________________
No support by private messages. Please ask the forum!

If you feel this was helpful please click the KUDOS! thumb below!   
Horia Chirculescu
Honored Contributor

Re: Shutdown cluster package with shutdown command

Hello,

When you issue a shutdown command, the /sbin/rc?.d/K* scripts are executed in order to gracefully stop running processes.

I believe you could make a script in order to stop the package.

The script can be either as simple as calling cmhaltpkg or you should move the package from the current node to another one (cmhaltpkg then cmrunpkg -n other_node).

Best regards
Horia.
Best regards from Romania,
Horia.
rariasn
Honored Contributor

Re: Shutdown cluster package with shutdown command

Hi:

Look /sbin/init.d/cmcluster scripts.

##########################
function halt_cluster_node
##########################
# Halt Serviceguard components
{
findproc cmcld
if [ "$pid" = "" ]
then
# No cmcld is running. Return N/A
exit 2
fi

if [ -x $cmhaltnode ]
then
#
# Perform application specific halt actions
#
if [ -d /etc/cmcluster/rc ]
then
for APP_RC in $(ls /etc/cmcluster/rc/K*)
do
$APP_RC
if [ $? -ne 0 ]
then
echo "ERROR: Unable to stop cluster application from $APP_RC"
exit 1
fi
done
fi

$cmhaltnode -vf
if [ $? -ne 0 ]
then
echo "ERROR: Unable to halt cluster on this node."
exit 1
fi
fi

if [ -x /usr/sbin/vxdisk ]
then
deport_vxvm_dgs
fi

}

rgs,
Fabio Ettore
Honored Contributor

Re: Shutdown cluster package with shutdown command

Hi,
I should have another approach to stop a package.

As already mentioned shutdown command already shuts all services on the system gracefully, included SG and its packages but instead of such approach I'd stop it manually (cmhaltpkg ) and restart it on another node (of course, if for any reasons the package only runs on that node, then just stop it) before of issuing shutdown command.

HTH.

Best regards,
Fabio
WISH? IMPROVEMENT!
Stephen Doud
Honored Contributor
Solution

Re: Shutdown cluster package with shutdown command

Page 275 of the A.11.20 "Managing Serviceguard" manual states:
"NOTE: The /sbin/init.d/cmcluster file may call files that Serviceguard stores
in /etc/cmcluster/rc. This directory is for Serviceguard use only! Do not move,
delete, modify, or add files in this directory."

Though a shutdown command will cause /sbin/rc2.d/K002cmcluster -> /sbin/init.d/cmcluster to perform cmhaltnode, cmhaltnode cannot terminate cmlvmd correctly if a package shutdown does not completely umount all file systems controlled by the package. This situation leaves cmcld running, so when shutdown executes killall, cmcld is terminated ungracefully, potentially exposing the system to a TOC (tranfer-of-control) - a memory dump, before rebooting.

Page 343 states:
"NOTE: HP recommends that you remove a node from participation in the cluster (by running cmhaltnode as shown below, or Halt Node in Serviceguard Manager) before running the HP-UX shutdown command, especially in cases in which a packaged application might have trouble during shutdown and not halt cleanly."

Fabio's recommendation to perform cmhaltpkg on each package running on the node before performing a shutdown is standard procedure.
joseph51
Regular Advisor

Re: Shutdown cluster package with shutdown command

Hi Stephan ,
thanks for your valuable information .

I have a small query also .I could not find any directory "rc" under /etc/cmcluster/ ..

In this case what we have to do .. in this case also the /sbin/init.d/K002cmclustet will gracefully shutdown the package ..?

Or do I need to modify anythin gmore for a graceful shutdown
SoorajCleris
Honored Contributor

Re: Shutdown cluster package with shutdown command

"NOTE: HP recommends that you remove a node from participation in the cluster (by running cmhaltnode as shown below, or Halt Node in Serviceguard Manager) before running the HP-UX shutdown command, especially in cases in which a packaged application might have trouble during shutdown and not halt cleanly."

Regards,
Sooraj
"UNIX is basically a simple operating system, but you have to be a genius to understand the simplicity" - Dennis Ritchie
Stephen Doud
Honored Contributor

Re: Shutdown cluster package with shutdown command

Do NOT run "/sbin/init.d/K002cmcluster"

Do run one of the following:
To force packages that are running on the node to failover:
# cmhaltnode -f

To halt packages running on the node (but not force them to move to an adoptive node):
# cmhaltpkg [-v] [-n node_name]... package_name...

Then 'shutdown' the system and "/sbin/init.d/K002cmcluster" will perform cmhaltnode and shutdown cluster daemons on the node if you only ran the cmhaltpkg command above.
Ismail Azad
Esteemed Contributor

Re: Shutdown cluster package with shutdown command

Hi,

Do assign points for those who have helped. I learned a lot from this thread!!!

Regards
Ismail Azad
Read, read and read... Then read again until you read "between the lines".....
joseph51
Regular Advisor

Re: Shutdown cluster package with shutdown command

Thanks for all of you for the replays ... this helped me to realise the proper way of down the package while the shutdown happens
joseph51
Regular Advisor

Re: Shutdown cluster package with shutdown command

Thanks once again ..