swreg(8)swreg(8)NAMEswreg - register or unregister depots and roots
SYNOPSISswreg-l level [-u] [-v] [-C session_file] [-f object_file] [-S ses‐
sion_file] [-t target_file] [-x option=value] [-X option_file]
[objects_to_(un)register] [@ 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 swreg command controls the visibility of depots and roots to users
who are performing software management tasks. It must be used to reg‐
ister depots created by swpackage.
By default, the swcopy command registers newly created depots. By
default, the swinstall command registers newly created alternate roots
(the root, "/", is not automatically registered). The swremove command
unregisters a depot, or root, when or if the depot is empty. The user
invokes swreg to explicitly (un)register a depot when the automatic
behaviors of swcopy, swinstall, swpackage, and swremove do not suffice.
For example:
· making a CD-ROM or other removable media available as a reg‐
istered depot.
· registering a depot created directly by swpackage.
· unregistering a depot without removing it with swremove.
Options
The swreg command supports the following options:
-l level Specify the level of the object to register or
unregister. Exactly one level must be specified.
The supported levels are:
depot The object to be registered is a depot.
root The object to be registered is a root.
-u Causes swreg to
unregister the spec‐
ified objects
instead of register‐
ing them.
-v Turns on verbose
output to stdout.
(The swreg logfile
is not affected by
this option.) Ver‐
bose output is
enabled by default,
see the verbose
option below.
-C session_file
Save the current
options and operands
to session_file.
You can enter a rel‐
ative or absolute
path with the file
name. The default
directory for ses‐
sion files is
$HOME/.sw/sessions/.
You can recall a
session file with
the -S option.
-f object_file Read the list of
depot or root
objects to register
or unregister from
object_file instead
of (or in addition
to) the command
line.
-S session_file
Execute swreg based
on the options and
operands saved from
a previous session,
as defined in ses‐
sion_file. You can
save session infor‐
mation to a file
with the -C option.
-t target_file Read the list of
target hosts on
which to register
the depot or root
objects from tar‐
get_file instead of
(or in addition to)
the command line.
-x option=value
Set the session
option to value and
override the default
value (or a value in
an alternate
option_file speci‐
fied with the -X
option). Multiple
-x options can be
specified.
-X option_file Read the session
options and behav‐
iors from
option_file.
Operands
The swreg command supports the following
syntax for each object_to_register:
path
Each operand specifies an object to be
registered or unregistered.
The swreg command supports the following
syntax for each target_selection:
[host]
EXTERNAL INFLUENCES
Default Options
In addition to the standard options, sev‐
eral SWMGR behaviors and policy options
can be changed by editing the default val‐
ues found in:
/var/adm/sw/defaults the
sys‐
tem-
wide
default
val‐
ues.
$HOME/.swdefaults the
user-
spe‐
cific
default
val‐
ues.
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 list describes keywords sup‐
ported by the swreg command. If a default
value exists, it is listed after the "=".
distribution_target_direc‐
tory=/var/spool/sw
Defines the location of
the depot object to reg‐
ister if no objects are
specified and the -l
option is specified.
level= Defines the default level
of objects to register or
unregister. The valid
levels are:
depot Depots
which
exist at
the speci‐
fied tar‐
get hosts.
root All alter‐
nate
roots.
logfile=/var/adm/sw/swreg.log
This is the default com‐
mand log file for the
swreg command.
logdetail=false[true]
The logdetail option con‐
trols 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 infor‐
mation) to the log file.
This information is in
addition to log informa‐
tion controlled by the
loglevel option. See the
sd(5) man page for addi‐
tional information by
typing man 5 sd.
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 logde‐
tail option. (See also
logdetail.) A value of
0 provides no informa‐
tion to the logfile.
1 enables verbose log‐
ging to the logfiles.
2 enables very verbose
logging to the log‐
files.
log_msgid=0
Controls whether numeric
identification numbers
are prepended to logfile
messages produced by
SWMGR. A value of 0
(default) indicates no
such identifiers are
attached. Values of 1-4
indicate that identifiers
are attached to messages:
1 applies to ERROR mes‐
sages only
2 applies to ERROR and
WARNING messages
3 applies to ERROR,
WARNING, and NOTE mes‐
sages
4 applies to ERROR,
WARNING, NOTE, and
certain other logfile
messages.
objects_to_register=
Defines the default
objects to register or
unregister. There is no
supplied default (see
distribution_tar‐
get_directory above). If
there is more than one
object, they must be sep‐
arated by spaces.
rpc_bind‐
ing_info=ncacn_ip_tcp:[2121]
ncadg_ip_udp:[2121]
Defines the protocol
sequence(s) and end‐
point(s) on which the
daemon listens and which
the other commands use to
contact the daemon. If
the connection fails for
one protocol sequence,
the next is attempted.
SWMGR supports both the
tcp (ncacn_ip_tcp:[2121])
and udp
(ncadg_ip_udp:[2121])
protocol sequence on most
platforms.
See the sd(5) man page by
typing man 5 sd for
details on specifying
this option.
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 will give
faster recognition on
attempts to contact hosts
that are not up or are
not running swagentd.
Each value is approxi‐
mately 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 notice‐
able impact when using
the ncacn_ip_tcp protocol
sequence.
select_local=true
If no target_selections
are specified, select the
default distribution_tar‐
get_directory of the
local host as the tar‐
get_selection for the
command.
targets= Defines the default tar‐
get hosts on which to
register or unregister
the specified root or
depot objects. There is
no supplied default (see
select_local above). If
there is more than one
target selection, they
must be separated by spa‐
ces.
verbose=1 Controls the verbosity of
the swreg output (std‐
out). A value of
0 disables output to
stdout. (Error and
warning messages are
always written to
stderr).
1 enables verbose mes‐
saging to stdout.
Session File
Each invocation of the swreg command
defines a registration session. The invo‐
cation options, source information, soft‐
ware selections, and target hosts are
saved before the installation or copy task
actually commences. This lets you re-exe‐
cute the command even if the session ends
before proper completion.
Each session is saved to the file
$HOME/.sw/sessions/swreg.last. This file
is overwritten by each invocation of
swreg.
You can also save session information to a
specific file by executing swreg with the
-C session__file option.
A session file uses the same syntax as the
defaults files. You can specify an abso‐
lute path for the session file. If you do
not specify a directory, the default loca‐
tion for a session file is $HOME/.sw/ses‐
sions/.
To re-execute a session file, specify the
session file as the argument for the -S
session__file option of swreg.
Note that when you re-execute a session
file, the values in the session file take
precedence over values in the system
defaults file. Likewise, any command line
options or parameters that you specify
when you invoke swreg take precedence over
the values in the session file.
Environment Variables
SWMGR programs are affected by external
environment variables.
SWMGR programs that execute control
scripts set environment variables for use
by the control scripts.
In addition, swinstall sets environment
variables for use when updating the Tru64
UNIX operating system and modifying the
Tru64 UNIX configuration.
The environment variable that affects the
swreg command is:
LANG Determines the language
in which messages are
displayed. If LANG is
not specified or is set
to the empty string, a
default value of C is
used. See the lang(5)
man pages by typing man 5
lang for more informa‐
tion.
NOTE: The language in
which the SWMGR agent and
daemon log messages are
displayed is set by the
system configuration
variable script,
/etc/rc.config.d/LANG.
For example, /etc/rc.con‐
fig.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 Japa‐
nese.
LC_ALL Determines the locale to
be used to override any
values for locale cate‐
gories specified by the
settings of LANG or any
environment variables
beginning with LC_.
LC_CTYPE Determines the interpre‐
tation of sequences of
bytes of text data as
characters (e.g., single-
versus multibyte charac‐
ters in values for ven‐
dor-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
utilities when displaying
dates and times in std‐
out, logging.
TZ Determines the time zone
for use when displaying
dates and times.
Signals
The swreg command catches the signals
SIGQUIT and SIGINT. If these signals are
received, swreg prints a message, sends a
Remote Procedure Call (RPC) to the daemons
to wrap up, and then exits.
RETURN VALUES
The swreg command returns:
0 The objects_to_register were
successfully (un)registered.
1 The register or unregister
operation failed on all tar‐
get_selections.
2 The register or unregister
operation failed on some tar‐
get_selections.
DIAGNOSTICS
The swreg command writes to stdout,
stderr, and to the daemon logfile.
Standard Output
The swreg command writes messages for sig‐
nificant events. These include:
· a begin and end session message,
· selection and execution task mes‐
sages for each target_selection.
Standard Error
The swreg command writes messages for all
WARNING and ERROR conditions to stderr.
Logging
The swreg command logs summary events at
the host where the command was invoked.
It logs events about each (un)register
operation to the swagentd logfile associ‐
ated with each target_selection.
EXAMPLES
Create a new depot with swpackage, then
register it with swreg:
swpackage -s psf -d /var/spool/sw
swreg-l depot /var/spool/sw
Unregister the default depot at several
hosts:
swreg-u -l depot /var/spool/sw @ hostA hostB hostC
Unregister a specific depot at the local
host:
swreg-u -l depot /cdrom
FILES
$HOME/.swdefaults
Contains the user-specific default
values for some or all SWMGR
options.
/usr/lib/sw/sys.defaults
Contains the master list of cur‐
rent SWMGR options with their
default values.
/var/adm/sw/
The directory which contains all
of the configurable and non-con‐
figurable data for SWMGR. This
directory is also the default
location of logfiles.
/var/adm/sw/defaults
Contains the active system-wide
default values for some or all
SWMGR options.
/var/adm/sw/host_object
The file which stores the list of
depots registered at the local
host.
SEE ALSOsd(4), sd(5), swacl(8), swagentd(8),
swask(8), swconfig(8), swgettools(8),
swinstall(8), swlist(8), swmodify(8),
swpackage(8), swpackage(4), swremove(8),
swverify(8), and the Managing Tru64 UNIX
Software With the SysMan Software Manager
manual.
Compaq Computer Corporation swreg(8)