Bug#864549: cqrlog: fails to remove: invoke-rc.d: unknown initscript, /etc/init.d/apparmor not found.
Followup-For: Bug #864549
Control: tag -1 patch
Hi,
attached is a proposed patch for fixing this issue in jessie.
If you want, I can file the jessie-pu request and get the fix into
jessie.
This also fixes another issue that was not noticed before:
cqrlog cannot be installed in jessie if mysql-server is installed but
apparmor is not installed.
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 <anbe@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 to: