From owner-freebsd-questions@FreeBSD.ORG Sun Mar 13 02:13:39 2005 Return-Path: Delivered-To: freebsd-questions@freebsd.org Received: from mx1.FreeBSD.org (mx1.freebsd.org [216.136.204.125]) by hub.freebsd.org (Postfix) with ESMTP id 9F0DC16A4CE for ; Sun, 13 Mar 2005 02:13:38 +0000 (GMT) Received: from kane.otenet.gr (kane.otenet.gr [195.170.0.27]) by mx1.FreeBSD.org (Postfix) with ESMTP id 2980943D49 for ; Sun, 13 Mar 2005 02:13:37 +0000 (GMT) (envelope-from keramida@ceid.upatras.gr) Received: from gothmog.gr (patr530-a208.otenet.gr [212.205.215.208]) j2D2DFaM030355; Sun, 13 Mar 2005 04:13:16 +0200 Received: from gothmog.gr (gothmog [127.0.0.1]) by gothmog.gr (8.13.3/8.13.3) with ESMTP id j2D2DWJR094748; Sun, 13 Mar 2005 04:13:32 +0200 (EET) (envelope-from keramida@ceid.upatras.gr) Received: (from giorgos@localhost) by gothmog.gr (8.13.3/8.13.3/Submit) id j2D2DWHT094747; Sun, 13 Mar 2005 04:13:32 +0200 (EET) (envelope-from keramida@ceid.upatras.gr) Date: Sun, 13 Mar 2005 04:13:32 +0200 From: Giorgos Keramidas To: Ola Theander Message-ID: <20050313021330.GA81926@gothmog.gr> Mail-Followup-To: keramida@ceid.upatras.gr, freebsd-questions@freebsd.org References: <20050313014936.TXVL23781.mxfep02.bredband.com@c0003> Mime-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <20050313014936.TXVL23781.mxfep02.bredband.com@c0003> cc: freebsd-questions@freebsd.org Subject: Re: Confused about connection between an option in rc.conf and the associated action? X-BeenThere: freebsd-questions@freebsd.org X-Mailman-Version: 2.1.1 Precedence: list List-Id: User questions List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sun, 13 Mar 2005 02:13:39 -0000 # 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 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