Operating System - HP-UX
1833420 Members
3298 Online
110052 Solutions
New Discussion

Re: package start/stop scripts for new module packages

 
Matthew Murdock
Valued Contributor

package start/stop scripts for new module packages

Formerly in a.11.16 you had a package control script denoting the path to start and stop scripts for a application (package).
In a.11.20, I am not understanding how or where the package (application) start and stop scripts are ran or even placed to be called automatically. The only package module I see is for the sg/package_ip module. Im sure its simple once explained. thanks.
1 REPLY 1
Matti_Kurkela
Honored Contributor

Re: package start/stop scripts for new module packages

With modular packages, the package script is optional, and is called "external_script". If you use it, the script must fulfill certain conditions.

The package script must be written to accept arguments similar to a typical SysVinit script - i.e. "
It must also implement a third argument: "
No matter what the package script ends up doing, it should terminate with one of three possible result codes:
* 0 = operation successful
* 1 = permanent failure: package will be halted and should not be restarted on any other node (e.g. the package is in a state that does not allow restarting)
* 2 = the package operation was not successful on this node, but the package can be moved to some other node and a restart attempt made there

Because of these conventions, the package script can be declared in the configuration file with one line:

external_script
To use this, you must include the "external" module in your modular package configuration.

An example package script should be available at /etc/cmcluster/examples/external_script.template.

When the new-style package script runs, it inherits some Serviceguard-specific environment variables which might be useful for you. See the example script for details.

MK
MK