Changeset View
Changeset View
Standalone View
Standalone View
pykolab/setup/setup_mta.py
Show First 20 Lines • Show All 436 Lines • ▼ Show 20 Lines | """ % { | ||||
if os.path.isfile('/etc/default/wallace'): | if os.path.isfile('/etc/default/wallace'): | ||||
myaugeas = Augeas() | myaugeas = Augeas() | ||||
setting = os.path.join('/files/etc/default/wallace','START') | setting = os.path.join('/files/etc/default/wallace','START') | ||||
if not myaugeas.get(setting) == 'yes': | if not myaugeas.get(setting) == 'yes': | ||||
myaugeas.set(setting,'yes') | myaugeas.set(setting,'yes') | ||||
myaugeas.save() | myaugeas.save() | ||||
myaugeas.close() | myaugeas.close() | ||||
if os.path.isfile('/usr/lib/systemd/system/clamd@.service'): | |||||
from ConfigParser import SafeConfigParser | |||||
unitfile = SafeConfigParser() | |||||
unitfile.optionxform = str | |||||
unitfile.read('/usr/lib/systemd/system/clamd@.service') | |||||
if not unitfile.has_section('Install'): | |||||
unitfile.add_section('Install') | |||||
if not unitfile.has_option('Install', 'WantedBy'): | |||||
unitfile.set('Install', 'WantedBy', 'multi-user.target') | |||||
with open('/etc/systemd/system/clamd@.service', 'wb') as f: | |||||
unitfile.write(f) | |||||
amavisservice = 'amavisd.service' | amavisservice = 'amavisd.service' | ||||
clamavservice = 'clamd@amavisd.service' | clamavservice = 'clamd@amavisd.service' | ||||
if os.path.isfile('/usr/lib/systemd/system/amavis.service'): | if os.path.isfile('/usr/lib/systemd/system/amavis.service'): | ||||
amavisservice = 'amavis.service' | amavisservice = 'amavis.service' | ||||
if os.path.isfile('/usr/lib/systemd/system/clamd.service'): | if os.path.isfile('/usr/lib/systemd/system/clamd.service'): | ||||
clamavservice = 'clamd.service' | clamavservice = 'clamd.service' | ||||
if os.path.isfile('/bin/systemctl'): | if os.path.isfile('/bin/systemctl'): | ||||
Show All 35 Lines |