Museum

Home

Lab Overview

Retrotechnology Articles

Online Manuals

⇒ swremove(8) — HP-UX 9.10

Media Vault

Software Library

Restoration Projects

Artifacts Sought

Related Articles

swacl(8)

swagentd(8)

swconfig(8)

swcopy(8)

swdepot(8)

swinstall(8)

swlist(8)

swpackage(8)

swverify(8)

swpackage(4)

sd(4)

sd(5)

swremove(8)  —  SD 2.0 Release

NAME

swremove − Unconfigure and remove software products

SYNOPSIS

swremove [XToolkit Options] [-i] [-p] [-v] [-d|-r] [-x option=value] [-X option_file] [-f file] [-t target_file] [-S session_file] [software_selections] [ @  target_selections]

DESCRIPTION

The swremove command removes the software_selections from one or more target_selections (e.g. root filesystems).  When removing installed software, swremove also unconfigures the software on each target before it is removed.  The software is not unconfigured when removed from an alternate root directory.  It was not configured during installation.  When removing available software (within a depot), swremove does not perform the unconfiguration task. 

When removing installed software, the swremove command executes several vendor-supplied scripts (if they exist) during the removal of the software_selections. The swremove command supports the following scripts:

checkremove
a script executed during the analysis of each target_selection, it checks that the removal can be attempted. If this check fails, the software product will not be removed.

preremove
a script executed immediately before the software’s actual files are removed.

postremove
a script executed immediately after the software’s actual files are removed.

unconfigure
a script executed during the unconfiguration of each target_selection, it unconfigures the host for the software (and the software for the host). The preremove and postremove scripts are not intended for unconfiguration tasks.  They are to be used for simple file management needs such as restoring files moved during install. 

Options

The swremove supports the following options:

XToolKit Options
The swremove command supports a subset of the standard X Toolkit options to control the appearance of the GUI.  The supported options are: -bg, -background, -fg, -foreground, -display, -name, and -xrm.  See the X(1) manual page for a definition of these options. 

-p Previews a remove task by running the session through the analysis phase only. 

-i Runs swremove in interactive mode (invokes the Graphical User Interface). 

-v Turns on verbose output to stdout.  (The swremove logfile is not affected by this option.)  Verbose output is enable by default, see the verbose option below. 

-d Operate on a depot rather than installed software. 

-r Operate on an alternate root rather than /.  Unconfigure scripts are not run when removing software from an alternate root directory. 

-x option=value Set the session option to value and override the default value (or a value in an alternate option_file specified with the -X option).  Multiple -x options can be specified. 

-X option_file Read the session options and behaviors from option_file.

-f file Read the list of software_selections from file instead of (or in addition to) the command line. 

-t target_file Read the list of target_selections from target_file instead of (or in addition to) the command line. 

-S session_file Execute swremove based on the options and operands saved from a previous session, as defined in session_file.

Operands

The swremove command supports the following syntax for each software_selection:

product[.subproduct][.fileset][,version]

The version component supports either of these syntaxes:

[r=revision][,a=arch][,v=vendor][,vid=vendor_uuid][,l=location]

[instance_id]

The swremove command supports the following syntax for each target_selection:

[host][:][/directory]

EXTERNAL INFLUENCES

Defaults File

In addition to the standard options, several swremove behaviors and policy options can be changed by editing the default values found in:

/var/adm/sw/defaults - the system-wide default values,

$HOME/.sw/defaults - the user-specific default values. 

Values must be specified in the defaults file using this syntax:

swremove.option=value

The default values can be overridden by specifying an options file with the -X option, or by specifying -x option=value on the command line. 

Command Options
The following defaults are used to modify the default behavior of the swremove command:

swremove.target_directory=/var/spool/sw
Defines the default location of the target depot.

swremove.verbose=1
Controls the verbosity of the swremove output (stdout).  A value of 0 disables output to stdout.  (Error and warning messages are always written to stderr).  A value of 1 enables verbose messaging to stdout. 

swremove.loglevel=1
Controls the log level for the events logged to the command logfile, and the target agent logfile. A value of 1 enables verbose logging to the logfiles.  A value of 2 enables very verbose logging to the logfiles. 

swremove.logfile=/var/adm/sw/swremove.log
This is the default command log file for the swremove command. 

swremove.select_local=true
If no target_selections are specified, select the default root directory /, or the default target_directory (when operating on depots), at the local host as the target of the command. 

swremove.targets=
Defines the default target_selections. There is no supplied default (see select_local above).  If there is more than target selection, they must be separated by spaces. 

swremove.software=
Defines the default software_selections.  There is no supplied default.  If there is more than software selection, they must be separated by spaces. 

swremove.polling_interval=2
Defines the polling interval used by interactive (GUI) sessions.  It specifies how often each target agent will be polled to obtain status information about the task being performed.  When operating across wide-area networks, the polling interval can be increased to reduce network overhead.

Target Task Options
These defaults are used to affect target behaviors. The are organized by when they are used in the process.

swremove.mount_all_filesystems=true
By default, the swremove command attempts to automatically mount all filesystems in the /etc/checklist file at the beginning of the analysis phase, to ensure that all listed filesystems are mounted before proceeding.  This policy helps to ensure that files which may be on umounted filesystems are available to be removed. 

If set to false, the mount operation is not attempted, and no check of the current mounts is performed. 

swremove.enforce_dependencies=true
Requires that all dependencies specified by the software_selections be resolved at the target_selections. For swremove, if a selected fileset has dependents (i.e. other software depends on the fileset) and they are not selected, do not remove the selected filesets.  If set to false, dependencies will still be checked, but not enforced. 

