mirror of
https://gitlab.com/apparmor/apparmor
synced 2025-08-30 05:47:59 +00:00
Make the systemd unit a no-op in containers with no internal policy
This commit is contained in:
parent
fb35ee4efc
commit
c44e93d856
@ -71,6 +71,13 @@ fi
|
|||||||
|
|
||||||
case "$1" in
|
case "$1" in
|
||||||
start)
|
start)
|
||||||
|
if [ -x /usr/bin/systemd-detect-virt ] && \
|
||||||
|
systemd-detect-virt --quiet --container && \
|
||||||
|
! is_container_with_internal_policy; then
|
||||||
|
aa_log_daemon_msg "Not starting AppArmor in container"
|
||||||
|
aa_log_end_msg 0
|
||||||
|
exit 0
|
||||||
|
fi
|
||||||
apparmor_start
|
apparmor_start
|
||||||
rc=$?
|
rc=$?
|
||||||
;;
|
;;
|
||||||
@ -79,6 +86,13 @@ case "$1" in
|
|||||||
rc=$?
|
rc=$?
|
||||||
;;
|
;;
|
||||||
restart|reload|force-reload)
|
restart|reload|force-reload)
|
||||||
|
if [ -x /usr/bin/systemd-detect-virt ] && \
|
||||||
|
systemd-detect-virt --quiet --container && \
|
||||||
|
! is_container_with_internal_policy; then
|
||||||
|
aa_log_daemon_msg "Not starting AppArmor in container"
|
||||||
|
aa_log_end_msg 0
|
||||||
|
exit 0
|
||||||
|
fi
|
||||||
apparmor_restart
|
apparmor_restart
|
||||||
rc=$?
|
rc=$?
|
||||||
;;
|
;;
|
||||||
|
Loading…
x
Reference in New Issue
Block a user