home
***
CD-ROM
|
disk
|
FTP
|
other
***
search
/
Usenet 1994 October
/
usenetsourcesnewsgroupsinfomagicoctober1994disk2.iso
/
misc
/
volume21
/
uoodoo
/
part01
/
README
< prev
next >
Wrap
Text File
|
1991-07-27
|
7KB
|
156 lines
WHAT IT IS
uoodoo - build a directory of symbolic links so that each user's home
directory can be referenced as "/u/user".
Report bugs to sls@cs.duke.edu.
HOW IT WORKS
uoodoo (rhymes with voodoo) will create and update a directory of symbolic
links which point to users' home directories. By using a scheme where home
directories are referenced indirectly, a user's home directory may be moved
without requiring a user to make any changes to his code. Instead, the
symbolic link which points to a user's home directory is changed.
Normal operation of uoodoo uses /u as the directory which contains the
symbolic links. First uoodoo reads in the user information via the
getpwent(3) library routine and stores the login-id and the user's home
directory in an internal table. The argument directories are then searched
for entries which match the login-ids in the user table. Based on the
contents of the argument directories and the user's home directory field
uoodoo determines what action should be performed.
There are three different sets of rules used to determine what action uoodoo
should perform which are based on the user's home directory field in the
password file. This entry normally contains a string which "is the pathname
to the directory in which the user is initially positioned upon logging in."
uoodoo looks to see if this string points to a user's /u entry. That is, it
either matches "/u/login-id" (referred to as a symbolic link entry) or it
doesn't (referred to as an absolute path).
If the home directory field is an absolute path (ie, does not contain a
reference to the user's symbolic link entry) the following rules apply:
The symbolic link entry, "/u/login-id" will point to the absolute
path whether or not this path exists. The number of entries named
login-id found in the argument directories is irrelevant.
If the home directory field contains a symbolic link entry (a reference to
"/u/login-id") the following rules apply:
If an entry "login-id" is found in only one argument directory,
"/u/login-id" will point to this path. If there is more than one
such entry (referred to as a conflict), there can be two different
actions. In the first case, if there is no existing "/u/login-id"
entry, one is created which points to the first path found in the
argument directories. In the second case, there is an existing
"/u/login-id" entry, and it is not updated. In both instances,
however, an error message is printed as uoodoo expects there to be a
single directory encountered for each user.
Entries in /u are removed if there is no corresponding "login-id" entry in
the password file.
There are no changes required to the password file to make uoodoo
functional. There is the option for a system administrator to use
"/u/login-id" as the home directory in the password file. The underlying
design of uoodoo is based on this choice. If the usual absolute path is used
in the password file, then uoodoo blindly uses this path in maintaining the
symbolic link entry. If, however, the password file points to the symbolic
link entry, then uoodoo relies on the contents of the argument directories
to update /u entries. There are disadvantages as well as advantages to
following the latter course of action. The advantage is that no change is
required to the password file to move a home directory. As soon as the
directory is moved and uoodoo is run, the link will point to the new home
directory. This scheme, though, will not be well suited in an environment
where users have directories in many of the argument directories as uoodoo
needs to find a single entry for a login-id in order to unambiguously update
the symbolic link entry.
OPTIONS
-a
Action mode. The actions performed by uoodoo are reported to the
standard output. Actions are creating, updating or removing a /u
entry.
-c
Check mode. Output from uoodoo is generated but no actions are
actually performed.
-d
Debug mode. Lots of intermediate output is generated.
-w
Warning mode. Conflicts which are not errors are reported in
addition to multiple password file entries for a user, entries in
argument directories which do not correspond to a login-id, and
bogus entries in the /u directory which are not symbolic links.
-u "u-directory"
Use u-directory as the directory which contains the symbolic links.
If none is specified, "/u" is used.
-p "link-pathname"
When attempting to determine whether the home directory field in the
password file is a symbolic link entry or an absolute path,
recognize "link-pathname/login-id" as a symbolic link entry. If
none is specified, "u-directory/login-id" is used. This flag will
probably be useful only when testing. An arbitrary "u-directory"
can thus be specified without having to change the symbolic link home
directories in the password file to "u-directory/login-id".
The actions performed can be be different depending on the order of the
argument directories, especially when creating new /u entries since new
entries point to the first directory encountered while reading the argument
directories.
ERRORS
uoodoo simply performs its tasks and does not inform the user of anything it
does, unless specifically asked, via the warning (-w) and action (-a)
flags. It does, however, generate output if there is an error. A failed
I/O operation (read/write/open..) and failed system calls are all errors.
One of the important goals is to properly deal with a failed NFS server. It
would not be prudent to remove or update entries from /u because a server is
down. uoodoo will hang indefinitely if a hard mounted NFS server is
unavailable. If there is an unmounted NFS filesystem, the mount point will
contain an empty directory and uoodoo will stop and report an error after
looking through all of the remaining argument directories.
INSTALLATION
The only changes necessary should be in the Makefile. Choose either the
"BSD_LIKE" or "SYSV_LIKE" variable in the Makefile to include the proper
header files for the directory libraries. Also add the proper library to
link if your system requires a library to access a YP/NIS version of
getpwent(3). Then make the binaries and install them. Create /u before
running uoodoo.
It is convenient to run uoodoo out of cron daily to keep the /u directory up
to date. This is preferable than relying on a human to run uoodoo properly
by hand as accounts are added or deleted. Users may be inconvenienced,
however, during the time that the /u directory is out of date.
Inform users that they should now use /u/login-id to reference their home
directory to avoid aggravation should their home directory be moved.
COPYRIGHT
Copyright (c) 1991 by Shelley L. Shostak.
All rights reserved.
Redistribution and use in source and binary forms are permitted provided
that the above copyright notice and this paragraph are duplicated in all
such forms and that any documentation, advertising materials, and other
materials related to such distribution and use acknowledge that the software
was developed by Shelley L. Shostak.
Any use of this software is at the user's own risk.