mirror_lxc/config/init/systemd/lxc-apparmor-load
Martin Pitt 2b24e2ff84 systemd: Load AppArmor profiles if necessary/supported
On Ubuntu we need to set up the AppArmor profiles also under systemd.
Add a new helper "lxc-apparmor-load" and integrate it into lxc.service.

Signed-off-by: Martin Pitt <martin.pitt@ubuntu.com>
Acked-by: Serge E. Hallyn <serge.hallyn@ubuntu.com>
2014-08-04 15:24:39 -04:00

15 lines
385 B
Bash
Executable File

#!/bin/sh
# lxc-apparmor-load: Load AppArmor profiles, if supported by the system
set -eu
# don't load profiles if mount mediation is not supported
SYSF=/sys/kernel/security/apparmor/features/mount/mask
if [ -f $SYSF ]; then
if [ -x /lib/init/apparmor-profile-load ]; then
/lib/init/apparmor-profile-load usr.bin.lxc-start
/lib/init/apparmor-profile-load lxc-containers
fi
fi