Solved Does there exist an equivalent to sysctl for handling /boot/loader.conf changes?

I wondered whether there is a "recommended" way to make changes in /boot/loader.conf similar to using sysctl() for making changes in /etc/rc,conf.

Just asking, because otherwise one would obviously need to directly edit /boot/loader.conf.

Sorry for this maybe stupid question, I just want to try to do things "correctly".
 
What makes you think that sysctl is used to make changes in rc.local? That's incorrect, it's only used to set kernel parameters, and when you use it those changes will only last for as long as the system is up, they do not retain.

You're confusing it with sysrc(8).

Alas, there's no such system for loader.conf that I'm aware off. In fact, I don't even bother with sysrc and instead manually edit the config files when I need to.
 
Thank you!
Then I guess it is better to let my configuration file modification subroutine do the work, no matter whether which of loader.conf and rc.conf.
This would be more consistent regarding coding, too.
So this can be closed...
 
The tool sysrc can be used to edit any configuration file, you just need to pass the -f flag to indicate the file you want to modify, otherwise it will default to one of the /etc/rc.conf files. I have been using it with /boot/loader.conf without problem.
 
Back
Top