admresource(1M) DG/UX R4.11MU05 admresource(1M)
NAME
admresource - manage resource databases
SYNOPSIS
admresource -o publish [ -D domain ] -t type [ -O options ] resource
...
admresource -o retract [ -D domain ] [ -t type ] [ -s subscribers ]
resource
admresource -o register [ -D domain ] [ -t type ] -s subscribers [
resource ... ]
admresource -o deregister [ -D domain ] [ -t type ] [ -s subscribers
] [ resource ... ]
admresource -o subscribe [ -D domain ] [ -t type ] [ -O options ] [
-p publisher ] [ resource ...
admresource -o cancel [ -D domain ] [ -t type ] [ -O options ] [ -p
publisher ] [ resource ... ]
admresource -o modify [ -D domain ] [ -t type ] [ -O options ] [ -N
name ] [ -S ] resource
admresource -o notify -r reason [ -D domain ] [ -t type ] [ -ab ] [
-s subscribers ] [ resource ... ]
admresource -o list [ -D domain ] [ -t type ] [ -q | -v ] [ -P | -R |
-S | -N ] [ resource ... ]
DESCRIPTION
The admresource command manages resource databases required by the
publish/subscribe mechanism. Resources are managed objects that are
potentially shared with other nodes; management (or "ownership") of a
resource is the responsibility of a single node, although in the
future it may be possible for two or more nodes to claim "joint-
custody" of certain resources.
A resource is made available for sharing by publishing it; similarly,
nodes register interest in published resources by subscribing to
them. When a resource is published, its owner notifies all
subscribing hosts of its existence. When a published resource is
modified, its owner notifies all subscribing hosts of the change.
Most of admresource's operations will invoke any associated
callbacks, if registered. See admcallback(1M) for details.
The admresource command manages several databases:
published : the database of resources published by this
host.
subscribed : the database of resources from other hosts
to which this host subscribes.
subscribers: the hosts which have subscribed to
resources from this host.
Operations
publish Make the named resources available for use by other hosts
by adding them to the database of published resources and
invoking
admcallback -o call -t <type> -r publish
-O <options>
retract Withdraw previously-published resources from use by other
hosts by removing them from the database of published
resources and invoking
admcallback -o call -t <type> -r retract
-O <options>
register Add the indicated subscribers to the list of hosts to
notify (via the -o notify operation) of new or changed
resources and invoke
admcallback -o call -t <type> -r register
-O 'subscribers=<subscriber list>'
This operation produces a warning message if any of the
subscribers cannot be contacted.
deregister
Remove the indicated subscribers from the list of hosts to
notify (via the -o notify operation) of new or changed
resources and invoke
admcallback -o call -t <type> -r deregister
-O 'subscribers=<subscriber list>'
subscribe Share resources published by other hosts by adding them to
the database of subscribed resources and invoking
admcallback -o call -t <type> -r subscribe
-O <options>
Note that callbacks will only be invoked if -O <options> is
supplied to admresource.
This operation is idempotent and may be used to synchronize
possibly out-of-date databases.
cancel Quit sharing resources published by other hosts by removing
them from the database of subscribed resources and invoking
admcallback -o call -t <type> -r cancel
-O <options>
modify Change one or more attributes of a published resource by
modifying the database of published resources (if this host
publishes the resource) or the database of subscribed
resources (if this host subscribes to the resource), and
invoking
admcallback -o call -t <type> -r modify
-O <options>
notify Notify subscribers of new or changed resources by invoking
admresource -o <reason> with the appropriate options on
each host. By default, all subscribers in the specified
domain are notified.
Currently, admresource understands subscribe, cancel, and
modify as reasons for notification. If any other reason is
specified, admresource foregoes notification and simply
invokes registered callbacks on the interested subscribers.
list Display shared resources. The -S option displays only
resources to which the local host subscribes. The -P
option displays only resources published by the local host.
Options
-a Abort the operation if any of the subscribers cannot be
contacted. By default, commands are retried (via
idisched(1M)).
-b Perform the notification in the background (via
idisched(1M)).
-D domain Operate only on hosts and resources in the specified
administrative domain. Currently, this option is ignored.
-N new-name
When used with -o modify, change the name of resource to
new-name.
-N When used with -o list, display the list of subscribers
that would be contacted if -o notify was specified.
-O options
Associate options with this resource. Options should be of
the form
variable=value
and must be valid sh(1) code. These options are shared
with subscribers.
-p publisher
Operate only on resources associated with publisher.
-P List only resources which this host publishes.
-q Do not display headers when listing a database.
-r reason Indicate why a notify operation is being performed.
-s subscribers
Operate only on resources associated with nodes in
subscribers. Subscribers is a list of values and should be
specified as follows:
node-1,node-2,node-3,...,node-n
-S When used with -o list, list only resources to which this
host subscribes; when used with -o modify, modify an object
in the subscribed (rather than published) database.
-t type Operate only on resources of type type. By default,
operations apply to all resources.
-v Display headers when listing a database. This option is
enables by default.
See admcallback(1M) for a description of the syntax for
type and options. Use admcallback -o list to see the list of useful
values for type. Currently, type may be one of filesystem or
printer; reason may be one of subscribe, cancel, or modify.
The resource name must be a sequence of characters from the set
a-z A-Z 0-9 . - _ /
EXAMPLES
Below are several examples illustrating how admresource can be used
to maintain consistent databases throughout a cluster.
To share a particular NFS file system, owned by system P and shared
by systems A, B, and C, follow these steps:
a. Make sure that each of A, B, and C subscribe to
file systems from P. Perform this command on A,
B, and C:
A# admresource -o subscribe -p P -t filesystem
b. Make sure the subscribers are registered on system P:
P# admresource -o register -s A,B,C -t filesystem
c. Add and export the NFS file system on P:
P# admfilesystem -o add -f /dev/dsk/my_fs -e
-xq /pdd/P
d. Publish the file system from P:
P# admresource -o publish -t filesystem
-O 'source=P:/pdd/P mountpnt=/pdd/P
fstaboptions=rw,hard,bg' /pdd/P
e. Notify the subscribers of the new file system:
P# admresource -o notify -r subscribe -t filesystem
-O 'source=P:/pdd/P mountpnt=/pdd/P
fstaboptions=rw,hard,bg' /pdd/P
This example assumes that the callback database for file system
management is already set up on each host.
To synchronize a new subscriber, system S, with all resources of all
types already published from system P, follow these steps:
a. Subscribe to system P from system S:
S# admresource -o subscribe -p P
b. Register S as a subscriber on P:
P# admresource -o register -s S
c. Notify S of all the currently published resources:
P# admresource -o notify -r subscribe -s S
FILES
Admresource references databases stored in the directory
/etc/sysadm/publish.
DIAGNOSTICS
Errors
- A database does not exist.
- A database entry does not exist.
- A database entry already exists.
- An attempt to contact a subscriber failed.
- A resource name contains illegal characters.
Exit Codes
0 The operation was successful.
1 The operation was unsuccessful.
2 The operation failed due to access restrictions.
3 There was an error in the command line.
SEE ALSO
sysadm(1), admcallback(1M), idi(4).
Licensed material--property of copyright holder(s)