Solaris 10 8/07 Installation Guide: Custom JumpStart and Advanced Installations

Guidelines for Writing Scripts

Your package procedure scripts must be independent of the currently running OS to prevent modifying the OS. Procedure scripts define actions that occur at particular points during package installation and removal. Four procedure scripts can be created with these predefined names: preinstall, postinstall, preremove, and postremove.

Table B–2 Guidelines For Creating Scripts


Affects Solaris Live Upgrade 

Affects non-global zones 

Scripts must be written in Bourne shell (/bin/sh). Bourne shell is the interpreter that is used by the pkgadd command to execute the procedure scripts.

Scripts must not start or stop any processes or depend on the output of commands such as ps or truss, which are operating system dependent and report information about the currently running system.

Scripts are free to use other standard UNIX commands such as expr, cp, and ls and other commands that facilitate shell scripting.

Any commands that a script invokes must be available in all supported releases, since a package must run on all of those releases. Therefore, you cannot use commands that were added or removed after the Solaris 8 release.  

To verify that a specific command or option is supported in a Solaris 8, 9, or 10 release, see the specific version of Solaris Reference Manual AnswerBook on