disable nfs directory cache on kvm host

This commit is contained in:
Edison Su 2012-01-31 14:34:26 -08:00
parent 08bb9eaf47
commit 262ad16f4c
2 changed files with 29 additions and 0 deletions

View File

@ -321,6 +321,33 @@ class cgroupConfig(serviceCfgBase):
logging.debug(formatExceptionInfo())
return False
class nfsConfig(serviceCfgBase):
def __init__(self, syscfg):
super(nfsConfig, self).__init__(syscfg)
self.serviceName = "Nfs"
def config(self):
try:
if not os.path.exists("/etc/nfsmount.conf"):
return True
cfo = configFileOps("/etc/nfsmount.conf")
cfo.addEntry("AC", "False")
cfo.save()
self.syscfg.svo.enableService("rpcbind")
self.syscfg.svo.stopService("rpcbind")
self.syscfg.svo.startService("rpcbind")
self.syscfg.svo.enableService("nfs")
self.syscfg.svo.stopService("nfs")
self.syscfg.svo.startService("nfs")
return True
except:
logging.debug(formatExceptionInfo())
return False
class securityPolicyConfigUbuntu(serviceCfgBase):
def __init__(self, syscfg):
super(securityPolicyConfigUbuntu, self).__init__(syscfg)

View File

@ -133,6 +133,7 @@ class sysConfigAgentUbuntu(sysConfigAgent):
networkConfigUbuntu(self),
libvirtConfigUbuntu(self),
firewallConfigUbuntu(self),
nfsConfig(self),
cloudAgentConfig(self)]
#it covers RHEL6/Fedora13/Fedora14
@ -144,6 +145,7 @@ class sysConfigRedhat6(sysConfigAgentRedhatBase):
networkConfigRedhat(self),
libvirtConfigRedhat(self),
firewallConfigAgent(self),
nfsConfig(self),
cloudAgentConfig(self)]
#It covers RHEL5/CentOS5, the mainly difference is that there is no cgroup