mirror of
https://github.com/apache/cloudstack.git
synced 2025-11-03 04:12:31 +01:00
disable apparmor profile is better than disable the whole service
This commit is contained in:
parent
714ab83fa1
commit
9956bdeefc
@ -322,13 +322,19 @@ class securityPolicyConfigUbuntu(serviceCfgBase):
|
||||
|
||||
def config(self):
|
||||
try:
|
||||
if bash("service apparmor status").getStdout() == "":
|
||||
cmd = bash("service apparmor status")
|
||||
if not cmd.isSuccess() or cmd.getStdout() == "":
|
||||
self.spRunning = False
|
||||
return True
|
||||
|
||||
bash("service apparmor stop")
|
||||
|
||||
bash("update-rc.d -f apparmor remove")
|
||||
if not bash("apparmor_status |grep libvirt").isSuccess():
|
||||
return True
|
||||
|
||||
bash("ln -s /etc/apparmor.d/usr.sbin.libvirtd /etc/apparmor.d/disable/")
|
||||
bash("ln -s /etc/apparmor.d/usr.lib.libvirt.virt-aa-helper /etc/apparmor.d/disable/")
|
||||
bash("apparmor_parser -R /etc/apparmor.d/usr.sbin.libvirtd")
|
||||
bash("apparmor_parser -R /etc/apparmor.d/usr.lib.libvirt.virt-aa-helper")
|
||||
|
||||
return True
|
||||
except:
|
||||
raise CloudRuntimeException("Failed to configure apparmor, please see the /var/log/cloud/setupAgent.log for detail, \
|
||||
|
||||
Loading…
x
Reference in New Issue
Block a user