The attached patch for the rc.amavisd file adds a variable to
specify the log directory allowing site override in rc.conf. It
also makes the log directory if it isn't present when %daily runs.
Bill
--
INTERNET: [EMAIL PROTECTED] Bill Campbell; Celestial Systems, Inc.
UUCP: camco!bill PO Box 820; 6641 E. Mercer Way
FAX: (206) 232-9186 Mercer Island, WA 98040-0820; (206) 236-1676
URL: http://www.celestial.com/
We contend that for a nation to try to tax itself into prosperity is like a
man standing in a bucket and trying to lift himself up by the handle.
-- Winston Churchill
--- rc.amavisd.orig 2004-09-07 02:34:49.000000000 -0500
+++ rc.amavisd 2005-02-01 16:51:02.000000000 -0600
@@ -10,6 +10,7 @@
amavisd_log_numfiles="10"
amavisd_log_minsize="1M"
amavisd_log_complevel="9"
+ amavisd_log_directory='@l_prefix@/var/amavisd'
amavisd_sum_flags=""
%common
@@ -47,21 +48,25 @@
%daily -u @l_rusr@
rcService amavisd enable yes || exit 0
-
+ # make log directory if it doesn't exist
+ [ -d $amavisd_log_directory ] || {
+ mkdir $amavisd_log_directory
+ chmod 700 $amavisd_log_directory
+ }
# rotate summary logfile
shtool rotate -f \
-n ${amavisd_log_numfiles} -s 0 \
-z ${amavisd_log_complevel} -m 640 \
- @l_prefix@/var/amavisd/amavisd.sum
+ $amavisd_log_directory/amavisd.sum
# generate summary logfile
- logfiles="@l_prefix@/var/amavisd/amavisd.log"
- if [ -f "@l_prefix@/var/amavisd/amavisd.log.0" ]; then
- logfiles="@l_prefix@/var/amavisd/amavisd.log.0 $logfiles"
+ logfiles="$amavisd_log_directory/amavisd.log"
+ if [ -f "$amavisd_log_directory/amavisd.log.0" ]; then
+ logfiles="$amavisd_log_directory/amavisd.log.0 $logfiles"
fi
cat ${logfiles} | @l_prefix@/sbin/amavislogsumm \
-d yesterday -R -B ${amavisd_sum_flags} \
- >@l_prefix@/var/amavisd/amavisd.sum 2>/dev/null
+ >$amavisd_log_directory/amavisd.sum 2>/dev/null
# rotate logfile
shtool rotate -f \
@@ -69,5 +74,5 @@
-z ${amavisd_log_complevel} -m 640 \
-P "${amavisd_log_prolog}" \
-E "${amavisd_log_epilog}; rc amavisd restart" \
- @l_prefix@/var/amavisd/amavisd.log
+ $amavisd_log_directory/amavisd.log