single stepping through /etc/rc.conf

My understanding (and smarter heads will correct me if I am wrong) is that rc.conf (along with /etc/defaults/rc.conf and files in the /etc/rc.conf.d directory) sets a bunch of variables that other parts of FreeBSD can look at when they are initializing. Since it is purely descriptive, and doesn't actually do anything, there is no way to single-step through it. An interesting consequence of this is that you can add variables that will be ignored unless someone is expecting them. For example, you could add foobar_enable="YES" to rc.conf, and unless some program was asking for the value of foobar_enable, it will be ignored.
 
lgrant is not wrong. /etc/rc.conf is sourced by other files and the variables are used to define behavior of the other things. Other things in this case being system service scripts (/etc/rc.d, /usr/local/etc/rc.d). /etc/rc.d/netif does stuff with network interfaces. Where does it get that information? From variables in /etc/rc.conf.
Perhaps a bit more information as to what you are trying to do/looking for will make it easier for others to help.
If you want ordering for how things get started,
man rcorder
 
lgrant is not wrong. /etc/rc.conf is sourced by other files and the variables are used to define behavior of the other things. Other things in this case being system service scripts (/etc/rc.d, /usr/local/etc/rc.d). /etc/rc.d/netif does stuff with network interfaces. Where does it get that information? From variables in /etc/rc.conf.
Perhaps a bit more information as to what you are trying to do/looking for will make it easier for others to help.
If you want ordering for how things get started,
man rcorder
I basically want to pause rc.conf and check the state of various settings.

If for instance I did a service netif restart, would would like to see what being done in case the outcome was something I didn't want.
 
That's not pausing rc.conf, that's pausing a service or pausing "init processing"

Almost all service scripts source /etc/rc.subr and /etc/network.subr; they both provide functions useful to service scripts. I don't know if there is anything in there that may help, like a "verbose" mode but to get what you want I think you may need to temporarily modify a script of interest.
 
It's not stepping, but the -x option for sh is useful here. Examples:

Code:
(set -x ; . /etc/rc.conf) # will print individual lines

You set also put `set -x` at the beginning of a /etc/rc.d file, so that it prints both during bootup and when invoked later.
I keep forgetting about "-x";
 
The system takes care of things that can be late. Example: my USB stack still needs +/- 2 seconds to start communicating with a device after loading the kernel module. This would cause problems without a supervising configuration system. Or you have to handle all those situations yourself. You can pause the script execution but you can't be sure where it's at, at that point. It's not a sequential series of actions.
 
I basically want to pause rc.conf and check the state of various settings.

If for instance I did a service netif restart, would would like to see what being done in case the outcome was something I didn't want.

Why can't you just read rc.conf? It's sourced early so it isn't going to tell you much about what going on.
 
Back
Top