Skip site navigation (1)Skip section navigation (2)
Date:      Fri, 21 Feb 2003 21:20:16 -0800
From:      Tim Kientzle <kientzle@acm.org>
To:        current@freebsd.org
Cc:        Julian Elischer <julian@elischer.org>
Subject:   Re: config files and includes
Message-ID:  <3E570890.8090407@acm.org>

next in thread | raw e-mail | index | archive | help
> 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




Want to link to this message? Use this URL: <https://mail-archive.FreeBSD.org/cgi/mid.cgi?3E570890.8090407>