Advanced > System Tunables vs. /boot/loader.conf.local and /boot/loader.conf



  • Still a BSD noob, since outside of pfSense I more or less exclusively deal with OS X, which is BSD-ish, but not in low level things.

    So the question is, what goes where?
    Advanced > System Tunables vs. /boot/loader.conf.local and /boot/loader.conf

    I noticed during getting TRIM enabled, that some things such as
    vm.kmem_size="435544320"
    were in /boot/loader.conf that I naively would have expected to be a line in the system tuneables.

    So what goes where? And does /boot/loader.conf.local take precedence over /boot/loader.conf i.e. when a value is set in this, which one wins?


  • Netgate Administrator

    The system tunables table in the webgui is the equivalent of the sysctl.conf file in FreeBSD. By having it in the gui changes to it get stored in the config.xml file. Anything you put in the table (or sysctl.conf) is equivalent to entering it at the command line.
    Things put in the loader.conf are fed to the kernel at a very early point in the boot. So values like the one you mentioned that need to be set before the kernel loads are put there. In pfSense loader.conf is the standard set of loader variables and they can change and be set by scripts that make up pfSense. loader.conf.local, which doesn't exist by default, is available for any custom changes. Values there will overide any in loader.conf and loader,conf.local is copied across a firmware update.

    As I understand it.  ;)

    Steve



  • Cool. Thanks!

    So basically, it's a matter of how early on the variable is needed in the life of the system. Makes sense. Of course, but that's a matter of BSD's design not of pfSense, it would be nice if one could discern from the name of a variable if it's needed at that early a stage in the game, and wouldn't have to "just know" or "just guess".


  • Netgate Administrator

    Yes, it would.  ;)
    They are normally listed in the man page of whatever is generating them as either loader variables or sysctls. Many are tough to find though especially if it's something in the kernel for example.

    Steve


Log in to reply