[Pkg-clamav-commits] [SCM] Debian repository for ClamAV branch, debian/unstable, updated. debian/0.94.dfsg.1-1-3-g2b91058

Michael Tautschnig mt at debian.org
Sun Nov 23 02:26:13 UTC 2008


The following commit has been merged in the debian/unstable branch:
commit 2b910586c91ae257c062c09a9e46c25b3fd9d318
Author: Michael Tautschnig <mt at debian.org>
Date:   Sat Nov 22 18:22:09 2008 -0800

    Wait clamav-milter.init when upgrading clamd
    
    - Touch /var/run/clamav-daemon-being-upgraded in clamav-daemon.prerm on
      "upgrade"
    - rm -f it in clamav-daemon.postinst
    - Wait for up to 30secs in clamav-milter.init in action start if that file
      exists (this wait may be unnecessary, but that hopefully doesn't really hurt)
    
    Signed-off-by: Michael Tautschnig <mt at debian.org>

diff --git a/debian/changelog b/debian/changelog
index 6e90b33..bf6374d 100644
--- a/debian/changelog
+++ b/debian/changelog
@@ -5,6 +5,8 @@ clamav (0.94.dfsg.1-2) unstable; urgency=low
   
   [ Michael Tautschnig ]
   * Removed --unzip from clampipe script (closes: #506055)
+  * Wait before starting clamav-milter when clamav-daemon is being upgraded
+    (closes: #309067)
 
  -- Michael Meskes <meskes at debian.org>  Sat, 22 Nov 2008 17:47:27 -0800
 
diff --git a/debian/clamav-daemon.postinst.in b/debian/clamav-daemon.postinst.in
index 070180d..007b7f1 100644
--- a/debian/clamav-daemon.postinst.in
+++ b/debian/clamav-daemon.postinst.in
@@ -89,4 +89,6 @@ esac
 
 #DEBHELPER#
 
+rm -f /var/run/clamav-daemon-being-upgraded
+
 exit 0
diff --git a/debian/clamav-daemon.prerm b/debian/clamav-daemon.prerm
new file mode 100644
index 0000000..a208921
--- /dev/null
+++ b/debian/clamav-daemon.prerm
@@ -0,0 +1,19 @@
+#! /bin/sh
+set -e
+
+case "$1" in
+  upgrade)
+# information for clamav-milter that clamd is in the process of being upgraded,
+# which may cause problems when using --external in clamav-milter (see #309067);
+# clamav-milter will check for this file and wait for clamd for up to 30secs
+  touch /var/run/clamav-daemon-being-upgraded
+  ;;
+esac
+
+# dh_installdeb will replace this with shell code automatically
+# generated by other debhelper scripts.
+
+#DEBHELPER#
+
+exit 0
+
diff --git a/debian/clamav-milter.init.in b/debian/clamav-milter.init.in
index cbfbcd2..5ba928a 100644
--- a/debian/clamav-milter.init.in
+++ b/debian/clamav-milter.init.in
@@ -23,6 +23,7 @@ OPTIONS="-dq"
 SUPERVISOR=/usr/bin/daemon
 SUPERVISORPIDFILE="/var/run/clamav/daemon-clamav-milter.pid"
 SUPERVISORARGS="-F $SUPERVISORPIDFILE --name=$BASENAME --respawn"
+CLAMAVDAEMONUPGRADE="/var/run/clamav-daemon-being-upgraded"
 
 [ -x "$DAEMON" ] || exit 0
 [ -r "$CLAMAVCONF" ] || exit 0
@@ -86,6 +87,19 @@ case "$1" in
       exit 1
     fi
   fi
+  if [ -e "$CLAMAVDAEMONUPGRADE" ] ; then
+    cnt=0
+    while [ -e "$CLAMAVDAEMONUPGRADE" ] ; do
+      cnt=`expr "$cnt" + 1`
+      if [ "$cnt" -gt 15 ]; then
+        break
+      fi
+      sleep 2
+    done
+    if [ -e "$CLAMAVDAEMONUPGRADE" ]; then
+      log_warning_msg "clamd may be required to run $DAEMON, but is still being upgraded!"
+    fi
+  fi
   if [ -z "$RUN_SUPERVISED" ] ; then
     log_daemon_msg "Starting $DESC" "$BASENAME"
     su "$User" -p -s /bin/sh -c ". /lib/lsb/init-functions && start_daemon $DAEMON $OPTIONS --pidfile $PIDFILE $SOCKET" > /dev/null

-- 
Debian repository for ClamAV



More information about the Pkg-clamav-commits mailing list