Re: Setting sysctl variables BEFORE the kernel boots and runs init?

2003-08-28 Thread Matthew Seaman
On Thu, Aug 28, 2003 at 10:09:06AM +0200, David Landgren wrote:
> Micheal Patterson wrote:
> 
> >
> >- Original Message - 
> >From: "Donald Burr" <[EMAIL PROTECTED]>
> >To: "FreeBSD Questions List" <[EMAIL PROTECTED]>
> >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 
> >and
> >put your changes there. Is this what you're looking for?
> 
> That happens in the late stages if the game. init is running the main 
> rc script, disks have been fscked and mounted, swap is up. It does 
> happen before network setup, IIRC. It depends on what variables the OP 
> 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="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

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


pgp0.pgp
Description: PGP signature


Re: Setting sysctl variables BEFORE the kernel boots and runs init?

2003-08-28 Thread David Landgren
Micheal Patterson wrote:

- Original Message - 
From: "Donald Burr" <[EMAIL PROTECTED]>
To: "FreeBSD Questions List" <[EMAIL PROTECTED]>
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 and
put your changes there. Is this what you're looking for?
That happens in the late stages if the game. init is running the main 
rc script, disks have been fscked and mounted, swap is up. It does 
happen before network setup, IIRC. It depends on what variables the OP 
is talking about I guess.

DAvid

___
[EMAIL PROTECTED] mailing list
http://lists.freebsd.org/mailman/listinfo/freebsd-questions
To unsubscribe, send any mail to "[EMAIL PROTECTED]"


Re: Setting sysctl variables BEFORE the kernel boots and runs init?

2003-08-28 Thread Micheal Patterson


- Original Message - 
From: "Donald Burr" <[EMAIL PROTECTED]>
To: "FreeBSD Questions List" <[EMAIL PROTECTED]>
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.
> -- 
> Donald Burr of Borg <[EMAIL PROTECTED]> | FreeBSD: The Power to Serve!
> Website: http://www.borg-cube.com/| http://www.freebsd.org/
> PO Box 91212, Santa Barbara CA 93190-1212 \-
> Tel: (805)563-0672   ICQ# 16997506  Present Day... Present Time!
>
> ___
> [EMAIL PROTECTED] mailing list
> http://lists.freebsd.org/mailman/listinfo/freebsd-questions
> To unsubscribe, send any mail to
"[EMAIL PROTECTED]"

You can configure sysctl options if you create the file /etc/sysctl.conf and
put your changes there. Is this what you're looking for?


--

Micheal Patterson
Network Administration
Cancer Care Network
405-733-2230

___
[EMAIL PROTECTED] mailing list
http://lists.freebsd.org/mailman/listinfo/freebsd-questions
To unsubscribe, send any mail to "[EMAIL PROTECTED]"


Re: Setting sysctl variables BEFORE the kernel boots and runs init?

2003-08-27 Thread Mike Hogsett

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

Although I haven't done this myself, I think a start may be reading the
man pages for loader(8), loader.conf(5) and boot(8).

 - Mike





___
[EMAIL PROTECTED] mailing list
http://lists.freebsd.org/mailman/listinfo/freebsd-questions
To unsubscribe, send any mail to "[EMAIL PROTECTED]"