[Pkg-clamav-commits] [SCM] Debian repository for ClamAV branch, debian/unstable, updated. debian/0.95+dfsg-1-6176-gc2c709a

Michael Tautschnig mt at debian.org
Tue Apr 13 17:43:09 UTC 2010


The following commit has been merged in the debian/unstable branch:
commit 11279ac1d8d7720cb68efb636a88c9aaebc83ee8
Author: Michael Tautschnig <mt at debian.org>
Date:   Tue Apr 13 19:21:28 2010 +0200

    Added logrotate conf file handling for freshclam
    
    - closes: #577041
    
    Signed-off-by: Michael Tautschnig <mt at debian.org>

diff --git a/debian/changelog b/debian/changelog
index 7c0c4dc..60daba4 100644
--- a/debian/changelog
+++ b/debian/changelog
@@ -8,8 +8,11 @@ clamav (0.96+dfsg-2) unstable; urgency=low
   [ Stephen Gran ]
   * Note that this series (closes: #577462)
   * Added debconf handling of new config options
+  
+  [ Michael Tautschnig ]
+  * Create and maintain logrotate file (closes: #577041)
 
- -- Stephen Gran <sgran at debian.org>  Mon, 12 Apr 2010 23:01:54 +0100
+ -- Stephen Gran <sgran at debian.org>  Tue, 13 Apr 2010 19:21:18 +0200
 
 clamav (0.96+dfsg-1) unstable; urgency=low
 
diff --git a/debian/clamav-freshclam.postinst.in b/debian/clamav-freshclam.postinst.in
index 0b74d8b..d868dcc 100644
--- a/debian/clamav-freshclam.postinst.in
+++ b/debian/clamav-freshclam.postinst.in
@@ -96,6 +96,46 @@ case "$1" in
 
   slurp_config "$FRESHCLAMCONFFILE"
 
+  if [ -n "$LogFile" ]; then
+    if echo "$LogFile" | grep -q '^/dev/'; then
+      make_logrotate=false
+    else
+      make_logrotate=true
+    fi
+    [ -n "$User" ] || User=clamav
+    if [ "$make_logrotate" = 'true' ]; then
+      echo "$LogFile {" > $DEBROTFILE
+      echo "     rotate 12" >> $DEBROTFILE
+      echo "     weekly" >> $DEBROTFILE
+      echo "     compress" >> $DEBROTFILE
+      echo "     delaycompress" >> $DEBROTFILE
+      echo "     missingok" >> $DEBROTFILE
+      echo "     create 640  $User adm" >> $DEBROTFILE
+      echo "     postrotate" >> $DEBROTFILE
+      echo "     /etc/init.d/clamav-freshclam reload-log > /dev/null" >> $DEBROTFILE
+      echo "     endscript" >> $DEBROTFILE
+      echo "     }" >> $DEBROTFILE
+      touch "$LogFile"
+      chown "$User":adm "$LogFile"
+      chmod 0640 "$LogFile"
+      ucf_cleanup "$LOGROTFILE"
+      ucf_upgrade_check "$LOGROTFILE" "$DEBROTFILE" /var/lib/ucf/cache/:etc:logrotate.d:clamav-freshclam
+      rm -f $DEBROTFILE
+    else
+      if [ -e "$LOGROTFILE" ]; then
+        echo "Disabling old logrotate script for clamav-freshclam"
+        mv "$LOGROTFILE" "$CLAMAVROTATEFILE".dpkg-old
+        ucf -p "$LOGROTFILE"
+      fi
+    fi
+  else
+    if [ -e "$LOGROTFILE" ]; then
+      echo "Disabling old logrotate script for clamav-freshclam"
+      mv "$LOGROTFILE" "$CLAMAVROTATEFILE".dpkg-old
+      ucf -p "$LOGROTFILE"
+    fi
+  fi
+
   # Make sure user changes to unasked questions remain intact
   [ -n "$DatabaseOwner" ] && [ "$DatabaseOwner" != "$dbowner" ] && dbowner="$DatabaseOwner"
   [ -n "$UpdateLogFile" ] && [ "$UpdateLogFile" != "$udlogfile" ] && udlogfile="$UpdateLogFile"

-- 
Debian repository for ClamAV



More information about the Pkg-clamav-commits mailing list