The checkinstall script is executed shortly after the optional request script. It runs as the user install, if such a user exists, or the user nobody. The checkinstall script does not have the authority to change file system data; it is strictly a data gatherer. However, based on the information it gathers, it can create or modify environment variables in order to control the course of the resulting installation. It 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, it 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; and, its presence does not brand the package as “interactive.” This means that 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. It 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 it 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 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 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
BASEDIR parameters, cannot
be modified by a checkinstall script. Any of the other
environment variables 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.