apparmor: Multiple definitions ... bailing out
Affects | Status | Importance | Assigned to | Milestone | |
---|---|---|---|---|---|
lxc (Ubuntu) |
Invalid
|
Undecided
|
Unassigned |
Bug Description
When one creates a incorrect profile, apparmor_parser seems to leave an artifact of the "problem" file in the same directory, which in turn leads to another error, when the file gets fixed. Not sure, how appamor stuff works, but this is simply an unacceptable behavior! It should put its temp. stuff to its own private directory, if it really needs to make a copy of whatever ....
E.g.: ( lxc-default == package delivered original)
ls -l /etc/apparmor.d/lxc
total 40
-rw-r--r-- 1 root root 506 Nov 19 21:34 lxc-default
-rw-r--r-- 1 root root 544 Oct 10 06:53 lxc-default-
-rw-r--r-- 1 root root 588 Oct 10 06:53 lxc-default-
sudo sed -e '/}/ i\\tmount options (rw, bind),' -i /etc/apparmor.
sudo apparmor_parser -r /etc/apparmor.
: AppArmor parser error for /etc/apparmor.
ls -l /etc/apparmor.d/lxc
total 40
-rw-r--r-- 1 root root 506 Nov 19 21:35 lxc-default
-rw-r--r-- 1 root root 544 Oct 10 06:53 lxc-default-
-rw-r--r-- 1 root root 588 Oct 10 06:53 lxc-default-
-rw-r--r-- 1 root root 479 Nov 19 21:34 lxc-defaulte
# fix it:
sed -e '/mount options/ s,options ,options=,' -i /etc/apparmor.
sudo apparmor_parser -r /etc/apparmor.
: Multiple definitions for profile lxc-container-
You're getting the error message about multiple profiles because of the extra 'lxc-defaulte' file, which presumably defines the same profile as is defined in lxc-default. Remove that file and the load should go fine.