Here
are some guidelines for writing control scripts:
Consider doing most control
script work within the configure script.
All scripts are executed
serially and directly impact the total time required to complete an
installation, configuration, or removal task. Consider the impact
control scripts will have on performance.
The current working directory
in which the agent executes a control script is not defined. Use the
environment variables provided by the agent for all pathname references.
Disk space analysis does
not account for files created, copied or removed by control scripts.
The control scripts you
write may be executed several times (for example, configure, then
unconfigure, then configure...) so they must be able to support multiple
executions.
You may have to re-execute
or debug control scripts, especially when they generate error or warning
conditions, so your scripts should be well-written and commented.
Control script stdout and stderr are both logged,
so you should restrict output to only the information the user requires.
Make sure you specify
the path to a shell that is proper for your system. If you get the
following message when you execute a script:
Cannot execute /var/adm/sw/products/PRODUCT/FILESET/
configure. Bad file number (9).
it means the shell in your script has a path that
is not correct for your system. (HP-UX 9.X scripts = #!/bin/sh and HP-UX 10.X and 11.X scripts = #!/sbin/sh.)