ugh.book

(singke) #1

234 System Administration


for each kind of tape drive interface available, yielding names like /dev/mt,
/dev/xt, and /dev/st. Change the interface and your sysadmin earns a few
more dollars changing all his dump scripts. Dump scripts? Yes, every Unix
site uses custom scripts to do their dumps, because vendors frequently use
different tape drive names, and no one can remember the proper options to
make the dump program work. So much for portability. To those names,
Unix appends a unit number, like /dev/st0 or /dev/st1. However, don’t let
these numbers fool you; /dev/st8 is actually /dev/st0, and /dev/st9 is
/dev/st1. The recording density is selected by adding a certain offset to the
unit number. Same drive, different name. But wait, there’s more! Prefix the
name with an “n” and it tells the driver not to rewind the tape when it is
closed. Prefix the name with an “r” and it tells the driver it is a raw device
instead of a block mode device. So, the names /dev/st0, /dev/rst0,
/dev/nrst0, /dev/nrst8, and /dev/st16 all refer to the same device. Mind
boggling, huh?

Because Unix doesn’t provide exclusive access to devices, programs play
“dueling resources,” a game where no one ever comes out alive. As a sim-
ple example, suppose your system has two tape drives, called /dev/rst0 and
/dev/rst1. You or your sysadmin may have just spent an hour or two creat-
ing a tar or dump tape of some very important files on drive 0. Mr. J. Q.
Random down the hall has a tape in drive 1. He mistypes a 0 instead of a 1
and does a short dump onto drive 0, destroying your dump! Why does this
happen? Because Unix doesn’t allow a user to gain exclusive access to a
tape drive. A program opens and closes the tape device many times during
a dump. Each time the file is closed, any other user on the system can use
the tape drive. Unix “security” controls are completely bypassed in this
manner. A tape online with private files can be read by anybody on the sys-
tem until taken off the drive. The only way around this is to deny every-
body other than the system operator access to the tape drive.

Configuration Files


Sysadmins manage a large assortment of configuration files. Those allergic
to Microsoft Windows with its four system configuration files shouldn’t
get near Unix, lest they risk anaphylactic shock. Unix boasts dozens of
files, each requiring an exact combination of letters and hieroglyphics for
proper system configuration and operation.

Each Unix configuration file controls a different process or resource, and
each has its own unique syntax. Field separators are sometimes colons,
sometimes spaces, sometimes (undocumented) tabs, and, if you are very
Free download pdf