Software Distributor (SD-UX) Administration Guide HP-UX 11i v1, 11i v2, and 11i v3 (762797-001, March 2014)

Table Of Contents
echo ERROR: Cannot find bletch in /etc/bagel. |&>2
fi
Follow these conventions to ensure a control script’s messages have a similar look and feel to
the messages generated by the agent (and the commands themselves).
Use full sentences wherever possible. Avoid terseness.
Start sentences and phrases with capital letter and end with period.
Put two blanks after period; one after colons, semicolons, and commas.
Use uppercase first letters of phrases after colons. (This helps break up the message into
digestible “bites” of information.)
Surround product, fileset, directory, and file names, and other variable-valued strings
with quotes. For example:
echo "ERROR: Cannot open file \"$file\"." &>2
Write in the present tense. Avoid “would”, “will”, and similar verb tenses. Also avoid
past tense except where necessary.
Use “cannot” rather than “can’t”, “could not”, “couldn’t”, “unable to, “failed to, and
similar phrases.
Write messages that make sense to system administrators and users. Consider your
audience.
File Management by Control Scripts
All files created by a preinstall, postinstall, or configure script must be removed by a companion
postremove, preremove or unconfigure script.
Files created by scripts are not known by the swremove command, and will not get removed
when it removes those files installed by swinstall. If you want script-created files removed
by SD, you will have to add them to the IPD by either the swmodify command or the
control_utils function IPD_addfile.
If any files in the previous revision of a product have changed names or became obsolete, a
product/fileset preinstall or postinstall script in the new revision of the product must remove
the old files. The agent does not remove the files in an existing product/fileset before updating
it to a newer revision.
NOTE: It is necessary to perform the cleanup task of any previous revision that can be
updated to the new revision. Sometimes this is more than just the previous revision.
Testing Control Scripts
The following testing suggestions do not cover all test scenarios. There may still be problems with
a control script even after doing this testing. For example, you may test installing/removing individual
filesets. But there might be some interactions that are discovered only after all the filesets are
installed on or removed from the system.
Similarly, you may test the control scripts on a fully loaded system and miss a problem when you
execute a command in your script that is not part of the base (or core) system. If your target system
does not contain the particular command, your script may fail.
Testing Installation Scripts
For checkinstall, preinstall, and postinstall scripts you should perform at least these tests. All tests
can be performed on the local system (that is, by doing local installs).
218 Using Control Scripts