Setting Up Package Administration Files |
The pkgadd and pkgrm files, by default, use information from the /var/sadm/install/admin/default file, as shown below.
oak% more /var/sadm/install/admin/default
#ident "@(#)default1.4 92/12/23 SMI"/* SVr4.0 1.5.2.1*/
mail=
instance=unique
partial=ask
runlevel=ask
idepend=ask
rdepend=ask
space=ask
setuid=ask
conflict=ask
action=ask
basedir=default
oak%
The parameters in this file are a set of parameter=value pairs, each on a separate line. If you do not want to use the default values, you can create an admin file and set different values. Table 70 lists and describes the parameters and shows the available values.
Parameter | Description | Possible Value | |
---|---|---|---|
Who will receive mail about installation or removal? | username | ||
instance | Package already installed. | ask overwrite unique[1] quit | |
partial | Partial package installed. | ask[1] nocheck quit | |
runlevel | Is run level correct? | ask[1] nocheck quit | |
idepend | Are package dependencies met? | ask[1] nocheck quit | |
rdepend | Is there a dependency on other packages? | ask[1] nocheck quit | |
space | Is disk space adequate? | ask[1] nocheck quit | |
setuid | Ask permission to set UID? | ask[1] nocheck quit nochange | |
conflict | Will overwriting a file cause conflict with other packages? | ask[1] nocheck quit nochange | |
action | Check for security impact? | ask[1] nocheck quit | |
basedir | Set base install directory. ($PKGINST creates a default directory with the same name as the package.) | default[1] $PKGINST /path /path/$PKGINST |
[1] Indicates the default value
Table 71 describes the possible values for the parameters in the admin file described in Table 70.
CAUTION
Do not edit the /var/sadm/install/admin/default file. If you want to change the defaults, create your own admin file.
If you create a custom admin file and specify it from the command line with the -a admin option, the pkgadd and pkgrm commands automatically look for the file first in the current working directory and then in the /var/sadm/install/admin directory. If you put the admin file in another directory, you must specify the path name for the file as part of the command-line argument. The following example specifies an admin file in the /var/tmp directory.
To create an admin file, use any editor. Define each parameter=value pair, one per line. You do not need to assign values to all 11 parameters. If you do not assign a value and pkgadd needs one, it uses the default value ask.
mail= instance=overwrite partial=nocheck runlevel-nocheck idepend=nocheck rdepend=nocheck space=nocheck setuid=nocheck conflict=nocheck action=nocheck basedir=default
The following example of an administration file runs without user interaction but quits the installation if it encounters an error for any of the parameters.
mail= instance=quit partial=quit runlevel-quit idepend=quit rdepend=quit space=quit setuid=quit conflict=quit action=quit basedir=default
CAUTION
Because the ask value asks for user input, when you specify it in an admin file, you cannot use that admin file for a noninteractive installation.
The following example shows an admin file created to install files in the /usr/apps/pkgs directory and to use the name of the package as the name of the directory—as specified by the $PKGINST variable as part of the value for the basedir parameter. Because no other parameters are specified, pkgadd uses the default values for other parameters.
oak% more /var/sadm/install/admin/admin
basedir=/usr/apps/pkgs/$PKGINST
oak%
Before you begin software installation, decide where you want to install the software. If you want to install in a directory other than /opt, create an admin file in the /var/sadm/install/admin directory and set the basedir parameter to the directory where you want to install the software. If basedir is the only parameter you want to change, you can create an admin file that contains only that parameter. All other parameters use the default values. Refer to Table 70 for a description of the other parameters you can customize.
The following steps show how to create an admin file that installs files in the /usr/apps/pkgs directory and uses the name of the package as the directory name.
1. |
Become superuser. |
2. |
Type cd /var/sadm/install/admin and press Return. |
3. |
Use any editor to create a file. Assign the file any name you like, other than the name default. A suggested file name is admin. |
4. | |
5. |
Save the changes and quit. |
Unless you specify a different administration file, the pkgadd command uses the /var/sadm/install/admin/default file, which specifies the base directory as /opt. To use an alternative admin file, use the following syntax.
pkgadd -d device -a admin-file pkgid
The following example installs the package SUNWssser from the CD-ROM file system mounted at the /cdrom/cdrom0 mount point with an administration file named admin in the /var/sadm/install/admin directory.
3.144.110.155