Date: Wed, 1 Jul 1998 01:03:37 +0200 (CEST) From: wjw@digi.digiware.nl (Willem Jan Withagen) To: mike@smith.net.au (Mike Smith) Cc: hackers@FreeBSD.ORG Subject: Variant Link implementation, continued Message-ID: <199806302303.XAA07485@digi.digiware.nl> In-Reply-To: <199806080712.AAA09745@antipodes.cdrom.com> from Mike Smith at "Jun 8, 98 00:12:57 am"
next in thread | previous in thread | raw e-mail | index | archive | help
=> > >> If we really wanted to get variant symlinks, I would suggest copying
=> > >> the already-fairly-well-known syntax of AFS, `@name_of_parameter'. As
=> > >> the metasyntactic variable suggests, these should be (a fairly small
=> > >> number of) parameters which hold system-wide. (Indeed, given the
=> > >> existence of the sysctlbyname interface in the kernel, one could
=> > >> simply kick them off in that direction.)
=> > >
=> > >Ok. I did actually look at how this could be implemented last time it
=> > >came up, and I think it would be *reasonably* straightforward.
I have actual working code for this.
At the moment every variantlink gets replaced by '2.2.6', since that is my
current OS version.
And /usr/local is thus pointing to /usr/local.${OSVERSION}
lrwxrwxrwx 1 root wheel 20 Jul 1 00:50 local@ -> ./.local.${OSVERSION}
lrwxrwxrwx 1 root wheel 12 Mar 1 23:08 .local.2.2.6@ -> /home2/local
lrwxrwxrwx 1 root wheel 12 Mar 1 23:08 .local.@ -> /home2/local
Which is running for quite a while (1-2 weeks). The last link is to be used
in case I run a kernel with actual variant translation but OSVERSION is not
defined.
So I'm up for the next challenge:
=> Start small; once this is working for you, the next step is the
=> 'defaults' space, which should be sysctl-accessible. Then you can
=> start worrying about how to become more process-specific.
* sysctl-accessable variant parameters.
Currently all I know about this comes from 'man 3 sysctl' and browsing
through the kernel-source. But I've never finished my reading on MIB's so
any help an/or suggestion is welcom.
My 2 major questions:
- How can I efficiently obtain the value of a sysctl value?
And should they look like 'variant.name', or would/should a
variant link be able to look like:
kern.osrelease: 2.2.6-STABLE
- It seems that names are allocated from within the kernel
upon startup, nothing dynamic. Is there any work in progress to make
this more flexible? I could start by first creating a standard set
of names.
* An alternative would be: How do I obtain the environment of the
process using the link? (assuming it has nog messed with its
*env-pointer)
Thanx,
--WjW
To Unsubscribe: send mail to majordomo@FreeBSD.org
with "unsubscribe freebsd-hackers" in the body of the message
Want to link to this message? Use this URL: <https://mail-archive.FreeBSD.org/cgi/mid.cgi?199806302303.XAA07485>
