def useDefaultConf(self): """ commit & apply default conf """ self.debug("take in account default configuration") ConfigServiceComponent.save_config(self, 'hosts : default configuration') # commit self.core.config_manager.signalAutoconf() # apply
def checkServiceCall(self, context, service_name): if 'saveConfiguration' == service_name \ and context.isComponentContext() \ and 'ha' == context.component.name: # config component doesn't need a lock here return ConfigServiceComponent.checkServiceCall(self, context, service_name)
def init(self, core): ConfigServiceComponent.init(self, core) self.addConfFile("/etc/snort_inline/edenwall-home-net.conf", "root:root", "0644") try: self.handle_transition() except Exception, err: self.critical( "Could not handle configuration transition to new IDS-IPS backend (%s)." % exceptionAsUnicode(err))
def init(self, core): ConfigServiceComponent.init(self, core) self.core = core try: self.sharedir = self.core.config.get('CORE', 'sharedir') except: self.sharedir = DEFAULT_SHAREDIR self.script_dir = os.path.join(self.sharedir, 'scripts') self.addConfFile(_ULOGD_CONF, 'root:root', '0644') self.addConfFile(_RSYSLOG_CONF, 'root:root', '0644')
def init(self, core): ConfigServiceComponent.init(self, core) self.core = core depend_key = ("contact", "admin_mail") depend_name = "contact_snmpd" for (event, method) in ( ("modify", self.read_config), ("apply", self.apply_config), ("rollback", self.apply_config), ): self.core.config_manager.subscribe(method, depend_name, (), event, *depend_key) self.addConfFile("/etc/default/snmpd", "root:root", "0644") self.addConfFile("/etc/snmp/snmpd.conf", "root:root", "0644") self.snmp_users_filename = "/var/lib/snmp/snmpd.conf"
def init(self, core): ConfigServiceComponent.init(self, core) UseCertificateComponent.init(self, core) self.core = core try: self.sharedir = self.core.config.get('CORE', 'sharedir') except: self.sharedir = DEFAULT_SHAREDIR self.script_dir = os.path.join(self.sharedir, 'scripts') self.addConfFile(_NUAUTH_CONF, 'root:root', '0644') self.addConfFile('/etc/nufw/nuauth.d/nuauth_tls.conf', 'root:root', '0644') self.addConfFile('/etc/nufw/user-down.sh', 'root:root', '0755') self.addConfFile('/etc/nufw/user-up.sh', 'root:root', '0755')
def service_start(self, context): if self.CONFIG['virus_scan']: self.core.callServiceSync(context, "Clamav", "decrementUsageCount") self.old_clamav_config = self.CONFIG['virus_scan'] return ConfigServiceComponent.service_start(self, context)
def init(self, core): ConfigServiceComponent.init(self, core) depend_key = ('nuauth_bind', 'nuauth_bind_dependency') depend_name = 'nuauth_bind' for (event, method) in ( ('modify', self.read_config), ('apply', self.apply_config), ('rollback', self.apply_config) ): self.core.config_manager.subscribe(method, depend_name, (), event, *depend_key) self.addConfFile('/etc/bind/named.conf', 'root:bind', '0644') self.addConfFile('/etc/bind/named.conf.local', 'root:bind', '0644') self.addConfFile('/etc/bind/named.conf.options', 'root:bind', '0644')
def __init__(self): ConfigServiceComponent.__init__(self) self.addConfFile(HOSTS_FILE, 'root:root', '0644') self.key_exists = False
def init(self, core): UseCertificateComponent.init(self, core) self.context = Context.fromComponent(self) for filename in self.CONF_FILES: self.addConfFile(filename, 'root:root', '0644') ConfigServiceComponent.init(self, core)
def __init__(self): ConfigServiceComponent.__init__(self) self.addConfFile('/etc/resolv.conf', 'root:root', '0644') self.key_exists = False self.resolvcfg = ResolvCfgAutoconf()
def init(self, core): ConfigServiceComponent.init(self, core) for genfile in GEN_FILES: self.addConfFile(genfile, 'root:root', '0644')
def __init__(self): ConfigServiceComponent.__init__(self) self.snmp_users_filename = None
def init(self, core): ConfigServiceComponent.init(self, core) self.addConfFile('/etc/hostname', 'root:root', '0644')
def __init__(self): ConfigServiceComponent.__init__(self) UseCertificateComponent.__init__(self) self.openvpn_cfg = self.context = self.core = None
def __init__(self): ConfigServiceComponent.__init__(self)
def __init__(self): ConfigServiceComponent.__init__(self) UseCertificateComponent.__init__(self)
def service_restart(self, context): self.manage_clamav(context) return ConfigServiceComponent.service_restart(self, context)
def init(self, core): ConfigServiceComponent.init(self, core) if not self.key_exists: self.useDefaultConf()
def service_stop(self, context): self.core.callServiceSync(context, "Clamav", "decrementUsageCount") return ConfigServiceComponent.service_stop(self, context)
def __init__(self): ConfigServiceComponent.__init__(self) self.ids_ips_cfg = None
def __init__(self): ConfigServiceComponent.__init__(self) self.addConfFile('/etc/clamav/clamd.conf', 'root:root', '0644') # by default antivirus is disabled self.used_by = {} # component name : used/unused (bool)
def __init__(self): ConfigServiceComponent.__init__(self) self.addConfFile("/etc/spamassassin/local.cf", "root:root", "0644") self.addConfFile("/etc/default/spamassassin", "root:root", "0644") self.config = None
def __init__(self): ConfigServiceComponent.__init__(self) self.empty_conf = False self.name_fmt = getHostnameFormatHA(ENOHA) # default fmt
def __init__(self): ConfigServiceComponent.__init__(self) self.cfg = None self.FINGERPRINT_CREATED = None self.FINGERPRINT = None
def init(self, core): ConfigServiceComponent.init(self, core) self.addConfFile('/etc/dhcp3/dhcpd.conf', 'root:root', '0644') self.addConfFile('/etc/ha.d/resource.d/omshell_dhcpd', 'root:root', '0755')
def __init__(self): ConfigServiceComponent.__init__(self) self.addConfFile('/etc/ntp.conf', 'root:root', '0644')
def __init__(self): self.config = None ConfigServiceComponent.__init__(self)
def init(self, core): ConfigServiceComponent.init(self, core)
def __init__(self): self.dhcpcfg = None ConfigServiceComponent.__init__(self)