scripts: check if we run on an AppArmor enabled system before loading profile

This commit is contained in:
Simon Fels 2018-05-23 16:38:51 +02:00
commit 65af894a95

View file

@ -38,8 +38,10 @@ start() {
# liblxc.so.1 is in $SNAP/lib
export LD_LIBRARY_PATH=$LD_LIBRARY_PATH:$SNAP/lib
# Load the profile for our Android container
$SNAP/sbin/apparmor_parser -r $SNAP/apparmor/anbox-container.aa
if [ -d /sys/kernel/security/apparmor ] ; then
# Load the profile for our Android container
$SNAP/sbin/apparmor_parser -r $SNAP/apparmor/anbox-container.aa
fi
exec $AA_EXEC $SNAP/bin/anbox-wrapper.sh container-manager \
--data-path=$DATA_PATH \