On Sun, Mar 28, 2004 at 05:04:43PM +0900, Rob wrote:

> Remotely, I was following this discussion; I'm suprised by this solution
> and I wonder how I ever would be able to find out myself about this 
> misterious
> sysctl-magic.
> 
> I did 'apropos usermount', 'man sysctl' and 'man sysctl.conf', and all did 
> not
> give me any hint to the above vfs.usermount solution.
> Also 'sysctl -ad | grep vfs.usermount' outputs no info.
> 
> Actually, I had this feeling with other answers on this list: 'set 
> this-or-that
> sysctl variable'. I never could find any info on my FreeBSD box, to help me
> further understand.
> 
> What is this sysctl-black-magic about and where is more information?

You're right that finding which sysctl is required to achieve whatever
purpose can be tricky.  Finding what sysctls exist is as easy as
typing 'sysctl -a', but working out what they actually do -- that's a
different story.  sysctls are generally documented in man pages which
may or may not have a title related to the name of the sysctl.  Plus
they are usually documented in the *programming* section of the
manual, rather than the user or system administration commands
sections, whose man pages come up by default if there's more than one
page under the same name.

Let's take the vfs.usermount sysctl as an example.  That is actually
documented in mount(2) -- the page describing the mount() (and
umount()) syscall, not mount(8) -- the program for mounting
partitions.  If you type 'man mount' you'll get the mount(8) man page
by default.  However if you type 'man 2 mount' you find this timeless
wisdom hidden within that page:

     By default only the super-user may call the mount() function.  This
     restriction can be removed by setting the sysctl vfs.usermount to a non-
     zero value.

How do I know where vfs.usermount is documented? Only by the rather
unsatisfactory means of grepping the whole collection of man pages:

    % cd /usr/share/man
    % find . -name '*.gz' -print | xargs zgrep -l vfs.usermount

(It would be really nice if the text produced by 'sysctl -d' gave you
a reference to the man page(s) where the sysctl was documented.)

There is a project underway to create better documentation for sysctls
-- see

    http://lists.freebsd.org/pipermail/freebsd-doc/2004-January/003315.html

See also sysctl(3) and the various header files referenced from there.


-- 
Dr Matthew J Seaman MA, D.Phil.                       26 The Paddocks
                                                      Savill Way
PGP: http://www.infracaninophile.co.uk/pgpkey         Marlow
Tel: +44 1628 476614                                  Bucks., SL7 1TH UK

Attachment: pgp00000.pgp
Description: PGP signature

Reply via email to