swreg(1M) swreg(1M)
Hewlett-Packard Company
NAME [Toc] [Back]
swreg - register or unregister depots and roots
SYNOPSIS [Toc] [Back]
swreg -l level [-u] [-v] [-C session_file] [-f object_file]
[-S session_file] [-t target_file] [-x option=value] [-X
option_file] [objects_to_(un)register] [@ target_selections]
Remarks [Toc] [Back]
+ This command supports operations on remote systems. See Remote
Operation below.
+ For an overview of all SD commands, see the sd(5) man page by
typing man 5 sd on the command line.
DESCRIPTION [Toc] [Back]
The swreg command controls the visibility of depots and roots to users
who are performing software management tasks. It must be used to
register 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
registered depot.
+ Registering a depot created directly by swpackage.
+ Unregistering a depot without removing it with swremove.
Remote Operation [Toc] [Back]
You can enable SD to manage software on remote systems. To let the
root user from a central SD controller (also called the central
management server or manager node) perform operations on a remote
target (also called the host or agent):
1) Install a special HP ServiceControl Manager fileset on the remote
systems. This enables remote operations by automatically setting
up the root, host, and template Access Control Lists (ACLs) on the
remote machines and permitting root access from the controller
system. To install the fileset, run the following command on each
remote system:
swinstall -s controller:/var/opt/mx/depot11 AgentConfig.SD-CONFIG
Hewlett-Packard Company - 1 - HP-UX 11i Version 2.0
swreg(1M) swreg(1M)
Hewlett-Packard Company
NOTES:
+ controller is the name of the central management server.
+ If the target is running HP-UX 10.20, use the same command but
substitute depot10 for depot11.
+ Targets previously set up by SD/OV to be managed by this
controller do not need this step.
+ SD does not require any other ServiceControl Manager filesets.
2) (Optional) swinstall, swcopy, and swremove have enhanced GUI
interfaces for remote operations. Enable the enhanced GUIs by
creating the .sdkey file on the controller. Use this command:
touch /var/adm/sw/.sdkey
NOTES:
+ This step is not required when you use SD from within the HP
ServiceControl Manager.
+ See sd(5), swinstall(1M), swcopy(1M), swjob(1M), swlist(1M),
or swremove(1M) for more information on interactive
operations.
NOTE: You can also set up remote access by using swacl directly on the
remote machines to grant root or non-root access to users from the
controller system.
Options [Toc] [Back]
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.
shroot The object to register is a shared root
(HP-UX 10.X only).
prroot The object to register is a private root
(HP-UX 10.X only).
-u Causes swreg to unregister the specified objects
instead of registering them.
-v Turns on verbose output to stdout. (The swreg
logfile is not affected by this option.) Verbose
output is enabled by default, see the verbose
option below.
Hewlett-Packard Company - 2 - HP-UX 11i Version 2.0
swreg(1M) swreg(1M)
Hewlett-Packard Company
-C session_file
Save the current options and operands to
session_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 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
session_file. You can save session information 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 target_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 specified with the -X option).
Multiple -x options can be specified.
-X option_file Read the session options and behaviors from
option_file.
Operands [Toc] [Back]
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 [Toc] [Back]
Default Options
In addition to the standard options, several SD behaviors and policy
options can be changed by editing the default values found in:
/var/adm/sw/defaults the system-wide default values.
Hewlett-Packard Company - 3 - HP-UX 11i Version 2.0
swreg(1M) swreg(1M)
Hewlett-Packard Company
$HOME/.swdefaults the user-specific default values.
Values must be specified in the defaults file using this syntax:
[command_name.]option=value
The optional command_name prefix denotes one of the SD 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:
command -x option=value
command -X option_file
The following list describes keywords supported by the swreg command.
If a default value exists, it is listed after the "=".
admin_directory=/var/adm/sw (for normal mode)
admin_directory=/var/home/LOGNAME/sw (for nonprivileged mode)
The location for SD logfiles and the default parent
directory for the installed software catalog. The
default value is /var/adm/sw for normal SD operations.
When SD operates in nonprivileged mode (that is, when
the run_as_superuser default option is set to true):
+ The default value is forced to /var/home/LOGNAME/sw.
+ The path element LOGNAME is replaced with the name
of the invoking user, which SD reads from the system
password file.
+ If you set the value of this option to HOME/path, SD
replaces HOME with the invoking user's home
directory (from the system password file) and
resolves path relative to that directory. For
example, HOME/my_admin resolves to the my_admin
directory in your home directory.
SD's nonprivileged mode is intended only for managing
applications that are specially designed and packaged.
This mode cannot be used to manage the HP-UX operating
system or patches to it. For a full explanation of
nonprivileged SD, see the Software Distributor
Administration Guide, available at the
http://docs.hp.com web site.
See also the run_as_superuser option.
Hewlett-Packard Company - 4 - HP-UX 11i Version 2.0
swreg(1M) swreg(1M)
Hewlett-Packard Company
distribution_target_directory=/var/spool/sw
Defines the location of the depot object to register 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 specified
target hosts.
root All alternate roots.
shroot All registered shared roots (HP-UX 10.X
only).
prroot All registered private roots (HP-UX
10.X only).
log_msgid=0
Adds numeric identification numbers at the beginning of
SD logfile messages:
0 (default) No identifiers are attached to messages.
1 Adds identifiers to ERROR messages only.
2 Adds identifiers to ERROR and WARNING messages.
3 Adds identifiers to ERROR, WARNING, and NOTE
messages.
4 Adds identifiers to ERROR, WARNING, NOTE, and
certain other informational messages.
logfile=/var/adm/sw/swreg.log
Specifies the default command log file for the swreg
command.
logdetail=false[true]
The logdetail option 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 sd(5) man page for additional
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 logdetail option. (See
also logdetail.) A value of
0 provides no information to the logfile.
1 enables verbose logging to the logfiles.
2 enables very verbose logging to the logfiles.
Hewlett-Packard Company - 5 - HP-UX 11i Version 2.0
swreg(1M) swreg(1M)
Hewlett-Packard Company
objects_to_register=
Defines the default objects to register or unregister.
There is no supplied default (see
distribution_target_directory above). If there is more
than one object, they must be separated by spaces.
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 which the other commands
use to contact the daemon. If the connection fails for
one protocol sequence, the next is attempted. SD
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 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.
run_as_superuser=true
This option controls SD's nonprivileged mode. This
option is ignored (treated as true) when the invoking
user is super-user.
When set to the default value of true, SD operations
are performed normally, with permissions for operations
either granted to a local super-user or set by SD ACLs.
(See swacl(1M) for details on ACLs.)
When set to false and the invoking user is local and is
not super-user, nonprivileged mode is invoked:
+ Permissions for operations are based on the user's
file system permissions.
+ SD ACLs are ignored.
+ Files created by SD have the uid and gid of the
invoking user, and the mode of created files is set
Hewlett-Packard Company - 6 - HP-UX 11i Version 2.0
swreg(1M) swreg(1M)
Hewlett-Packard Company
according to the invoking user's umask.
SD's nonprivileged mode is intended only for managing
applications that are specially designed and packaged.
This mode cannot be used to manage the HP-UX operating
system or patches to it. For a full explanation of
nonprivileged SD, see the Software Distributor
Administration Guide, available at the
http://docs.hp.com web site.
See also the admin_directory option.
select_local=true
If no target_selections are specified, select the
default distribution_target_directory of the local host
as the target_selection for the command.
targets= Defines the default target 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 spaces.
verbose=1 Controls the verbosity of the swreg 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.
Session File [Toc] [Back]
Each invocation of the swreg command defines a registration session.
The invocation options, source information, software selections, and
target hosts are saved before the installation or copy task actually
commences. This lets you re-execute 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 absolute path for the session file. If you do not specify
a directory, the default location for a session file is
$HOME/.sw/sessions/.
To re-execute a session file, specify the session file as the argument
for the -S session__file option of swreg.
Hewlett-Packard Company - 7 - HP-UX 11i Version 2.0
swreg(1M) swreg(1M)
Hewlett-Packard Company
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 [Toc] [Back]
SD programs are affected by external environment variables.
SD 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 HP-UX operating system and modifying the HP-UX
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
information.
NOTE: The language in which the SD agent and daemon log
messages are displayed is set by the system
configuration 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 values
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 [Toc] [Back]
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 stdout,
stderr, and logging.
TZ Determines the time zone for use when displaying dates
and times.
Hewlett-Packard Company - 8 - HP-UX 11i Version 2.0
swreg(1M) swreg(1M)
Hewlett-Packard Company
Signals [Toc] [Back]
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 [Toc] [Back]
The swreg command returns:
0 The objects_to_register were successfully (un)registered.
1 The register or unregister operation failed on all
target_selections.
2 The register or unregister operation failed on some
target_selections.
DIAGNOSTICS [Toc] [Back]
The swreg command writes to stdout, stderr, and to the daemon logfile.
Standard Output [Toc] [Back]
The swreg command writes messages for significant events. These
include:
+ a begin and end session message,
+ selection and execution task messages for each
target_selection.
Standard Error [Toc] [Back]
The swreg command writes messages for all WARNING and ERROR conditions
to stderr.
Logging [Toc] [Back]
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 associated with each target_selection.
EXAMPLES [Toc] [Back]
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 [Toc] [Back]
$HOME/.swdefaults
Contains the user-specific default values for some or all SD
Hewlett-Packard Company - 9 - HP-UX 11i Version 2.0
swreg(1M) swreg(1M)
Hewlett-Packard Company
options.
/usr/lib/sw/sys.defaults
Contains the master list of current SD options with their
default values.
/var/adm/sw/
The directory which contains all of the configurable and nonconfigurable
data for SD. This directory is also the default
location of logfiles.
/var/adm/sw/defaults
Contains the active system-wide default values for some or all
SD options.
/var/adm/sw/host_object
The file which stores the list of depots registered at the
local host.
AUTHOR [Toc] [Back]
swreg was developed by the Hewlett-Packard Company.
SEE ALSO [Toc] [Back]
swacl(1M), swagentd(1M), swask(1M), swconfig(1M), swcopy(1M),
swinstall(1M), swjob(1M), swlist(1M), swmodify(1M), swpackage(1M),
swremove(1M), swverify(1M), install-sd(1M), sd(4), swpackage(4),
sd(5),
Software Distributor Administration Guide, available at
http://docs.hp.com.
SD customer web site at http://software.hp.com/SD_AT_HP/.
Hewlett-Packard Company - 10 - HP-UX 11i Version 2.0 [ Back ] |