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.

Table 70. Package Administration Options
Parameter Description Possible Value
mail 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.

Table 71. Description of Possible Parameter Values
Possible Value Description
ask Notify the installer when the situation occurs and ask for instructions.
default Install packages in the base directory specified by the BASEDIR parameter in the pkginfo file.
nocheck Do not check for the specified parameter.
nochange Override installation of the specified parameter.
overwrite Overwrite an existing package if only one instance exists. If there is more than one instance but only one has the same architecture, overwrite that instance. Otherwise, prompt the installer with existing instances asking which to overwrite.
quit Abort installation if the parameter condition is detected.
unique Do not overwrite an existing instance of a package. Instead, create a new instance of the package. Assign the new instance the next available instance identifier.
username User login name.
$PKGINST Create a default directory with the same name as the package.
/path Use the specified path as the base directory.
/path/$PKGINST Use the specified path as the base directory and create a default directory with the same name as the package at the end of the specified path.

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.

						# pkgadd -a /var/tmp/admin -d /cdrom/cdrom0
					

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.

The following example shows an administration file that prevents pkgadd from prompting the user for any confirmation before installing the package. Without prompting, you can start the installation and it completes without requiring any further user input. This file does no checking of any of the parameters, overwrites an existing instance of the package, and installs the package in the default base directory.


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%

Setting Up the Installation Base Directory

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.
Add the line basedir=/usr/apps/pkgs/$PKGINST to the file.

5.
Save the changes and quit.

Installing a Package with an Alternative Administration File

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.

# pkgadd -d /cdrom/cdrom0 -a admin SUNWssser
							
						

..................Content has been hidden....................

You can't read the all page of ebook, please click here login for view all page.
Reset
18.118.163.159