swremove.enforce_scripts=true
If a fileset/product checkremove script fails (i.e. returns with exit code 1), none of the filesets in that product will be removed.  If set to false, the remove operation will proceed even when a check script fails. 

swremove.write_remote_files=false
Prevents the removal of files from a remote (NFS) filesystem.  All files on a remote filesystem will be skipped.

If set to true and if the superuser has write permission on the remote filesystem, the remote files will not be skipped, but will be removed. 

Remote Procedure Call Options
These options apply to the DCE Remote Procedure Call used by swremove:

swremove.rpc_binding_info=ncadg_ip_udp:[2121]
Defines the protocol sequence(s) and endpoint(s) which will be used to contact swagentd.  This value should be consistent among all hosts that work together.  See sd(5) for details on specifying this option. 

swremove.rpc_timeout=5
Relative length of the communications timout. This is a value in the range from 0 to 9 and is interpreted by the DCE RPC.  Higher values mean longer times; you may need a higher value for a slow or busy network.  Lower values will give faster recognition on attempts to contact hosts that are not up, or are not running the swagentd. 

Session File

Each invocation of the swremove command defines a remove session.  The commands automatically save invocation options, source information, software selections, and target hosts before the remove actually commences.  This session is saved to the file $HOME/.sw/sessions/swremove.last.  This session can be re-executed by using the file as input to swremove (with the -S option.) 

In an interactive session, session information can be saved into a file at any time for reuse in a subsequent session. 

The session file uses the same syntax as the defaults files.  Values in the defaults file are overridden by values from a session file, if specified.  These are in turn overidden by the corresponding command line option or parameter(s), if specified. 

Environment Variables

The swremove program sets these environment variables for use by the control scripts being executed:

SW_PATH

A PATH variable which defines a minimum set of commands available to for use in a control script (e.g.  /bin:/usr/bin). 

SW_ROOT_DIRECTORY

Defines the root directory in which the session is operating, either "/" or an alternate root directory.  This variable tells control scripts the root directory in which the products are installed.  A script must use this directory as a prefix to SW_LOCATION to locate the product’s installed files. 

SW_LOCATION

Defines the location of the product, which may have been changed from the default product directory.  When combined with the SW_ROOT_DIRECTORY, this variable tells scripts where the product files are located. 

SW_CONTROL_DIRECTORY

Defines the current directory of the script being executed, either a temporary catalog directory, or a directory within in the Installed Products Database (IPD).  This variable tells scripts where other control scripts for the software are located (e.g. subscripts). 

Signals

The swremove command catches the signals SIGQUIT and SIGINT.  If these signals are received, swremove prints a message, sends a Remote Procedure Call (RPC) to the agents to wrap up, and then exits. 

Each agent will complete the removal task (if the execution phase has already started) before it wraps up.  This avoids leaving software in a corrupt state. 

RETURN VALUES

An interactive swremove session always returns 0.  A non-interactive swremove session returns:

0 The software_selections were successfully removed. 

1 The remove operation failed on all target_selections.

2 The remove operation failed on some target_selections.

DIAGNOSTICS

The swremove command writes to stdout, stderr, and to specific logfiles. 

Standard Output

An interactive swremove session does not write to stdout.  A non-interactive swremove session writes messages for significant events.  These include:

• a begin and end session message,

• selection, analysis, and execution task messages for each target_selection.

Standard Error

An interactive swremove session does not write to stderr.  A non-interactive swremove session writes messages for all WARNING and ERROR conditions to stderr. 

Logging

Both interactive and non-interactive swremove sessions log summary events the host where the command was invoked.  They logs detailed events to the swagent logfile associated with each target_selection.

Command Log
A non-interactive swremove session logs all stdout and stderr messages to the the logfile /var/adm/sw/swremove.log.  Similar messages are logged  by an interactive swremove session.  (The user can specify a different logfile by modifying the logfile option.) 

Target Log
A swagent process performs the actual remoe operation at each target_selection. When removing installed software, the swagent logs messages to the file var/adm/sw/swagent.log beneath the root directory (e.g.  / or an alternate root directory).  When removing available software (within a depot), the swagent logs messages to the file swagent.log beneath the depot directory (e.g.  /var/spool/sw). 

EXAMPLES

Preview the remove of the C and Pascal products installed at the local host:

swremove -p cc pascal

Remove the C and Pascal products from several remote hosts:

swremove cc pascal @ hostA hostB hostC

Remove a particular version of HP Omniback:

swremove omniback,1=/opt/omniback_v2.0

Remove the entire contents of a local depot:

swremove -d @ /var/spool/sw

FILES

/var/adm/sw/

The directory which contains all of the configurable (and non-configurable) data for SD.  This directory is also the default location of logfiles. 

/var/adm/sw/defaults

Contains the system-wide default values for some or all SD options. 

$HOME/.sw/defaults

Contains the user-specific default values for some or all SD options. 

$HOME/.sw/sessions/

Contains session files automatically saved by the SD commands, or explicitly saved by the user. 

/var/adm/sw/products/

The Installed Products Database (IPD), a catalog of all products installed on a system. 

/var/spool/sw/

The default location of a target software depot. 

AUTHOR

swremove was developed by the Hewlett-Packard Company. 

SEE ALSO

swacl(8), swagentd(8), swconfig(8), swcopy(8), swdepot(8), swinstall(8), swlist(8), swpackage(8), swverify(8), swpackage(4), sd(4), sd(5), and the HP OpenView Software Distributor Administrator’s Guide.

Hewlett-Packard Company  —  Software Distributor 2.0

Typewritten Software • bear@typewritten.org • Edmonds, WA 98026