swremove(8)swremove(8)NAMEswremove - unconfigure and remove software products
SYNOPSISswremove [-d| [-i] [-p] [-v] [-C session_file] [-f software_file] [-S
session_file] [-t target_file] [-x option=value] [-X
option_file] [software_selections] [@ target_selections]
STANDARDS
Interfaces documented on this reference page conform to industry stan‐
dards as follows:
POSIX 1387.2, XDSA
Refer to the standards(5) reference page for more information about
industry standards and associated tags.
DESCRIPTION
The swremove command removes software_selections from target_selections
(e.g. root file systems). When removing installed software, swremove
also unconfigures the software before it is removed. The software is
not unconfigured when removed from an alternate root directory since it
was not configured during installation. When removing available soft‐
ware (within a depot), swremove also does not perform the unconfigura‐
tion task.
NOTE : Selecting a bundle for removal does not always remove all file‐
sets in that bundle. If a particular fileset is required by another
bundle, that fileset will not be removed. For example, if the bundles
Pascal and FORTRAN both use the fileset Debugger.Run and you try to
remove FORTRAN, the fileset Debugger.Run will not be removed because it
is also used by the bundle Pascal. This prevents the removal of one
bundle from inadvertently causing the removal of filesets needed by
another bundle.
Removing Patches or Patch Rollback Files
To remove patch software, rollback files corresponding to the patch be
available for rollback. You must remove the base software modified by
the patch. (Removing the base software also removes the patches associ‐
ated with that software.)
To commit (make permanent) a patch, use the swmodify command's
patch_commit option to remove the files saved for patch rollback, or
use the swinstall command's save_patch_files option to not save them
initially. See swmodify(8) and swinstall(8) for more information.
Control Scripts
When removing installed software, the swremove command executes several
vendor-supplied scripts (if they exist) during the removal of the soft‐
ware_selections. The swremove command supports the following scripts:
checkremove
a script executed during the analysis of each tar‐
get_selection, it checks to make sure the removal can be
attempted. If this check fails, the software product
will not be removed.
preremove
a script executed immediately before the software files
are removed.
postremove
a script executed immediately after the software files
are removed.
unconfigure
a script executed during the unconfiguration of each tar‐
get_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. The
unconfigure script allows the swremove command to uncon‐
figure the hosts on which it has been running before
removing the software specified.
Options
The swremove supports the following options:
-d (Optional) Operate on a depot rather than
installed software.
-r (Optional) Operate on an alternate root rather
than /. Unconfigure scripts are not run when
removing software from an alternate root direc‐
tory.
-i Runs swremove in interactive mode (invokes the
Graphical User Interface). The swremove command
also supports an interactive terminal user inter‐
face (TUI) in which screen navigation is done
with the keyboard (no mouse).
-p Previews a remove task by running the session
through the analysis phase only.
-v Turns on verbose output to stdout. (The swremove
log file is not affected by this option.) Ver‐
bose output is controlled by the default ver‐
bose=x.
-C session_file
Save the current options and operands to ses‐
sion_file. You can enter a relative or absolute
path with the file name. The default directory
for session files is $HOME/.sw/sessions/. You
can recall a session file with the -S option.
-f software_file
Read the list of software_selections from soft‐
ware_file instead of (or in addition to) the com‐
mand line.
-S session_file
Execute swremove based on the options and oper‐
ands saved from a previous session, as defined in
session_file. You can save session information
to a file with the -C option.
-t target_file Read the list of target_selections from tar‐
get_file instead of (or in addition to) the com‐
mand line.
-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). Mul‐
tiple -x options can be specified.
-X option_file Read the session options and behaviors from
option_file.
Operands
swremove supports two types of operands: followed by These operands are
separated by the "@" (at) character. This syntax implies that the com‐
mand operates on "software selections at targets".
Software Selections
The selections operands consist of
swremove supports the following syntax for each software_selection:
bundle[.product[.subproduct][.fileset]][,version]
product[.subproduct][.fileset][,version]
· The = (equals) relational operator lets you specify
selections with the following shell wildcard and pattern-
matching notations:
[ ], *, ?
For example, the following expression removes all bundles
and products with tags that end with "man":
swremove sw_server *man
· Bundles and subproducts are recursive. Bundles can con‐
tain other bundles and subproducts can contain other sub‐
products. For example:
swremove bun1.bun2.prod.sub1.sub2.fset,r=1.0
or (using expressions):
swremove bun[12].bun?.prod.sub*,a=Tru64 UNIX
· The * software specification selects all products. Use
this specification with caution.
The version component has the form:
[,r <op> revision][,a <op> arch][,v <op> vendor]
[,c <op> category][,q=qualifier][,l=location]
[,fr <op> revision][,fa <op> arch]
· location applies only to installed software and refers to
software installed to a location other than the default
product directory.
· fr and fa apply only to filesets.
· The <op> (relational operator) component can be of the
form:
==, >=, <=, <, >, or !=
which performs individual comparisons on dot-separated
fields.
For example, r>=B.10.00 chooses all revisions greater
than or equal to B.10.00. The system compares each dot-
separated field to find matches. Shell patterns are not
allowed with these operators.
· The = (equals) relational operator lets you specify
selections with the shell wildcard and pattern-matching
notations:
[ ], *, ?, !
For example, the expression r=1[01].* returns any revi‐
sion in version 10 or version 11.
· All version components are repeatable within a single
specification (e.g. r>=A.12, r<A.20). If multiple com‐
ponents are used, the selection must match all compo‐
nents.
· Fully qualified software specs include the r=, a=, and v=
version components even if they contain empty strings.
· No space or tab characters are allowed in a software
selection.
· The software can take the place of the version component.
It has the form:
[instance_id]
within the context of an exported catalog, where is an
integer that distinguishes versions of products and bun‐
dles with the same tag.
Target Selections
swremove supports the following syntax for each target_selection:
[host][:][/directory]
The : (colon) is required if both a host and directory are specified.
EXTERNAL INFLUENCES
Defaults File
In addition to the standard options, you can change swremove behavior
and policy options by editing the default values found in:
/var/adm/sw/defaults the system-wide default values.
$HOME/.swdefaults the user-specific default values.
Values must be specified in the defaults file using this syntax:
[command_name.]option=value
The optional prefix denotes one of the SWMGR commands. Using the prefix
limits the change in the default value to that command. If you leave
the prefix off, the change applies to all commands.
You can also override default values from the command line with the -x
or -X options:
The following section lists all of the keywords supported by swremove
If a default value exists, it is listed after the "=".
The policy options that apply to swremove are:
agent_auto_exit=true
Causes the target agent to automatically exit after
Execute phase, or after a failed Analysis phase. This
is forced to false when the controller is using an
interactive user interface, or when -p (preview) is
used. This enhances network reliability and perfor‐
mance. The default is true - the target agent will
automatically exit when appropriate. If set to false,
the target agent will not exit until the controller
ends the session.
agent_timeout_minutes=10000
Causes a target agent to exit if it has been inactive
for the specified time. This can be used to make tar‐
get agents more quickly detect lost network connec‐
tions since RPC can take as long as 130 minutes to
detect a lost connection. The recommended value is the
longest period of inactivity expected in your environ‐
ment. For command line invocation, a value between 10
minutes and 60 minutes is suitable. The default of
10000 is slightly less than 7 days.
auto_kernel_build=true
Normally set to true. Specifies whether the removal
of a kernel fileset should rebuild the kernel or not.
If the kernel rebuild succeeds, the system automati‐
cally reboots. If set to false, the system continues
to run the current kernel.
If the auto_kernel_build option is set to true, the
autoreboot option must also be set to true. If the
auto_kernel_build option is set to false, the value of
the autoreboot option does not matter.
autoreboot=false
Prevents the removal of software requiring a reboot
from the non-interactive interface. If set to true,
then this software can be removed and the target sys‐
tem(s) will be automatically rebooted.
An interactive session always asks for confirmation
before software requiring a reboot is removed.
If the auto_kernel_build option is set to true, the
autoreboot option must also be set to true. If the
auto_kernel_build option is set to false, the value of
the autoreboot option does not matter.
autoselect_dependents=false
Automatically selects all software that depends on the
specified software. When set to true, and any soft‐
ware that other software depends on is selected for
remove, swremove automatically selects that other
software. If set to false, automatic selections are
not made to resolve requisites.
autoselect_reference_bundles=true
If true, bundles that have the is_sticky attribute set
to true will be automatically removed when the last of
its contents is removed. If false, the sticky bundles
will not be automatically removed.
controller_source=
Specifies the location of a depot for the controller
to access to resolve selections. Setting this option
can reduce network traffic between the controller and
the target. Use the target selection syntax to specify
the location:
[host][:][path]
This option has no effect on which sources the target
uses and is ignored when used with the Interactive
User Interface.
distribution_target_directory=/var/spool/sw
Defines the default location of the target depot.
enforce_dependencies=true
Requires that all dependencies specified by the soft‐
ware_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.
enforce_scripts=true
Controls the handling of errors generated by scripts.
If true, and a script returns an error, the swremove
operation halts. An error message appears reporting
that the execution phase failed. If false, all script
errors are treated as warnings, and swremove attempts
to continue operation. A warning message appears
reporting that the execution succeeded. The message
wording identifies whether the failure occurred in the
configure/unconfigure, checkremove, preremove, or
postremove phases.
installed_software_catalog=products
Defines the directory path where the Installed Prod‐
ucts Database (IPD) is stored. When set to an absolute
path, this option defines the location of the IPD.
When this option contains a relative path, the SWMGR
controller appends the value to /var/adm/sw to deter‐
mine the path to the IPD. For alternate roots, this
path is resolved relative to the location of the
alternate root. This option does not affect where
software is installed, only the IPD location.
log_msgid=0
Controls whether numeric identification numbers are
prepended to log file messages produced by SWMGR:
0 (default) No identifiers are attached to messages.
1 Applies to ERROR messages only.
2 Applies to ERROR and WARNING messages.
3 Applies to ERROR, WARNING, and NOTE messages.
4 Applies to ERROR, WARNING, NOTE, and certain other
log file messages.
logdetail=false
Controls the amount of detail written to the log file.
When set to true, this option adds detailed task
information (such as options specified, progress
statements, and additional summary information) to the
log file. This information is in addition to log
information controlled by the loglevel option.
See the loglevel option and the manual page for more
information.
logfile=/var/adm/sw/swremove.log
This is the default command log file for the swremove
command.
loglevel=1
Controls the log level for the events logged to the
command logfile, the target agent logfile, and the
source agent logfile. This information is in addition
to the detail controlled by the logdetail option.
0 provides no information to the logfile.
1 enables verbose logging to the log files.
2 enables very verbose logging to the log files.
See the logdetail option and the sd(5) manual page for
more information.
mount_all_filesystems=true
By default, the swremove command attempts to automati‐
cally mount all filesystems in the /etc/fstab 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
mounted 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.
polling_interval=2
Defines the polling interval used by the Interactive
UI of the controller. It specifies how often each
target agent will be polled to obtain status informa‐
tion about the task being performed. When operating
across wide-area networks, the polling interval can be
increased to reduce network overhead.
remove_empty_depot=true
Controls whether a depot is removed once the last
product/bundle has been removed. Useful to set to
false if you want to retain existing depot ACLs for
subsequent depot reuse.
rpc_binding_info=ncacn_ip_tcp:[2121] ncadg_ip_udp:[2121]
Defines the protocol sequence(s) and endpoint(s) on
which the daemon listens and the other commands con‐
tact the daemon. If the connection fails for one pro‐
tocol sequence, the next is attempted. SWMGR supports
both the tcp (ncacn_ip_tcp:[2121]) and udp
(ncadg_ip_udp:[2121]) protocol sequence on most plat‐
forms.
See the sd(5) manual page (type man 5 sd) for more
information.
rpc_timeout=5
Relative length of the communications timeout. 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 give faster recognition on attempts to contact
hosts that are not up or not running swagentd. Each
value is approximately twice as long as the preceding
value. A value of 5 is about 30 seconds for the
ncadg_ip_udp protocol sequence. This option may not
have any noticeable impact when using the ncacn_ip_tcp
protocol sequence.
software= Defines the default software_selections. There is no
supplied default. If there is more than one software
selection, they must be separated by spaces.
targets= Defines the default target_selections. There is no
supplied default (see select_local above). If there
is more than one target selection, they must be sepa‐
rated by spaces.
target_shared_root=
Defines the default location of the alternate root
directory.
verbose=1 Controls the verbosity of the output (stdout). A value
of
0 disables output to stdout. (Error and warning
messages are always written to stderr).
1 enables verbose messaging to stdout.
write_remote_files=false
Prevents the removal of files from a remote (NFS) file
system. When set to false, files on a remote file
system are not removed.
If set to true and if the superuser has write permis‐
sion on the remote file system, the remote files are
removed.
Session File
Each invocation of swremove defines a task session. The command auto‐
matically saves options, source information, software selections, and
target selections before the task actually commences. This lets you re-
execute the command even if the session ends before the task is com‐
plete. You can also save session information from interactive or com‐
mand-line sessions.
Session information is saved to the file $HOME/.sw/sessions/swre‐
move.last. This file is overwritten by each invocation of the command.
The file uses the same syntax as the defaults files.
From a command-line session, you can save session information by exe‐
cuting the command with the -C session__file option. You can specify an
absolute path for a session file. If you do not specify a directory,
the default location is $HOME/.sw/sessions/.
To re-execute a session from a command-line, specify the session file
as the argument for the -S option.
When you re-execute a session file, the values in the session file take
precedence over values in the system defaults file. Likewise, any com‐
mand-line options and parameters take precedence over the values in the
session file.
Software and Target Lists
The swremove command supports software and target selection from sepa‐
rate input files.
You can specify software and target selection lists with the -f and -t
options. Software and targets specified in these files are selected for
operation instead of (or in addition to) files listed in the command
line. (See the -f and -t options for more information.)
Additionally, the swremove interactive user interface reads a default
list of hosts on which to operate. The list is stored in:
/var/adm/sw/defaults.hosts the system-wide default
list of hosts
$HOME/.swdefaults.hosts the user-specific
default list of hosts
For each interactive command, target hosts containing roots or depots
are specified in separate lists (hosts and respectively.) The list of
hosts are enclosed in { } braces and separated by white space (blank,
tab and newline). For example:
swremove.hosts={hostA hostB hostC hostD hostE hostF}
swremove.hosts_with_depots={hostS}
Environment Variables
The environment variable that affects the swremove command is:
LANG Determines the language in which messages are dis‐
played. If LANG is not specified or is set to the
empty string, a default value of C is used. See the
lang(5) man page by typing man 5 sd for more informa‐
tion.
NOTE: The language in which the SWMGR agent and daemon
log messages are displayed is set by the system con‐
figuration variable script, /etc/rc.config.d/LANG.
For example, /etc/rc.config.d/LANG, must be set to
LANG=ja_JP.SJIS or LANG=ja_JP.eucJP to make the agent
and daemon log messages display in Japanese.
LC_ALL Determines the locale to be used to override any val‐
ues for locale categories specified by the settings of
LANG or any environment variables beginning with LC_.
LC_CTYPE Determines the interpretation of sequences of bytes of
text data as characters (e.g., single-versus multibyte
characters in values for vendor-defined attributes).
LC_MESSAGES
Determines the language in which messages should be
written.
LC_TIME Determines the format of dates (create_date and
mod_date) when displayed by swlist. Used by all util‐
ities when displaying dates and times in stdout, log‐
ging.
TZ Determines the time zone for use when displaying dates
and times.
Environment variables that affect scripts are:
SW_CATALOG
Holds the path to the Installed Products Database
(IPD), relative to the path in the SW_ROOT_DIRECTORY
environment variable. Note that you can specify a path
for the IPD using the installed_software_catalog
default option.
SW_CONTROL_DIRECTORY
Defines the current directory of the script being exe‐
cuted, either a temporary catalog directory, or a
directory within in the Installed Products Database
(IPD). This variable tells scripts where other con‐
trol scripts for the software are located (e.g. sub‐
scripts).
SW_CONTROL_TAG
Holds the tag name of the control_file being executed.
When packaging software, you can define a physical
name and path for a control file in a depot. This lets
you define the control_file with a name other than its
tag and lets you use multiple control file definitions
to point to the same file. A control_file can query
the SW_CONTROL_TAG variable to determine which tag is
being executed.
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_PATH A PATH variable which defines a minimum set of com‐
mands available for use in a control script (e.g.
/sbin:/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. The configure
script is only run when SW_ROOT_DIRECTORY is "/".
SW_SESSION_OPTIONS
Contains the pathname of a file containing the value
of every option for a particular command, including
software and target selections. This lets scripts
retrieve any command options and values other than the
ones provided explicitly by other environment vari‐
ables. For example, when the file pointed to by
SW_SESSIONS_OPTIONS is made available to a request
script, the targets option contains a list of soft‐
ware_collection_specs for all targets specified for
the command. When the file pointed to by SW_SES‐
SIONS_OPTIONS is made available to other scripts, the
targets option contains the single software_collec‐
tion_spec for the targets on which the script is being
executed.
SW_SOFTWARE_SPEC
This variable contains the fully qualified software
specification of the current product or fileset. The
software specification allows the product or fileset
to be uniquely identified.
Additional environment variables that affect scripts for swremove are:
SW_SESSION_IS_KERNEL
Indicates whether a kernel build is
scheduled for the current install/remove
session. A TRUE value indicates that the
selected kernel fileset is scheduled for
a kernel build and that changes to
/stand/system are required. A null
value indicates that a kernel build is
not scheduled and that changes to
/stand/system are not required.
The value of this variable is always
equal to the value of SW_SES‐
SION_IS_REBOOT.
SW_SESSION_IS_REBOOT
Indicates whether a reboot is scheduled
for a fileset selected for removal.
Because all Tru64 UNIX kernel filesets
are also reboot filesets, the value of
this variables is always equal to the
value of SW_SESSION_IS_KERNEL.
Signals
The swremove command catches the signals SIGQUIT,
SIGINT, and SIGUSR1. If these signals are
received, the command prints a message, sends a
Remote Procedure Call (RPC) to the agents to wrap
up after completion, and then exits.
The agent ignores SIGHUP, SIGINT, and SIGQUIT. It imme‐
diately exits gracefully after receiving SIGTERM,
SIGUSR1, or SIGUSR2. Killing the agent may leave corrupt
software on the system, and thus should only be done if
absolutely necessary. Note that when an SWMGR command is
killed, the agent does not terminate until completing the
task in progress.
The daemon ignores SIGHUP, SIGINT and SIGQUIT. It imme‐
diately exits gracefully after receiving SIGTERM and
SIGUSR2. After receiving SIGUSR1, it waits for comple‐
tion of a copy or remove from a depot session before
exiting, so that it can register or unregister depots if
necessary. Requests to start new sessions are refused
during this wait.
Each agent will complete the removal task (if the execu‐
tion phase has already started) before it wraps up. This
avoids leaving software in a corrupt state.
Terminal Support
For in-depth information about terminal support refer to:
· The Managing Tru64 UNIX Software With the
SysMan Software Manager manual
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 tar‐
get_selections.
2 The remove operation failed on some tar‐
get_selections.
DIAGNOSTICS
The swremove command writes to stdout, stderr, and to
specific log files.
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 mes‐
sages 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 at the host where the command was
invoked. They log 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 remove oper‐
ation 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 direc‐
tory). When removing available software (within a
depot), the swagent logs messages to the file swa‐
gent.log beneath the depot directory (e.g.
/var/spool/sw).
You can view command and target log files using the sd
command.
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 OSPXV:
swremove OSPXV,l/opt/OSPXV_v2.0
Remove the entire contents of a local depot:
swremove-d * @ /var/spool/sw
FILES
$HOME/.swdefaults
Contains the user-specific default values for
some or all SWMGR options. If this file does not
exist, SWMGR looks for user-specific defaults in
$HOME/.sw/defaults.
$HOME/.sw/defaults.hosts
Contains the user-specific default list of hosts
to manage.
$HOME/.sw/sessions/
Contains session files automatically saved by the
SWMGR commands, or explicitly saved by the user.
/usr/lib/sw/sys.defaults
Contains the master list of current SWMGR options
with their default values.
/var/adm/sw/
The directory which contains all of the config‐
urable and non-configurable data for SWMGR. This
directory is also the default location of log
files.
/var/adm/sw/defaults
Contains the active system-wide default values
for some or all SWMGR options.
/var/adm/sw/defaults.hosts
Contains the system-wide default list of hosts to
manage.
/var/adm/sw/getdate.templ
Contains the set of date/time templates used when
scheduling jobs.
/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.
SEE ALSOsd(4), sd(5), swacl(8), swagentd(8), swask(8), swcon‐
fig(8), swgettools(8), swinstall(8), swlist(8), swmod‐
ify(8), swpackage(8), swpackage(4), swreg(8), swver‐
ify(8), and the Managing Tru64 UNIX Software With the
SysMan Software Manager manual.
Compaq Computer Corporation swremove(8)