mirror of https://lore.kernel.org/lkml/
 help / color / mirror / Atom feed
* RFC - sysctl or module parameters.
@ 2006-09-01  2:02 Neil Brown
  2006-09-01 10:10 ` Greg KH
                   ` (2 more replies)
  0 siblings, 3 replies; 7+ messages in thread
From: Neil Brown @ 2006-09-01  2:02 UTC (permalink / raw)
  To: linux-kernel


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?).

 - 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.

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.

Is that a reasonable idea?

(I'll probably add both a sysctl and a mod param for my current
problem, but I'd love it if there were a better approach
possible in the future).

Thanks,
NeilBrown

^ permalink raw reply	[flat|nested] 7+ messages in thread

end of thread, other threads:[~2006-09-03  2:50 UTC | newest]

Thread overview: 7+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2006-09-01  2:02 RFC - sysctl or module parameters Neil Brown
2006-09-01 10:10 ` Greg KH
2006-09-01 12:23   ` Dmitry Torokhov
2006-09-01 15:57   ` Andrey Borzenkov
2006-09-01 18:22     ` Greg KH
2006-09-01 15:25 ` Oleg Verych
2006-09-03  1:57 ` Horst H. von Brand

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox

all inboxes | Powered by JetHome®