From owner-freebsd-current Thu Feb 20 19:16:38 2003 Delivered-To: freebsd-current@freebsd.org Received: from mx1.FreeBSD.org (mx1.freebsd.org [216.136.204.125]) by hub.freebsd.org (Postfix) with ESMTP id 9FF4337B401 for ; Thu, 20 Feb 2003 19:16:35 -0800 (PST) Received: from sccrmhc01.attbi.com (sccrmhc01.attbi.com [204.127.202.61]) by mx1.FreeBSD.org (Postfix) with ESMTP id BDFA843F75 for ; Thu, 20 Feb 2003 19:16:32 -0800 (PST) (envelope-from julian@elischer.org) Received: from interjet.elischer.org (12-232-168-4.client.attbi.com[12.232.168.4]) by sccrmhc01.attbi.com (sccrmhc01) with ESMTP id <2003022103163100100g3tb3e>; Fri, 21 Feb 2003 03:16:31 +0000 Received: from localhost (localhost.elischer.org [127.0.0.1]) by InterJet.elischer.org (8.9.1a/8.9.1) with ESMTP id TAA45251; Thu, 20 Feb 2003 19:16:30 -0800 (PST) Date: Thu, 20 Feb 2003 19:16:29 -0800 (PST) From: Julian Elischer To: John De Boskey Cc: FreeBSD current users Subject: Re: config files and includes. In-Reply-To: <20030221030419.GA89373@BSDWins.Com> Message-ID: MIME-Version: 1.0 Content-Type: TEXT/PLAIN; charset=US-ASCII Sender: owner-freebsd-current@FreeBSD.ORG Precedence: bulk List-ID: List-Archive: (Web Archive) List-Help: (List Instructions) List-Subscribe: List-Unsubscribe: X-Loop: FreeBSD.ORG On Thu, 20 Feb 2003, John De Boskey wrote: > ----- Julian Elischer's Original Message ----- > > > > I have just gone through the process of upgrading or installing several > > hundred machines, and Thst includes altering or editing many config > > files in /etc. I like the way that rc.conf > > is handled, in that defaults/rc.comf can be updated and only the > > local changes live in r.conf. I wish that more files had this > > capability. > > This is not exactly what you are asking for, but this is from > a petty much a been-there/done-that many years ago. Typing in > the logic from memory: > > rcfiles="/etc/inetd.conf /etc/syslog.conf /etc/newsyslog.conf" > > for rcf in $rcfiles; do > if [ -f ${rcf}.local ]; then > if [ ! -f ${rcf}.base ]; then > if diff ${rcf} ${rcf}.base > /dev/null; then > cp -p ${rcf} ${rcf}.base > fi > fi > cat ${rcf}.base ${rcf}.local > ${rcf} > fi > done > > I think you can get the idea. yeah but we don't distribute our files like that.. you get a new syslogd.conf when you upgrade, not a syslogd.conf.base (unfortunartly) I considered this possibilty. especially as many daemons etc. have an argument that they can take for a config file, and the argument is often changeable from rc.conf. e.g. . /usr/local/concatfiles syslogd_flags="-s -f/etc/syslogd.local" [...] where /usr/local/concatfiles does: cat /etc/syslogd.conf /usr/local/etc/syslogd.conf >/etc/syslogd.local or in some cases: if ! grep -q "already patched" etc/login.conf.diff patch > -John > > > For example syslogd.conf or newsyslog.conf are updated between releases > > but they are also prime candidates for local additions. > > What would be really cool is if more config files could > > do 'includes' so that you could have a syslogd.local.conf > > wher eall your local entries could be. In addition you could make it > > look in /usr/local/etc/syslogd.conf for loging requirments for > > packages. > > > > To do this for every config file would be a lot of work. I do wonder > > however whether there couldn't be some "config-file reader" library > > routine that could be used to pre-pass files and do inclusions.. > > > > if the interface was very similar to what is usually used > > (people tend to either use open/read/close or > > fopen/fscanf (etc). > > > > equivalent calls could be made that use a stream of data that is > > pre-processed to do inclusions etc. That would making retrofitting > > relatively easy. Programs that use yacc/lex ar emore difficult, > > but I haven't looked into it.. > > > > anyhow, that was just a thought. > > > > > > To Unsubscribe: send mail to majordomo@FreeBSD.org > > with "unsubscribe freebsd-current" in the body of the message > > -- > -- > As said by Napolean Bonaparte: > "Never ascribe to malice, that which is adequately explained by incompetence" > > After being embraced by MS: > > "When accused of malice, always hide behind incompetence". > To Unsubscribe: send mail to majordomo@FreeBSD.org with "unsubscribe freebsd-current" in the body of the message