Serviceguard
cancel
Showing results for 
Search instead for 
Did you mean: 

How the package manager works

 
Highlighted
Occasional Advisor

How the package manager works

Hi, I have a question on the package manager.
It's written in the manual it monitors the package services' PIDs, and it kills the for example when halt scripts time-outs.
How exactly it monitors the PIDs?
Is there som script that kills services, or the package manage deamon does it directly?
Thanks, Yulia
9 REPLIES 9
Highlighted
Honored Contributor

Re: How the package manager works

The package manager component of Serviceguard is described on page 71 of the Managing Serviceguard manual located at http://docs.hp.com/en/B3936-90117/B3936-90117.pdf

The package manager is not a separate process, but runs from cmcld.

If configured, package services are also monitored by the package manager. Package service failures are dealt with by the package manager.

A package service is normally a script which is used to monitor processes of the critical application. If an application process fails (dies), the service (script) exits. The exit of a service triggers to the package manager to deal with the situation - either attempt to restart the service (monitor script or application), or move the package to an adoptive node.

The package service is defined in the package configuration file and operated in the package control script.
The following are sample lines from each:

pkg1.config:#SERVICE_NAME
pkg1.config:#SERVICE_FAIL_FAST_ENABLED
pkg1.config:#SERVICE_HALT_TIMEOUT

pkg1.sh:#SERVICE_NAME[0]="ora_monitor"
pkg1.sh:#SERVICE_CMD[0]="/etc/cmcluster/pkg1/oramon.sh"
pkg1.sh:#SERVICE_RESTART[0]="1"
Highlighted
Occasional Advisor

Re: How the package manager works

It's written in the manual that the package manager monitors PIDs. How exaclty it does it?
Highlighted
Honored Contributor

Re: How the package manager works

The package configuration file contains the SERVICE_NAME parameter - which is a signal to the package manager to reserve a place for the SERVICE_CMD's PID when the SERVICE_CMD is launched in the package control script. As the SERVICE_CMD is executed by the package control script, the PID of the SERVICE_CMD is passed to the package manager. When the PID of the SERVICE_CMD exits, the package manager acts.

Is there some thing about Serviceguard that you don't understand, or are you just interested in the theory of operations?
Highlighted
Occasional Advisor

Re: How the package manager works

Thanks a lot for your replies.
I'm just interested to understand the Serviceguard deeper then just a user.

So, there are two more questions, regarding the package behaviour after the halt/start scripts abnormal exits:

â ¢ start script returns 1 â abnormal exit. Services are killed, and the package is disabled from failing over to other nodes.
What is the state of the package on this node itself?

â ¢ start scripttimeout
In this scenario, the package is killed and disabled globally. It is not disabled on the current node.

What does it mean disabled globally , but not disabled on the curent node??

Highlighted
Honored Contributor

Re: How the package manager works

Each package has both a global-switching status and a node-switching status. Some years ago the global-switching title was changed to AUTO_RUN.
The status settings can be viewed using either 'cmviewcl -v' or 'cmviewcl -v -p '

AUTO_RUN or global switching is a setting that allows the package to move to any node, whereas node-switching sets whether a package is allowed to run on a specific server.

When a package startup fails (returning 1), AUTO_RUN (global switching) is disabled. This prevents the package from failing over to another node. However node-switching is left enabled on the node where the package attempted to start.

Highlighted
Trusted Contributor

Re: How the package manager works

Though there are some junk character in your post what I understood that you are asking about package switching..

package switching is disabled globally means that package will not switch to other node any any situation .

Generally everytime we start the package we need to change this status by cmmodpkg -e command.

we can enable/disable package switching in perticular node .In this case it is package swithching disabled on local basis.
Occasional Advisor

Re: How the package manager works

"node-switching is left enabled on the node where the package attempted to start" - can I please receive some more explanations on this?
Does it mean I can run switch package command from this node's machine, but not from another one?
Highlighted
Trusted Contributor

Re: How the package manager works

The preference is given to package .Package switching have to be enabled to switch the package and the package can switch to the nodes where node is accepting the package.

If package switching is disabled for a node then the package will not move to that perticular node.

If package swithcing is disabled globally then it will not switch at all and it happend at the time of package startup or after you halt the package.

Hope I am clear to explane
Highlighted
Honored Contributor

Re: How the package manager works

When package startup fails, the package is prevented from starting on any other node (AUTO_RUN = disabled).
But the local node is still permitted to start the package but corrective maintenance is still necessary to clear the package startup problem - that's why Package_switching is still enabled - to allow you to test again.

After the package is started and stopped successfully, re-enable AUTO_RUN thus:
# cmmodpkg -e