Package: release.debian.org
Severity: normal
Tags: jessie
User: release.debian....@packages.debian.org
Usertags: pu

cqrlog in jessie fails to remove if mysql-server is installed, but
apparmor is not. Which does not happen in the default piuparts tests
(but with --install-recommends)
So let's check for apparmor before restarting it in postrm. And let's
do the same for installation.

This was discovered during upgrades to stretch that force the removal of
cqrlog (which is not in stretch). (And piuparts currently ignores some
failures to remove packages, will be fixed soon. Otherwise we would have
found this in jessie with --install-recommends already).


Andreas
diff -Nru cqrlog-1.8.2/debian/changelog cqrlog-1.8.2/debian/changelog
--- cqrlog-1.8.2/debian/changelog	2015-02-12 02:13:37.000000000 +0100
+++ cqrlog-1.8.2/debian/changelog	2017-07-01 13:45:19.000000000 +0200
@@ -1,3 +1,11 @@
+cqrlog (1.8.2-1.1+deb8u1) jessie; urgency=medium
+
+  * Non-maintainer upload.
+  * tools/cqrlog-apparmor-fix, debian/postrm: Check for /etc/init.d/apparmor
+    before restarting apparmor.  (Closes: #864549)
+
+ -- Andreas Beckmann <a...@debian.org>  Sat, 01 Jul 2017 13:45:19 +0200
+
 cqrlog (1.8.2-1.1) unstable; urgency=medium
 
   * Non-maintainer upload.
diff -Nru cqrlog-1.8.2/debian/patches/check-for-apparmor cqrlog-1.8.2/debian/patches/check-for-apparmor
--- cqrlog-1.8.2/debian/patches/check-for-apparmor	1970-01-01 01:00:00.000000000 +0100
+++ cqrlog-1.8.2/debian/patches/check-for-apparmor	2017-07-01 13:45:19.000000000 +0200
@@ -0,0 +1,13 @@
+--- a/tools/cqrlog-apparmor-fix
++++ b/tools/cqrlog-apparmor-fix
+@@ -18,7 +18,9 @@ then
+    echo "" 
+    echo File $FILE  was modified, now restarting apparmor ...
+    echo ""
+-    /etc/init.d/apparmor restart	
++   if [ -x /etc/init.d/apparmor ]; then
++      invoke-rc.d apparmor restart
++   fi
+   fi
+ fi
+ rm $FTMP
diff -Nru cqrlog-1.8.2/debian/patches/series cqrlog-1.8.2/debian/patches/series
--- cqrlog-1.8.2/debian/patches/series	2014-01-27 20:27:15.000000000 +0100
+++ cqrlog-1.8.2/debian/patches/series	2017-07-01 13:45:19.000000000 +0200
@@ -1,2 +1,3 @@
 makefile-no-homedir-use
 desktop-keywords
+check-for-apparmor
diff -Nru cqrlog-1.8.2/debian/postrm cqrlog-1.8.2/debian/postrm
--- cqrlog-1.8.2/debian/postrm	2014-01-26 13:13:24.000000000 +0100
+++ cqrlog-1.8.2/debian/postrm	2017-07-01 13:45:19.000000000 +0200
@@ -15,11 +15,13 @@
     echo ""
     echo Changes removed from $FILE 
     echo ""   
+    if [ -x /etc/init.d/apparmor ]; then
     if which invoke-rc.d >/dev/null 2>&1; then
        invoke-rc.d apparmor restart
     else
       /etc/init.d/apparmor restart
     fi
+    fi
   else
     echo ""
     echo Changes from $FILE already removed

Reply via email to