On 11/08/15 17:54, Petr Hlozek wrote: > I don't know how to solve this. The script in post install adds > something to apparmor rules and the apparmor has to be restarted.
Yes. The problem seems *not* to be systemd/upstart/init related, it is more that apparmor files exist in /etc even when apparmor is not installed. So you test for the files in /etc/apparmor.d and if they exist you assume that apparmor is installed and try to restart it. I have made a simple patch (attached) that checks to make sure /etc/init.d/apparmor exists before executing it. 73, Colin G8TMV -- Colin Tuckley | +44(0)1223 830814 | PGP/GnuPG Key Id Debian Developer | +44(0)7799 143369 | 0x38C9D903
Do not call /etc/init.d/apparmor unless it exists Author: col...@debian.org --- a/tools/cqrlog-apparmor-fix +++ b/tools/cqrlog-apparmor-fix @@ -1,5 +1,6 @@ #!/bin/bash FILE=/etc/apparmor.d/usr.sbin.mysqld +IFILE=/etc/init.d/apparmor FTMP=`mktemp /tmp/tmp.XXXXXX` if [ -f $FILE ] then @@ -18,7 +19,10 @@ echo "" echo File $FILE was modified, now restarting apparmor ... echo "" + if [ -f $IFILE ] + then /etc/init.d/apparmor restart + fi fi fi rm $FTMP