RFC: sysctl -f filename

Konstantin Belousov kostikbel at gmail.com
Sat Dec 1 23:38:00 UTC 2012


On Sun, Dec 02, 2012 at 08:21:50AM +0900, Hiroki Sato wrote:
> Garrett Cooper <yanegomi at gmail.com> wrote
>   in <CAGH67wShpcmOKhc09+MP5c-AOm7EAPG+Gqv=J0PRq0sGuTzKRQ at mail.gmail.com>:
> 
> ya> On Sat, Dec 1, 2012 at 2:10 PM, Garrett Cooper <yanegomi at gmail.com> wrote:
> ya> >     Why change the tool when we can change the rc script to do the
> ya> > right thing? I have a patch I'm working on to resolve this (you hit an
> ya> > itch I've been meaning to scratch for a little while).
> ya>
> ya>     This should work. I also refactored the script to get it down to
> ya> 80 columns. I've attached the debug output and the diff for the debug
> ya> version of the script.
> 
>  You will find out the following test case does not work (this is one
>  of the test strings I used):
> 
>  kern.domainname="c$EDITOR.\"\ hoge\ \"\#hoge2\\$ \# h$$\#oge"#
> 
>  The reason why I changed sysctl(8) was that the rc.d/sysctl script
>  was too complex and slow even if it could support meta characters in
>  shell script syntax.  I created several prototypes as script but
>  noticed that keeping consistency was quite difficult and
>  maintainability was poor due to tricky handling of variables.
> 
>  Although my patch in the previous email does not support meta
>  characters completely, I still think it is more reasonable to
>  implement this functionality on the sysctl(8) side.
> 
> -- Hiroki

I fully agree with the proposal to add the -f switch to the sysctl(8).
This is consistent with several other administrative tools. Putting
the ability to parse and apply arbitrary sysctl.conf-like file into 
the rc script is weird.
-------------- next part --------------
A non-text attachment was scrubbed...
Name: not available
Type: application/pgp-signature
Size: 834 bytes
Desc: not available
URL: <http://lists.freebsd.org/pipermail/freebsd-rc/attachments/20121202/c11f32b1/attachment.sig>


More information about the freebsd-rc mailing list