The procedure scripts provide a set of instructions to be performed at particular points in package installation or removal. The four procedure scripts must be named one of the predefined names, depending on when the instructions are to be executed, and are executed without arguments.
Runs before class installation begins. No files should be installed by this script.
Runs after all volumes have been installed.
Runs before class removal begins. No files should be removed by this script.
Runs after all classes have been removed.
Each script should be able to be executed more than once since it is executed once for each volume in a package. This means that executing a script any number of times with the same input produces the same results as executing the script only once.
Each procedure script that installs a package object not in the pkgmap file must use the installf command to notify the package database that it is adding or modifying a path name. After all additions or modifications are complete, this command should be invoked with the -f option. Only postinstall and postremove scripts may install package objects in this way. See the installf(1M) man page and Chapter 5, Package Creation Case Studies for more information.
Administrator interaction is not permitted during execution of a procedure script. All administrator interaction is restricted to the request script.
Each procedure script that removes files not installed from the pkgmap file must use the removef command to notify the package database that it is removing a path name. After removal is complete, this command should be invoked with the -f option. See the removef(1M) man page and Chapter 5, Package Creation Case Studies for details and examples.
The installf and removef commands must be used because procedure scripts are not automatically associated with any path names listed in the pkgmap file.