Subject: Re: dynamic sysctl
To: NetBSD Kernel Technical Discussion List <>
From: Andrew Brown <>
List: tech-kern
Date: 11/15/2003 12:43:15
On Fri, Nov 14, 2003 at 06:37:14PM -0500, Greg A. Woods wrote:
>[ On Wednesday, November 12, 2003 at 22:39:10 (-0500), Andrew Brown wrote: ]
>> at one point, i groveled through all the archives, scribbled down all
>> the requirements people had for such a system, and either filed them
>> away as "no...not doing that" (a small number of them) or as "okay,
>> that part's done" (most of them), but i don't have that list any more.
>One related userland issue from my own ToDo list:

ah, yes, but only perhaps related to rewriting it...

>- /sbin/sysctl should use strvis(VIS_WHITE) or similar make sure any
>  strings it prints are in a guaranteed canonical printable form.  Of
>  course it should also use strunvis() to allow the printable form to be
>  used as "input" for -w too.

have you filed a pr on this?

>Currently the major need for this is with hw.cnmagic.  The way
>/etc/rc.d/sysctl reads /etc/sysctl.conf makes it impossible to use some
>character sequences, and for those that do work having raw escape
>sequences in /etc/sysctl.conf is rather in-elegant to say the least.
>For example since the serial console on my AS4000 seems to ignore a
>BREAK signal, at least for the purposes of telling the kernel to drop
>into DDB, I decided to use a similar escape sequence for hw.cnmagic to
>the one used to get the attention of its console monitor processor
>("^]^]rcm").  Luckily this particular sequence works in /etc/sysctl.conf
>without need for quoting magic or other fancy tricks, but it still looks
>ugly (or is invisible) in any editor and the true value is hidden from
>view when displayed (and luckily the console monitor processor is smart
>enough to ignore output from the host console too else displaying the
>value on the console would cause it to drop into DDB!  ;-):
># grep hw.cnmagic /etc/sysctl.conf | od -c 
>0000000    h   w   .   c   n   m   a   g   i   c   = 035 035   d   d   b
>0000020   \n                                                            
># sysctl hw.cnmagic         
>hw.cnmagic = ddb
># sysctl hw.cnmagic | od -c 
>0000000    h   w   .   c   n   m   a   g   i   c       =     035 035   d
>0000020    d   b  \n                                                    

yes, well, that doesn't seem all that hard to fix, and it even strikes
me that perhaps you're not using current where i think it may already
have been.  i can't tell right now, though...need coffee.  :)

try current?  even if just to see how it works?

|-----< "CODE WARRIOR" >-----|             * "ah!  i see you have the internet (Andrew Brown)                that goes *ping*!"       * "information is power -- share the wealth."