Skip site navigation (1)Skip section navigation (2)
Date:      Wed, 9 May 2012 09:05:47 -0700
From:      Garrett Cooper <yanegomi@gmail.com>
To:        "hackers@FreeBSD.org" <hackers@FreeBSD.org>
Subject:   Thoughts about kenv emulating sysctl
Message-ID:  <D213F695-E85A-407F-92F1-469FD00A0963@gmail.com>

next in thread | raw e-mail | index | archive | help
Hi Hackers,
    I've been asked to write up a script to analyze tunables via kenv for ar=
chival purposes an to establish a baseline set of static variables.
    In order to make life easier (and be able to do all the grunt work in a s=
hell one-liner instead of introducing a bug prone tunable parser) I have wri=
tten up a patch which would make kenv function a bit more like sysctl, wrt t=
he fact that sysctl -n suppresses suffixing a value with the variable name w=
hen executed like so:

# kenv LINES
LINES=3D"24"
# kenv -n LINES
24

    I've also considered keeping the functional defaults and instead do the f=
ollowing...

# kenv -v LINES
LINES=3D"24"
# kenv LINES
24

    Pro of the first form is that it matches sysctl, pro of the second form i=
s that it doesn't break backwards 'compatibility'.
    I know kenv isn't a widely used utility (albeit, I have seen it used in a=
 few spots outside of FreeBSD proper), but I was wondering if anyone could s=
ee any potential pitfalls or would have a large degree of heartburn over cha=
nging the default to match sysctl.
Thanks!
-Garrett=



Want to link to this message? Use this URL: <https://mail-archive.FreeBSD.org/cgi/mid.cgi?D213F695-E85A-407F-92F1-469FD00A0963>