mirror_lxc/config/init/systemd/lxc-apparmor-load
Alexander Mikhalitsyn d51ea224e8
config: apparmor: add AppArmor profile for lxc-copy
lxc-copy can start container as lxc-start does in some cases,
so we need to have the same profile for it.

Signed-off-by: Alexander Mikhalitsyn <aleksandr.mikhalitsyn@canonical.com>
2024-02-15 17:59:59 +01:00

19 lines
618 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/apparmor/profile-load ]; then
/lib/apparmor/profile-load usr.bin.lxc-copy
/lib/apparmor/profile-load usr.bin.lxc-start
/lib/apparmor/profile-load lxc-containers
elif [ -x /lib/init/apparmor-profile-load ]; then
/lib/init/apparmor-profile-load usr.bin.lxc-copy
/lib/init/apparmor-profile-load usr.bin.lxc-start
/lib/init/apparmor-profile-load lxc-containers
fi
fi