setting boot flag

What kind of flag? most "boot" flags are set from the loader, like when you stop the countdown and say boot into single user mode?

Kind of hard to say "best way" without knowing what flag and what the intent of the flag is.
 
I've remembered something about the existence of a firstboot_sentinel which I never fully understood but it is referenced inrc.conf().

In the expanation it mentions early_late_divider which I'm trying to figure out. I want to be able to run something after rc.conf is processed.
 
firstboot is basically "I've just done a fresh install and rebooted the system, so it's the first time the system has been booted" It can be used to do things that are unique to the system, say generate certs, contact a server to log the new system (useful in corporate environments). After the first boot stuff runs, the flag (file) is deleted so it will never run again.

I'm not sure where/what early_late_divider is but it sounds to me like early is "things that must be run before almost everything else like mounting boot filesystems, hardware initialization" and late is "things that can wait".

I could be wrong on the following, others will correct me as needed.

I don't think "rc.conf" is actually "processed"; I believe that each service file will look up values in rc.conf. Example: look at /etc/rc.d/moused It has a variable "name" value "moused" Then it calls load_rc_config $name (defined in /etc/rc.subr) which may pull in rc.conf and then look up variables related to the name moused.
Each service file does similar processing so "...after rc.conf is processed" really doesn't mean any outside the context of a specific service file.
 
I've remembered something about the existence of a firstboot_sentinel which I never fully understood but it is referenced inrc.conf().

In the expanation it mentions early_late_divider which I'm trying to figure out. I want to be able to run something after rc.conf is processed.
rc.conf runs as part of every normal rc script.

The early-late divider prevents a script outside /etc/rc.d/ from running in very early - by default before FILESYSTEMS.
 
rc.conf runs as part of every normal rc script.

Interesting that you mention this since I just added 'echo "hello" ' into my rc.conf and couldn't understand why hello popped so many times.

I'm currently trying find out what is considered to be 'late'.
 
Back
Top