Operating System - HP-UX
1826499 Members
1609 Online
109692 Solutions
New Discussion

Re: where to add customized function before any disk operation in a package.

 
SOLVED
Go to solution
David Her
Occasional Advisor

where to add customized function before any disk operation in a package.

Hi,
Understood it is not recommended to modify standard function "verify_physical_data_replication" of control script. A customized verification function must be executed before any CA disk operation started i.e. first thing of cmrunpkg. Is function verify_physical_data_replication of control script a good place to add it, or elsewhere?

Thank you,
David
6 REPLIES 6
Johnson Punniyalingam
Honored Contributor

Re: where to add customized function before any disk operation in a package.

Hence you refering to "package",

I hope the best place to put your customized script should under the pkg.cntl.script,

But Could you please also explaing "what is purpose of "verify_physical_data_replication" script ?

does the script will be checking on some thing the volume group / file system ? if not ,
the purpose of putting the script may be helpless, hence when package cntl.script while take control of the activate/deactivate , mount & unmount the file system in reference to the "package"
Problems are common to all, but attitude makes the difference
David Her
Occasional Advisor

Re: where to add customized function before any disk operation in a package.

hi Johnson,
verify_physical_data_replication is a scripting function inide of package.control.script and believe is first function be executed before disks import.
melvyn burnard
Honored Contributor

Re: where to add customized function before any disk operation in a package.

That function is ONLY used when a Metrocluster Toolkit has been installed and is used for a package. You should not tamper with that function.
My house is the bank's, my money the wife's, But my opinions belong to me, not HP!
Matti_Kurkela
Honored Contributor
Solution

Re: where to add customized function before any disk operation in a package.

The important question is, what is your Serviceguard version?

Serviceguard 11.18 and above can use a new "modular" package configuration, which enables several new features. One of them is the external_script module, which can run custom scripts as the very first action of package start-up.

The configuration keyword is "external_pre_script".

http://docs.hp.com/en/B3936-90140/ch04s08.html#chdcgiaf

In short:
if you add a line like this in your new-style package configuration:

external_pre_script /some/where/myscript

then three things will happen:

1.) Serviceguard will run "/some/where/myscript start" at the very first step of package startup.

2.) Serviceguard will run "/some/where/myscript stop" as the very last action of package shutdown.

3.) whenever you use the "cmcheckconf" or "cmapplyconf" commands on this package, Serviceguard will run "/some/where/myscript validate". If your scripts returns an error code here, the cmcheckconf/cmapplyconf operation will be aborted.

Your script must be written to accept each of these arguments. If your script has nothing to do e.g. in the package shut-down phase, it should just exit cleanly, without setting an error code (i.e. "exit 0")

MK
MK
Stephen Doud
Honored Contributor

Re: where to add customized function before any disk operation in a package.

David, along with your question, it would be helpful to clarify your goal!
As Melvyn said, that "verify_physical_data_replication" is a hook for Metrocluster. Regardless of whether Metrocluster is installed at your site, this function was designed to work without modification. If you have custom activities that you would like to perform before starting the application, use the customer_define_run_cmds function in the legacy package control script. If you need to perform a custom function before the activation of VGs, add it at the top of the control script. Note that customizations are not directly supported by HP.
David Her
Occasional Advisor

Re: where to add customized function before any disk operation in a package.

It is running serviceguard 11.18 but SAP package is running on SGeSAP 4.01 and it can't go higher or can't support SAP 45b (it is very old). Because of SGeSAP 4.01 sap pacakge can't go modular.
Both sites has XP CA. Each site's cluster has two servers. Packages don't automate failover cross site. The goal is to hook customized script such as sednmail and business related verification before package can be started.