[Amavisd-new-debian-devel] Amavisd-new 2.2.1

Brian May amavisd-new-debian-devel@lists.alioth.debian.org
Fri, 01 Apr 2005 11:15:05 +1000


Hello,

I seem to have lost the messages from Mark on his suggestions for
using the multiple config files.  I thought they were archived in the
mailing list, but apparently not :-(.

Anyway, my (untested) suggestion is as follows:

Suggestion #1:

/etc/amavis/conf.d: directory for configuration.

00-upstream    - default settings from upstream.
                 e.g. pristine config file from upstream.
10-debian      - default settings recommended by Debian,
                 may override above.
20-debconf     - settings automatically detected by
                 installation scripts, either by automatic checks
                 or use of debconf (or combination).
30-???         - reserved
40-???         - reserved
50-???         - end user customisation, depends on user requirements.
                 we don't touch anything here.

(all files conffiles except 20-debconf which would be automatically generated)

Alternative #2:

Place 00-upstream and 10-debian under /usr/share/amavis/conf.d, so
they don't need to be conffiles. Any settings can be overridden by
files under /etc/amavis/conf.d anyway.

This means there would never be any need to worry about merging
conffiles, with the exception of 20-debconf, which shouldn't be
changed locally anyway.

Here is a proposed (untested) patch for #1:

? amavisd.new
? helper-progs/config.log
Index: debian/amavisd-new.init
===================================================================
RCS file: /cvsroot/amavisd-new/amavisd-new/debian/amavisd-new.init,v
retrieving revision 1.16
diff -u -r1.16 amavisd-new.init
--- debian/amavisd-new.init	26 Dec 2004 13:16:23 -0000	1.16
+++ debian/amavisd-new.init	1 Apr 2005 01:02:17 -0000
@@ -14,7 +14,8 @@
 NAME=amavisd
 DAEMONNAME=amavisd-new
 DESC=amavisd
-PARAMS=""
+CONFFILE="/var/lib/amavis/amavisd.conf"
+PARAMS="-c $CONFFILE"
 
 test -f ${DAEMON} || exit 0
 
@@ -22,6 +23,14 @@
 
 START="--start --quiet --pidfile /var/run/amavis/${NAME}.pid --name ${DAEMONNAME} --startas ${DAEMON} -- ${PARAMS}"
 
+createconf() {
+        : > ${CONFFILE}
+        for i in `run-parts --test /etc/amavis/conf.d`
+        do
+                cat $i >> ${CONFFILE}
+        done
+}
+
 createdir() {
 # $1 = user
 # $2 = group
@@ -57,6 +66,7 @@
   start)
 	echo -n "Starting $DESC: "
 	fixdirs
+	createconf
 	if start-stop-daemon ${START} >/dev/null ; then
 		echo "amavisd-new."
 	else
@@ -87,6 +97,7 @@
 	;;
   reload)
 	echo "Reloading $DESC configuration files."
+	createconf
 	start-stop-daemon --stop --signal 1 --quiet --pidfile \
 		/var/run/amavis/$NAME.pid --name $DAEMONNAME
   	;;






Any comments?
-- 
Brian May <bam@debian.org>