Comment 0 for bug 1295816

Revision history for this message
Jamie Strandboge (jdstrand) wrote : /etc/init.d/apparmor reload complains if /var/lib/apparmor/profiles is empty

On a new trusty install:
$ sudo /etc/init.d/apparmor reload
 * Reloading AppArmor profiles
Skipping profile in /etc/apparmor.d/disable: usr.bin.firefox
Skipping profile in /etc/apparmor.d/disable: usr.sbin.rsyslogd
Warning from stdin (line 1): /sbin/apparmor_parser: cannot use or update cache, disable, or force-complain via stdin

Add ing 'set -x' to /lib/apparmor/functions, we can see why:

+ [ ! -d /var/lib/apparmor/profiles ]
+ wc -l
+ find /var/lib/apparmor/profiles -type f
+ num=2
+ [ 2 = 0 ]
+ cache_args=--cache-loc=/etc/apparmor.d/cache
+ [ /var/lib/apparmor/profiles = /var/lib/apparmor/profiles ]
+ [ -d /var/cache/apparmor ]
+ cache_args=--cache-loc=/var/cache/apparmor
+ getconf _NPROCESSORS_ONLN
+ + read profile
egrep+ -v (\.dpkg-(new|old|dist|bak)|~)$
ls -1 /var/lib/apparmor/profiles
+ xargs -n1 -d\n -P1 /sbin/apparmor_parser --write-cache --replace --cache-loc=/var/cache/apparmor --
Warning from stdin (line 1): /sbin/apparmor_parser: cannot use or update cache, disable, or force-complain via stdin

We shouldn't process /var/lib/apparmor/profiles if it is empty.