ASSIGN(1) COMMAND REFERENCE ASSIGN(1)
NAME
assign, deassign - assign or deassign devices in a class
SYNOPSIS
assign [ -f ] [ -r ] class ...
deassign class ...
DESCRIPTION
The assign and deassign commands use the file
/etc/assign.classes to determine what devices are assignable
and what class(es) they belong to. Assignable devices are
divided into classes (e.g. mag tape drive 0) so that all
versions of a device can be assigned together (raw and
cooked versions for example). These classes, in turn, may
be grouped into generic classes (e.g. any mag tape drive).
These groupings are set up by the system administrator, and
thus are installation dependant.
Assign changes the owner of the device(s) in the requested
class to the current UID. If the requested class is a
generic one, the first specific class found that is
available is used. The device(s) assume protection mode of
read and write by owner only. If more than one class is
listed, the first one that contains an assignable device is
used and the remainder are ignored. This allows the user to
specify the order that classes will be checked.
The name of the specific class that was assigned is typed on
standard output. If no devices are available in the
class(es) desired, an error message is typed on standard
error, and the program exits with return code 1, unless the
-r option is used.
Deassign undoes the work of assign by releasing the device
to the assignable pool. The special form deassign all will
deassign all devices you have.
All devices are considered available to the superuser. If
the log file does not exist, logging is ignored. The owner
of devices that are free for assignment is the owner of the
file /etc/assign.classes.
OPTIONS
-f Does not prompt whether to deassign when used in
conjunction with the -r flag. This allows assign -r to
be used in a shell script.
-r Reassigns the devices of a requested class after
determining that no requested class is available
without overriding an assignment. Mail is sent to the
user with the previous assignment. Unless used with
the -f flag, a prompt is issued to determine whether to
Printed 10/17/86 1
ASSIGN(1) COMMAND REFERENCE ASSIGN(1)
override the previous assignment of the device(s).
EXAMPLES
assign mt1 mt0
would try to assign class mt1, and would try for mt0 only if
mt1 is unavailable.
Typical usage might be (using the Bourne shell):
mt=`assign mt`
while test ! "${mt}"
do sleep 120; mt=`assign mt`; done
do whatever needs doing on the mag tape using
device names:
/dev/${mt}0 for 800 BPI cooked
/dev/${mt}1 for 1600 BPI cooked
/dev/r${mt}0 for 800 BPI raw
/dev/r${mt}1 for 1600 BPI raw
/dev/n${mt}0 for 800 BPI cooked, no rewind on
close
/dev/n${mt}1 for 1600 BPI cooked, no rewind on
close
/dev/nr${mt}0 for 800 BPI raw, no rewind on close
/dev/nr${mt}1 for 1600 BPI raw, no rewind on close
This assumes that the system administrator has set up a
generic class name in /etc/assign.classes of mt and a
specific class names of form mt0, mt1, mt2 ... and that the
tape versions of the tape drives are named /dev/mt00,
/dev/mt01, /dev/rmt00 ... The shell variable mt will have
the name of the assigned tape drive (e.g. mt0, mt1, mt2
...)
FILES
/etc/assign.classes System file containing class
specifications
/usr/adm/devicelog Log file for device usage
RETURN VALUE
[NO_ERRS] Command completed without error.
[1] No available class was found.
[USAGE] Incorrect command line syntax. Execution
terminated.
[NP_WARN] An error warranting a warning message
occurred. Execution continues.
Printed 10/17/86 2
ASSIGN(1) COMMAND REFERENCE ASSIGN(1)
[NP_ERR] An error occurred that was not a system
error. Execution terminated.
[P_WARN] A system error occurred. Execution continues.
See intro(2) for more information on system
errors.
[P_ERR] A system error occurred. Execution
terminated. See intro(2) for more
information on system errors.
SEE ALSO
assign.classes(5).
Printed 10/17/86 3
%%index%%
na:72,92;
sy:164,226;
de:390,2130;
op:2520,597;3261,62;
ex:3323,1477;
fi:4800,260;
rv:5060,387;5591,455;
se:6046,142;
%%index%%000000000151