Re: RFC - sysctl or module parameters.

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



On Fri, Sep 01, 2006 at 12:02:52PM +1000, Neil Brown wrote:
> 
> There are so many ways to feed configuration parameters into the
> kernel these days.  
> There is sysctl.  There is sysfs. And there are module paramters.
> (procfs? who said procfs? I certainly didn't).
> 
> I have a module - let's call it 'lockd'.
> I want to make it configurable - say to be able to identify
>  peers by IP address (as it currently does) or host name
>  (good for multi homed peers, if you trust them).
> 
> And I want Jo Sysadmin to be able to set some simple configuration
> setting somewhere and have it 'just work'.
> 
> Options:
>  - I could make it a module parameter: use_hostnames, and tell
>    Jo to put
>      options lockd use_hostnames=yes
>    in /etc/modprobe.d/lockd  if that is what (s)he wants.
>    But that won't work if the module is compiled in (will it?).

Yes it will.  See Documentation/kernel-parameters.txt for how it works.

>  - I could make a sysctl /proc/sys/fs/nfs/nsm_use_hostnames
>    at tell Jo to put
>       fs.nfs.nsm_use_hostnames=1
>    if /etc/sysctl.conf if desired.
>    But that wouldn't work if lockd is a module that is loaded
>    after "/usr/sbin/sysctl -p" has been run.
> 
>  - I could do both and tell Jo to make both changes, just in case,
>    but that is rather ugly, though that is what we currently do
>    for nlm_udpport, nlm_tcpport, nlm_timeout, nlm_grace_period.
> 
> It occurs to me that since we have /sys/module/X/parameters,
> it wouldn't be too hard to have some functionality, possibly
> in modprobe, that looked for all the 'options' lines in
> modprobe config files, checked to see if the modules was loaded,
> and then imposed those options that could be imposed.

those options _are_ module parameters, and as such work just fine with
the modprobe config files.

> Thus we could just have a module option, just add module config
> information to /etc/modprobe.d and run
>   modprobe --apply-option-to-active-modules
> at the same time as "sysctl -p" and it would all 'just work'
> whether the module were compiled in to not.

Ah, you want it after the code is loaded.  That's different.

Would probably work just fine, no objection from me.  Except you would
have to hack up the module-init-tools package :)

thanks,

greg k-h
-
To unsubscribe from this list: send the line "unsubscribe linux-kernel" in
the body of a message to [email protected]
More majordomo info at  http://vger.kernel.org/majordomo-info.html
Please read the FAQ at  http://www.tux.org/lkml/

[Index of Archives]     [Kernel Newbies]     [Netfilter]     [Bugtraq]     [Photo]     [Stuff]     [Gimp]     [Yosemite News]     [MIPS Linux]     [ARM Linux]     [Linux Security]     [Linux RAID]     [Video 4 Linux]     [Linux for the blind]     [Linux Resources]
  Powered by Linux