swreg(1M) — Hewlett-Packard Company
NAME
swreg − Register or unregister depots and roots
SYNOPSIS
swreg -l level [-u] [-v] [-x option=value] [-X option_file] [-f object_file] [-t target_file]
[-C session_file] [-S session_file] [objects_to_(un)register] [ @ target_selections]
Remarks:
SD-UX commands are included with the HP-UX Operating System and manage software on the local host only. To install and manage software simultaneously on multiple remote hosts (including PCs) from a central controller, you must purchase the HP OpenView Software Distributor (HP Prod. No. B1996AA) which provides extended software management, multi-site software distribution capabilities and distribution to PCs. While most of the information in this manual page applies to both SD-UX commands and the OpenView product, some applies only to the OpenView product. Where this is the case, you will see:
The following xxx applies only to HP OpenView Software Distributor
DESCRIPTION
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.
The possible types of roots that can be managed are roots, shared roots, and private roots. There is no default behavior for registering or unregistering roots.
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:
root The object to be registered is a root.
shroot The object to register is a shared root.
prroot The object to register is a private root.
depot The object to be registered is a depot.
-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.
-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 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.
-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.
-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 /.sw/sessions/. You can recall a session file with the -S option.
-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.
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
Defaults File
In addition to the standard options, several swreg 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:
swreg.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. The policy options that apply to swreg are:
level= Defines the default level of objects to list. The valid levels are: root, shroot, prroot, and depot.
logfile=/var/adm/sw/swreg.log
This is the default command log file for the swreg command.
logdetail=false[true]
The SD loglevel and logdetail options allow you to choose what amount of information you need in your logfiles - from no detail to complete information.
The loglevel=0 option allows no information to be written to the logfile. This essentially turns off the logfile process.
The logdetail=true[false] option controls the amount of detail written to the logfile. Here are the possible combinations of loglevel and logdetail options:
| Log Level | Log Detail | Information Included |
| loglevel=0 | No information is written to the logfile. |
|
| loglevel=1 | logdetail=false | Only POSIX events are logged; this is the default. |
| loglevel=1 | logdetail=true | POSIX detail as above plus task progress messages. Setting loglevel=1 is not necessary, it is the default. |
| loglevel=2 | logdetail=false | POSIX and file level messages only. Setting the logdetail=false option is not necessary. |
| loglevel=2 | logdetail=true | All information is logged. Setting both loglevel=2 and logdetail=true options is required. With this combination you may get the same logfile behavior as previous HP-UX 10.x releases. |
loglevel=1
Controls the log level for the events logged to the command logfile, and the target daemon logfile. A value of 0 prevents information from being logged. A value of 1 enables verbose logging to the logfiles. A value of 2 enables very verbose logging to the logfiles.
log_mesgid=0
Controls whether numeric identification numbers are prepended to logfile messages produced by SD. 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 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 logfile messages.
objects_to_register=
Defines the default objects to register or unregister. There is no supplied default (see target_directory above). If there is more than one object, they must be separated by spaces.
rpc_binding_info=ncadg_ip_udp:[2121]
Defines the protocol sequence and endpoint 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.
rpc_timeout=7
For HP OpenView Software Distributor the default is 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 the swagentd. Each value is approximately twice as long as the preceding value. A value of 5 is about 30 seconds for ncadg_ip_udp.
select_local=true
If no target_selections are specified, select the local host as the target of the command.
target_directory=/var/spool/sw
Defines the location of the depot object to register if no objects are specified.
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 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). A value of 1 enables verbose messaging to stdout.
Session File
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 automatically saved to the file $HOME/.sw/sessions/swinstall{swcopy}.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 /.sw/sessions/.
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
The swreg program sets the following environment variable, which is used by the software control scripts being executed.
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 lang(5) 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.
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 target_selections.
2 The register or unregister operation failed on some target_selections.
DIAGNOSTICS
The swreg command writes to stdout, stderr, and to the daemon logfile.
Standard Output
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
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 associated 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
The following example applies only to HP OpenView Software Distributor
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
LIMITATIONS
The SunOS and SD-UX versions of swreg do not support the registration or unregistration of software depots on remote targets.
For PCs (HP OpenView Software Distributor), the swreg command only operates on a single depot, configured at the PC Controller.
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/host_object
The file which stores the list of depots registered at the local host.
/usr/lib/sw/sys.defaults
Contains the master list of current SD options (with their default values).
/var/adm/sw/defaults
Contains the active 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.
PC FILES
The following applies only to HP OpenView Software Distributor
...\SD\DATA\HOST_OBJ
The file which stores the list PC depot registered with the PC Controller.
AUTHOR
swreg was developed by the Hewlett-Packard Company.
SEE ALSO
sd(4), sd(5), swacl(1M), swagentd(1M), swcluster(1M), swconfig(1M), swcopy(1M), swgettools(1M), swinstall(1M), swjob(1M), swlist(1M), swmodify(1M), swpackage(1M), swpackage(4), swremove(1M), swverify(1M), update(1M), and the HP OpenView Software Distributor Administrator’s Guide or Managing HP-UX Software with SD-UX manuals.
Hewlett-Packard Company — HP-UX Release 10.20: July 1996