Date: Thu, 28 Aug 2003 11:26:25 +0100 From: Matthew Seaman <m.seaman@infracaninophile.co.uk> To: David Landgren <david@landgren.net> Cc: FreeBSD Questions List <freebsd-questions@freebsd.org> Subject: Re: Setting sysctl variables BEFORE the kernel boots and runs init? Message-ID: <20030828102625.GB6697@happy-idiot-talk.infracaninophile.co.uk> In-Reply-To: <3F4DB8A2.8040007@landgren.net> References: <D032A40D-D8E3-11D7-B4CB-0003939F9330@borg-cube.com> <014d01c36d24$1f8c1430$0201a8c0@dredster> <3F4DB8A2.8040007@landgren.net>
next in thread | previous in thread | raw e-mail | index | archive | help
--R3G7APHDIzY6R/pk Content-Type: text/plain; charset=us-ascii Content-Disposition: inline Content-Transfer-Encoding: quoted-printable On Thu, Aug 28, 2003 at 10:09:06AM +0200, David Landgren wrote: > Micheal Patterson wrote: >=20 > > > >----- Original Message -----=20 > >From: "Donald Burr" <dburr@borg-cube.com> > >To: "FreeBSD Questions List" <freebsd-questions@freebsd.org> > >Sent: Wednesday, August 27, 2003 6:11 PM > >Subject: Setting sysctl variables BEFORE the kernel boots and runs init? > > > > > > > >>I would like to be able to set certain sysctl variables in the kernel, > >>preferably BEFORE the kernel finishes booting and runs init, etc. (or > >>at the worst case, very shortly after init runs) I thought I > >>remembered that there was a way to do this through the boot loader. > >>Can anyone enlighten me? Thanks. > [...] > >You can configure sysctl options if you create the file /etc/sysctl.conf= =20 > >and > >put your changes there. Is this what you're looking for? >=20 > That happens in the late stages if the game. init is running the main=20 > rc script, disks have been fscked and mounted, swap is up. It does=20 > happen before network setup, IIRC. It depends on what variables the OP=20 > is talking about I guess. Yes -- however /etc/sysctl.conf is still too late compared to what the OP was asking for. You can modify some kernel tunables very early in the boot process by setting variables in the loader. According to loader(8) the tunables that are available are: kern.maxusers kern.ipc.nmbclusters kern.vm.kmem.size kern.maxswzone kern.maxbcache machdep.pccard.pcic_irq net.inet.tcp.tcbhashsize (This is on 4.9-PRERELEASE, other OS versions may differ) These are normally set using compiled-in values derived from settings like MAXUSERS, NMBCLUSTERS, TCBHASHSIZE in the kernel config. These values have to be set early because they define the size of various critical memory structures within the kernel that can't be modified while the system is running. You can set these values by editing /boot/loader.conf -- eg, add: kern.maxusers=3D"32" to that file. The operation of loader.conf deliberately parallels the way that /etc/rc.conf works. See /boot/defaults/loader.conf for default settings for the available variables. Any other modifications to sysctl settings can and should be made via /etc/sysctl.conf Cheers, Matthew --=20 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 --R3G7APHDIzY6R/pk Content-Type: application/pgp-signature Content-Disposition: inline -----BEGIN PGP SIGNATURE----- Version: GnuPG v1.2.3 (FreeBSD) iD8DBQE/TdjRdtESqEQa7a0RAgu2AJoCvLTSPUWjiMM0Odrow9Si2w/wJACfbUwm Eh64BKic7c8i+ULJt6pyliQ= =vX8a -----END PGP SIGNATURE----- --R3G7APHDIzY6R/pk--
Want to link to this message? Use this URL: <https://mail-archive.FreeBSD.org/cgi/mid.cgi?20030828102625.GB6697>