Date: Sun, 13 Mar 2005 04:13:32 +0200 From: Giorgos Keramidas <keramida@ceid.upatras.gr> To: Ola Theander <ola.theander@otsystem.com> Cc: freebsd-questions@freebsd.org Subject: Re: Confused about connection between an option in rc.conf and the associated action? Message-ID: <20050313021330.GA81926@gothmog.gr> In-Reply-To: <20050313014936.TXVL23781.mxfep02.bredband.com@c0003> References: <20050313014936.TXVL23781.mxfep02.bredband.com@c0003>
next in thread | previous in thread | raw e-mail | index | archive | help
# Redirected from freebsd-newbies to freebsd-questions. # Please do not post technical questions to freebsd-newbies. # This is what freebsd-questions is for. Followups set. On 2005-03-13 02:49, Ola Theander <ola.theander@otsystem.com> wrote: > Dear subscribers > > I'm slightly confused about enabling an option in rc.conf and the associated > action? E.g. say that I enable gateway_enable="YES" or maybe > dhcpd_enable="YES", how does FreeBSD associate this simple line to the > associated action? I've had a theory that adding e.g. test_enable="YES" to > rc.conf would trigger the execution of the file /etc/rc.d/test.sh at boot > time but it seems like this isn't how it's done. The /etc/rc script is the first "rc script" that runs. This is the one that takes care of running all the rest of the rc stuff. In pre-5.X versions of FreeBSD, the /etc/rc script called a predefined set of /etc/rc.* scripts at specific points during the startup process, delegating pieces of the work to them. In 5.3-RELEASE and later versions of FreeBSD, there is a collection of small /etc/rc.d/* scripts, that are called by /etc/rc instead of the older /etc/rc.* stuff. The specific order these scripts will have is determined at boot time, by the /sbin/rcorder utility. Each script, either one of the older /etc/rc.* stuff or the newer /etc/rc.d/* scripts, slurps in /etc/rc.conf and then checks what parts of the script are enabled to run. It is the responsibility of the specific script to check the proper rc.conf variables and act accordingly. A small example of an rc script that checks a variable and modifies its own behavior is /etc/rc.d/tmp, which contains (among other stuff): load_rc_config $name # If we do not have a writable /tmp, create a memory # filesystem for /tmp. If /tmp is a symlink (e.g. to /var/tmp, # then it should already be writable). # case "${tmpmfs}" in [Yy][Ee][Ss]) ... Thus, it's not /etc/rc that checks the "tmpfs" variable from rc.conf, but the specific script that is interested in its value. Regards, Giorgos
Want to link to this message? Use this URL: <https://mail-archive.FreeBSD.org/cgi/mid.cgi?20050313021330.GA81926>