The checkinstall script is executed shortly after the optional request script. The checkinstall script runs as the user install, if such a user exists, or as the user nobody. The checkinstall script does not have the authority to change file system data. However, based on the information the script gathers, it can create or modify environment variables in order to control the course of the resulting installation. The script is also capable of cleanly halting the installation process.
The checkinstall script is intended to perform basic checks on a file system that would not be normal for the pkgadd command. For example, this script can be used to check ahead to determine if any files from the current package are going to overwrite existing files, or manage general software dependencies. The depend file only manages package-level dependencies.
Unlike the request script, the checkinstall script is executed whether or not a response file is provided. The script's presence does not brand the package as interactive. The checkinstall script can be used in situations where a request script is forbidden or administrative interaction is not practical.
The checkinstall script is available starting with the Solaris 2.5 and compatible releases.
The checkinstall script cannot modify any files. This script only analyzes the state of the system and creates a list of environment variable assignments based upon that interaction. To enforce this restriction, the checkinstall script is executed as the non privileged user install if that user exists. Otherwise, this script is executed as the non privileged user nobody. The checkinstall script does not have superuser authority.
The pkgadd command calls the checkinstall script with one argument that names the script's response file. The script's response file is the file that stores the administrator's responses.
The checkinstall script is not executed during package removal. However, the environment variables assigned by the script are saved and are available during package removal.
The environment variable assignments should be added to the installation environment for use by the pkgadd command and other packaging scripts by writing them to the response file (known to the script as $1).
System environment variables and standard installation environment variables, except for the CLASSES and BASEDIR parameters, cannot be modified by a checkinstall script. Any of the other environment variables that you created can be changed.
Every environment variable that the checkinstall script may manipulate should be assigned a default value in the pkginfo file.
The format of the output list should be PARAM=value. For example:
Administrator interaction is not permitted during execution of a checkinstall script. All administrator interaction is restricted to the request script.