sd.5 (2011 03)

s
sd(5) sd(5)
Locking
SD commands use a common locking mechanism for reading and modifying both root directories and
software depots. This mechanism allows multiple readers but only one writer on a root or depot.
The SD commands which modify software in an (alternate) root directory are restricted from simultane-
ous modification using
fcntl() locking on the file
var/adm/sw/products/swlock
relative to the root directory (for example,
/var/adm/sw/products/swlock
).
The SD commands which modify software in a depot are restricted from simultaneous modification using
fcntl() locking on the file
catalog/swlock
relative to the depot directory (for example,
/var/spool/sw/catalog/swlock
).
All commands set
fcntl() read locks on roots and depots using the
swlock file mentioned above.
When a read lock is set, it prevents other SD commands from performing modifications (that is, from set-
ting write locks).
If an SD process has died prematurely and no other SD agents are running, you can remove the
swlock
file to unlock the root or depot.
RETURN VALUES
Each SD command invocation returns:
0 The sw<task> successfully completed.
1 The sw<task> failed on all target_selections.
2 The sw<task> failed on some target_selections.
DIAGNOSTICS
The
swconfig, swcopy, swinstall, swmodify, swpackage, swremove, and swverify com-
mands support a preview mode, where operation will proceed through the analysis of each
target_selection, then exit before the actual task is performed.
You can use the
sd interactive interface or the swjob command to view the current status of any job or
the controller and target log files.
Standard Output
When non-interactive, the commands write messages for significant events. These events include:
a begin and end task message,
a message for starting the task on each host, and
a message for completing the task on each host.
When the
verbose option is set, summary messages about the task are also sent to the standard out-
put.
Standard Error
When non-interactive, the commands also write messages for the following significant error events:
a message for each host failing analysis and
a message for each host failing the actual task.
Logging
All commands log major events on the host where the command was invoked. They log detailed events to
the
swagent log associated with each target_selection.
Command Log
The commands log messages to /var/adm/sw/sw<task>.log. (You can specify a different logfile
by modifying the logfile option.)
Target Log
A swagent process performs the actual swacl, swconfig, swcopy, swinstall, swremove,
and swverify operation at each target_selection. For operations on target root objects, the
swagent logs messages to the file var/adm/sw/swagent.log beneath the root directory (for
example, / or an alternate root directory). For operations on target depot objects, the swagent
logs messages to the file swagent.log beneath the depot directory (for example,
30 Hewlett-Packard Company 30 HP-UX 11i Version 3: March 2011