Operating System - HP-UX
1830624 Members
1960 Online
110015 Solutions
New Discussion

Halting a service without switching package

 
SOLVED
Go to solution
Jerome Bellet
Advisor

Halting a service without switching package

Hi! I can't test this, so please tell me if I'm right.

If SERVICE_RESTART=-r n (n>=0) and the service fails n+1 times, the related package switches to another node, according to PKG_SWITCHING_ENABLED.
Does is also apply to the "cmhaltserv" command? If I want to halt such a service but do not want the package to switch to another node, do I have to modify the PKG_SWITCHING_ENABLED variable first?

TIA
6 REPLIES 6
Rita C Workman
Honored Contributor

Re: Halting a service without switching package

Doing a cmhaltpkg will do just that halt the package. Under MC/SG it should not failover to another box if the package has been halted.

I found this in a SG doc I had:
"....if a package has been stopped manually on a node SWITCHING remains set to enabled on all noeds, but PKG_SWITCH is disabled. In this case a package will not therefore start up again automatically on the other node. After manually starting the package on the new node the PKG_SWITCH should be reset to enabled."

Hope that helps,
melvyn burnard
Honored Contributor

Re: Halting a service without switching package

mnanual use of the cmrunserv/cmhaltserv command is not supported, and can bring unpredictable results.
You would be better looking at why you would want to do this and then possibly redesigning your package dependencies.
If you manually do cmmodpkg -d pkg_name, the package will not switch if you halt a monitored service, but it will more than likely halt on the node it is currently running on. This is the design of MC/SG
My house is the bank's, my money the wife's, But my opinions belong to me, not HP!
Jerome Bellet
Advisor

Re: Halting a service without switching package

Manually halting a service could be useful for this service maintenance. I was looking for a good method for updating a service without causing package switching.
Ovidiu D. Raita
Valued Contributor

Re: Halting a service without switching package

An idea (you tell me if it's good or bad) would be to prepare a fake service that can replace the service you want to bring down for maintenance. If you monitor for example a process with ps -ef you can start a process with the same name, stop the service, restart it and then kill the fake one.

If you monitor the service other way you might be able to find a way to replace the real service with a fake one.

Ovidiu
Simple solutions to complex problems
Leila Maria Rebel
Frequent Advisor

Re: Halting a service without switching package

Jerome, I?m not sure I understood your question.

If you use cmhaltserv, there won?t be a package switch, even if the package switching is enabled. I do it regurlarly.

The problem is that you won?t be able to restart the service, once the command cmrunserv doesn?t run in command mode. You must restart the package later.
Leila rebel
Emil Velez
Honored Contributor
Solution

Re: Halting a service without switching package


In the MC/ServiceGuard course we talk about a concept we call the "Package maintenance flag"

If you have a service that is a loop that makes sure certain processes are running you can edit that script so if a file exists it does not check for the process. Example:

I have to shutdown oracle to reorganize the tablespaces. If I shutdown the package the volume group and filesystems are gone. I cannot shutdown the database because I have a service that will detect that. So I rewrite my service script so if I touch a file it does not check for the processes.

touch /u01/working_on_oracle

su - oracle
dbshut

do work
dbstart
exit
rm /u01/working_on_oracle


I hope this idea helps and if not please feel free to ask a followup