Re: varlinks! (and 2.1.98 works for me)

Rogier Wolff (R.E.Wolff@BitWizard.nl)
Thu, 30 Apr 1998 01:18:13 +0200 (MET DST)


Andreas Jellinghaus wrote:
>
>
> i had the same idea. great, that you implemented it.
>
> >varlinks are symlinks that have a variable part in them. An example
> >will make things clear:
>
> it must work this way : first try to resolv without interpreting the symlink.
> only if it fails, you may give it a second chance.
>
> > echo "HOME=/home/wolff" > /proc/$$/varlinks
>
> we need a way to initialize some variable when booting, with lilo append=
> lines or loadlin parameters.

Why not do that in the initscripts? You can set init's varlinks
(as root) with

echo HOSTNAME=`hostname` > /proc/1/varlinks

>From then on, every process spawned will inherit these settings.

> >-- Do the oneliner for the other filesystems.
>
> all i need is nfs fs support :-)

--- linux-2.1.98.clean/fs/nfs/symlink.c Sun Jan 4 09:53:41 1998
+++ linux/fs/nfs/symlink.c Tue Apr 28 10:13:23 1998
@@ -94,7 +94,7 @@
path[len] = 0;
kfree(mem);

- result = lookup_dentry(path, base, 1);
+ result = lookup_varlink_dentry(path, base, 1);
kfree(path);
out:
return result;

> >Linus: If you disregard the coding style, some inefficiencies, and
> >possible races for now, would it be possible to include this in the
> >running-kernel-series? Or "wait for 2.3" or "not over my dead body"?
>
> Linus : please give it a chance ! 2.1 has a broken nametrans patch.
> i think this is a good replacement for nametrans :
> - process all normal files as usual.
> - process all normal symlinks as usual.
> - only broken symlinks get a second change, and are evaluated.
>
> this allows /etc/inittab to be a symlink to /etc/GENERIC/inittab.${host}
> which is great stuff for nfsroot systems - no need for a per host /etc
> directory. on my > 50 machine set i have 5 per host files. all others are
> shared.
>
> and evaluating a symlinks is much cleaner design and much faster, than
> scanning a directory for e.g. inittab#host=myhostname# files.
>
> >everybody: I'd appreciate feedback "it works", "I'd like this feature,
> >but I didn't have time to try it", "It doesn't work".
>
> i will test. please change the semantic : only evaluate symlinks,
> if they seem to be broken. this way you have no loss of cpu time
> (in fact no single command is added), if a file is found.

The problem here is, the "original" link is "lost" by the time we get
to know that it is broken. The way it is now, only symlinks that have
"${" in them are varlink-processed.

> as you can see, my primary interest is replaceing name translation,
> and the concept of evaluating a symlink looks much better to me, than
> scanning a directory. what about a default configuration :
> ${hostname} and ${domainname} should always be current hostname/domainname.

Does the kernel know about these?

> this, and adding one field via lilo (type=(server|clientP5|clientK6)
> is all i need. uid isn't necessary for me.

You can pass arguments to "init" which you can parse (make init a script
which does the setting, and then exec the real init.)

Roger.

-- 
If it's there and you can see it, it's REAL      |___R.E.Wolff@BitWizard.nl  |
If it's there and you can't see it, it's TRANSPARENT |  Tel: +31-15-2137555  |
If it's not there and you can see it, it's VIRTUAL   |__FAX:_+31-15-2138217  |
If it's not there and you can't see it, it's GONE! -- Roy Wilks, 1983  |_____|

- To unsubscribe from this list: send the line "unsubscribe linux-kernel" in the body of a message to majordomo@vger.rutgers.edu