From owner-freebsd-current Fri Feb 21 21:20:20 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 D7F5D37B401 for ; Fri, 21 Feb 2003 21:20:18 -0800 (PST) Received: from kientzle.com (h-66-166-149-50.SNVACAID.covad.net [66.166.149.50]) by mx1.FreeBSD.org (Postfix) with ESMTP id 8323E43FBD for ; Fri, 21 Feb 2003 21:20:17 -0800 (PST) (envelope-from kientzle@acm.org) Received: from acm.org (ugly.x.kientzle.com [66.166.149.51]) by kientzle.com (8.11.3/8.11.3) with ESMTP id h1M5KGM01948; Fri, 21 Feb 2003 21:20:16 -0800 (PST) (envelope-from kientzle@acm.org) Message-ID: <3E570890.8090407@acm.org> Date: Fri, 21 Feb 2003 21:20:16 -0800 From: Tim Kientzle Reply-To: kientzle@acm.org User-Agent: Mozilla/5.0 (X11; U; FreeBSD i386; en-US; rv:0.9.6) Gecko/20011206 X-Accept-Language: en-us, en MIME-Version: 1.0 To: current@freebsd.org Cc: Julian Elischer Subject: Re: config files and includes Content-Type: text/plain; charset=us-ascii; format=flowed Content-Transfer-Encoding: 7bit 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 > 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. Hmmm... glancing through syslogd.c, it doesn't look like it would be hard to alter it to support multiple -f options. In that case, just add the following to rc.conf (or /etc/rc.d/syslogd, I suppose): if [ -e /etc/syslog.local ] then syslogd_args="$syslogd_args -f /etc/syslog.local" fi for f in /usr/local/etc/syslogd.d/* do syslogd_args="$syslogd_args -f $f" done This largely removes the need for include handling. It doesn't allow you to override or remove existing entries, though. One approach that preserves backward compatibility would be to allow optional line numbers, with duplicates overriding earlier entries. That requires some non-trivial code changes to support, but it shouldn't be too hard. There's also considerable precedent for using cpp or m4 to preprocess configuration files. Either supports file inclusions, conditionals, etc. It's generally not too hard to support this: it usually just involves replacing fopen() with popen(). Tim Kientzle To Unsubscribe: send mail to majordomo@FreeBSD.org with "unsubscribe freebsd-current" in the body of the message