*BSD News Article 12465


Return to BSD News archive

Newsgroups: comp.os.386bsd.development
Path: sserve!manuel.anu.edu.au!munnari.oz.au!news.Hawaii.Edu!ames!agate!spool.mu.edu!yale.edu!ira.uka.de!math.fu-berlin.de!news.netmbx.de!Germany.EU.net!mcsun!ieunet!dec4ie.ieunet.ie!jkh
From: jkh@whisker.lotus.ie (Jordan K. Hubbard)
Subject: A challenge to all true kernel hackers - conditional symlinks.
Message-ID: <JKH.93Mar9214944@whisker.lotus.ie>
Sender: usenet@ieunet.ie (USENET News System)
Nntp-Posting-Host: whisker.lotus.ie
Organization: Lotus Development Ireland
Date: Tue, 9 Mar 1993 21:49:44 GMT
Lines: 43

The Apollo OS (Domain/IX) had a lot of truly interesting features, many
of which may never make it to Unix (pity), but one in particular has stuck
with me for a long time.

On pyramid's version of Unix, you had "conditional symbolic links"
which was their fancy term for "complete kludge" :-).  You could have
a symlink which pointed at one of two places (att or bsd), depending
on the settings of a user's "universe" pointer.  So you had /usr/lib
as a conditional symlink pointing to either /usr/lib.att or
/usr/lib.ucb (something like that, anyway, this is all from ancient
memory).

Then you have HP's current "file contexts" where you have a file that's
really a directory containing several versions of that file, one of which
is selected based on a process's "context" settings.  Potentially useful
for different situations, but my first reaction was (and is still) Barf!

Finally (this is leading somewhere, honest) you had Apollo's
beautifully simple, yet very powerful, mechanism for doing symlinks,
which was to allow environment variables to be imbeded anywhere within
a link name.  I.E.:

	ln -s /usr/doc /usr/src/documents/$(LANG)

Depending on the setting of the user's environment variable "LANG", /usr/doc
might then point to /usr/src/documents/german, /usr/src/documents/french,
etc.

Naturally, this would also switch very nicely off of environment
variables like TERM, MACHINE, ARCH, USER, etc.  It made creative
system administration a lot easier!

The question is, is anyone out there game to see what it would take to
do this in 386bsd?  I think you'll find getting at the current process
environment from namei() somewhat tricky..

Comments?

					Jordan
--
Jordan Hubbard          Lotus Development Ireland       jkh@whisker.lotus.ie
386bsd Patchkit Coordinator                             All-around nice dude.
I do not speak for Lotus as that's not in my job description.