Yet another magic symlinks implementation

Oliver Fromme olli at
Mon Nov 6 09:50:56 UTC 2006

Andrey V. Elsukov wrote:
 > >    It is interesting to note that DragonFly has had variant symlnks for 
 > >    a long time, but we haven't actually found a use for them yet.   
 > Yes, Matt. Some time ago i've ported Df's variant symlinks too :)
 > This task was declared on the ideas page:
 > But i don't see an interest in this feature among commiters. :( 
 > >    Originally I envisioned using variant symlinks as part of a packaging
 > >    system to allow package environments to be built on the fly, thus
 > >    allowing multiple versions of libraries to coreside and not have the
 > >    'you have to upgrade everything to install one new thing' problem.
 > >    But that was before we adopted pkgsrc.  Pkgsrc doesn't use varsyms,
 > >    so...
 > Yes, i think varsyms can be usefull in build enviroments. Somebody spoke that
 > varsyms can be usable in a cluster or jailed enviroments.

FWIW, if FreeBSD had variant symlinks, I would definitely
use that feature for jailed environments.

Another task:  I've written an rc script for my notebook
which detects the network environment (home, office, wlan,
offline) by pinging some IP addresses.  Then it configures
several files in /etc for that environment (rc.conf, hosts,
ntp.conf, resolv.conf, fstab, etc.).  Currently this is
done by modifying a bunch of symlimks in /etc each time the
notebook is rebooted.  I don't like that "solution" at all;
in fact I would prefer the root file system to stay read-
only.  If variant symlinks were available in FreeBSD, the
problem could be solved easily.

I'm afraid that I don't like NetBSD's "magic symlinks" very
much.  It's less flexible than variant symlinks because it
only supports a fixed set of variables.  As far as I can
tell, it does not solve any of the tasks described above.

Therefore I would really like to see your port of DragonFly
BSD's variant symlinks comitted to FreeBSD.  Of course, it
could be a compile-time option in case there are people who
don't want the code in their kernel at all.  But you have
to set a sysctl anyway to enable it globally (it's disabled
by default on DragonFly).

Just my 2 cents.

Best regards

Oliver Fromme,  secnetix GmbH & Co. KG, Marktplatz 29, 85567 Grafing
Dienstleistungen mit Schwerpunkt FreeBSD:
Any opinions expressed in this message may be personal to the author
and may not necessarily reflect the opinions of secnetix in any way.

"Documentation is like sex; when it's good, it's very, very good,
and when it's bad, it's better than nothing."
        -- Dick Brandon

More information about the freebsd-hackers mailing list