Reload AppArmor when policies are changed

AppArmor needs to be reloaded when new policies are written, not only
when the 'aa-profile-mode' config option is changed.

Change-Id: Ia2990cdc03f6fa0d3a38e4a3247422f0950ee0eb
Closes-Bug: 1755823
This commit is contained in:
Tilman Baumann 2018-03-14 15:21:07 +01:00 committed by James Page
parent 921b99875c
commit 6ad15f94ed
1 changed files with 3 additions and 0 deletions

View File

@ -48,6 +48,7 @@ from charmhelpers.core.host import (
service_reload,
service_restart,
add_to_updatedb_prunepath,
restart_on_change
)
from charmhelpers.fetch import (
add_source,
@ -134,6 +135,8 @@ def tune_network_adapters():
ceph.tune_nic(interface)
@restart_on_change({'/etc/apparmor.d/usr.bin.ceph-osd': ['apparmor']},
restart_functions={'apparmor': service_reload})
def copy_profile_into_place():
"""
Copy the apparmor profiles included with the charm