From owner-freebsd-current Mon Mar 22 6:29: 3 1999 Delivered-To: freebsd-current@freebsd.org Received: from quackerjack.cc.vt.edu (quackerjack.cc.vt.edu [198.82.160.250]) by hub.freebsd.org (Postfix) with ESMTP id 54A6D14ED8 for ; Mon, 22 Mar 1999 06:28:57 -0800 (PST) (envelope-from jobaldwi@vt.edu) Received: from sable.cc.vt.edu (sable.cc.vt.edu [128.173.16.30]) by quackerjack.cc.vt.edu (8.8.8/8.8.8) with ESMTP id JAA06392; Mon, 22 Mar 1999 09:28:30 -0500 (EST) Received: from john.baldwin.cx (jobaldwi.campus.vt.edu [198.82.67.63]) by sable.cc.vt.edu (8.8.8/8.8.8) with ESMTP id JAA18595; Mon, 22 Mar 1999 09:28:26 -0500 (EST) Message-ID: X-Mailer: XFMail 1.3 [p0] on FreeBSD X-Priority: 3 (Normal) Content-Type: text/plain; charset=us-ascii Content-Transfer-Encoding: 8bit MIME-Version: 1.0 In-Reply-To: <36F64C3D.9369B963@newsguy.com> Date: Mon, 22 Mar 1999 09:28:29 -0500 (EST) From: John Baldwin To: "Daniel C. Sobral" Subject: Re: /etc/rc.conf, take 46! Cc: current@FreeBSD.ORG, "Jordan K. Hubbard" , Richard Wackerbarth , John Baldwin Sender: owner-freebsd-current@FreeBSD.ORG Precedence: bulk X-Loop: FreeBSD.ORG On 22-Mar-99 Daniel C. Sobral wrote: > John Baldwin wrote: >> >> However, the original definition has already been used once the /etc/rc.conf >> has been read. Unless you are going to call the for loop twice, once after >> /etc/defaults/rc.conf to include /etc/rc.conf and once after /etc/rc.conf to >> include the extra stuff you define, your changes to ${rc_conf_files} in >> /etc/rc.conf will never take effect. > > Make a sucking function (or separate script), call it recursively > for each time rc_conf_files change. > >#!/bin/sh > for file in $1 > do > . $file > if [ "${rc_conf_files}X" != "$*X" ] then > . $0 "${rc_conf_files}" > fi > done I would move the if-statemeount outside the for loop. Say config file a defines rc_conf_files="b c", and config file b defines rc_conf_files="d". a is executed and then b is sucked in, rc_conf_files has changed, so the function calls itself to read in config file "d". Then the recursive call returns and "c" is read. Thus, the files would be read in the order a, b, d, c and "c" could possibly override customizations the user had put in d. To me the logical order for the files to be read in would be a, b, c, d. Moving the if-statement outside of the for loop would give the latter behavior. Other than that it works for me. > -- > Daniel C. Sobral (8-DCS) > dcs@newsguy.com > dcs@freebsd.org > > "What happened?" > "It moved, sir!" --- John Baldwin -- http://members.freedomnet.com/~jbaldwin/ PGP Key: http://members.freedomnet.com/~jbaldwin/pgpkey.asc To Unsubscribe: send mail to majordomo@FreeBSD.org with "unsubscribe freebsd-current" in the body of the message