pkgask Command

Purpose

Stores answers to a request script.

Syntax

pkgask [ -d Device] -r Response [ Pkginst [ Pkginst [. . .]]

Description

pkgask Enables an administrator to store answers to an interactive package (one with a request script) or a set of packages. A set is made up of a special-purpose package, referred to as a Set Installation Package (SIP), and a collection of one or more packages that are members of the set. The SIP controls the installation of the set.

Invoking pkgask generates a Response file that is then used as input at installation time. The use of this Response file prevents any interaction from occurring during installation since the file already contains the information that the package needs.

When pkgask runs, it creates the response file and the following directories:
Item Description
/ptfvars This directory contains variables pertaining to the package.
/fileinfo Contains checksum information about the package.
/oldfiles Contains backups of previous versions of the package.
To install the package on another system non-interactively, you must copy all of these files and directories to the target system.
Note: If you overwrite any of these directories, for example, to install another package non-interactively, you are unable to successfully remove the first package unless you restore the original directory contents first.

You can use the -r flag to indicate a directory name and a filename. The directory name is used to create numerous Response files, each sharing the name of the package with which it must be associated. This is useful, for example, when you add multiple interactive packages with one invocation of pkgadd. Each package needs a Response file. To create multiple response files with the same name as the package instance, name the directory in which the files must be created and supply multiple instance names with the pkgask command. When installing the packages, you can identify this directory to the pkgadd command.

Flags

Table 1. Flags
Item Description
-d Device Runs the request script for a package on Device. Device can be the full pathname to a directory (such as /var/tmp), or -, which specifies packages in data stream format that is read from standard input. The default device is the installation spool directory (/var/spool/pkg).
-r Response Identifies a file or directory Response, which must be created to contain the responses to interactions with the package request script. The file, or directory of files, can later be used as input to the pkgadd command [see the pkgadd command]. When Pkginst is a package, Response can be a full pathname or a directory; when Pkginst is a SIP, Response must be a directory.
Pkginst Defines a short string that is used to designate an abbreviated package or set name. (The term package instance is used loosely: it refers to all instantiations of Pkginst, even those that do not include instance identifiers.)

To create a package name abbreviation, assign it with the PKG parameter. For example, to assign the abbreviation cmds to the Advanced Commands package, enter PKG=cmds.

If Pkginst specifies a SIP, all request scripts for packages, which are members of that set are run (if any) and the resulting response files are placed in the directory that is provided to the -r flag.

To indicate all instances of a package, specify 'Pkginst.*', enclosing the command line in single quotation marks, as shown, to prevent the shell from interpreting the * character. Use the token all to refer to all packages available on the source medium.

Note: When invoked with no Pkginst specified on the command line, pkgask displays the names of sets if at least one SIP exists on the device. Thus, if you have packages, which are not members of sets, they can be referenced only if their Pkginst names are provided on the command line.

Exit Status

This command returns the following exit values:
Table 2. Exit Status
Item Description
0 Successful completion of script.
1 Fatal error. The installation process is terminated.
2 Warning or possible error condition. Installation continues. A warning message is displayed at the time of completion.
3 The script was interrupted and possibly left unfinished. Installation terminates.
4 The script was suspended (administration). Installation terminates.
5 Script was suspended (no interaction was required). Installation terminates.
10 The system should be rebooted when installation of all selected packages is completed. (This value should be added to one of the single-digit exit codes described above.)
20 The system should be rebooted immediately upon completing installation of the current package. (This value should be added to one of the single-digit exit codes described above.)
77 No package was selected for the set.
99 Internal error.

Files

Table 3. Files
Item Description
/var/spool/pkg Default spool directory