summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorJeroen van Meeuwen (Kolab Systems) <vanmeeuwen@kolabsys.com>2016-02-23 14:25:41 +0100
committerJeroen van Meeuwen (Kolab Systems) <vanmeeuwen@kolabsys.com>2016-02-23 14:25:41 +0100
commit2fa49141f45b7fefce8af52609426945ee760f49 (patch)
tree31d7b3cf7bdf2ddf8b680ba9836b40525e02d201
parent51269b4dc29315a387102e41515eeb7899838a67 (diff)
downloadpykolab-2fa49141f45b7fefce8af52609426945ee760f49.tar.gz
Fix the systemd unit file for clamd@.service if needed
Summary: Resolves T997 Test Plan: # Install a Kolab server on CentOS 7 # Set up Kolab # Expect a running instance of the clamd@amavisd service Reviewers: #pykolab_developers, vanmeeuwen Reviewed By: #pykolab_developers, vanmeeuwen Maniphest Tasks: T997 Differential Revision: https://git.kolab.org/D86
-rw-r--r--pykolab/setup/setup_mta.py14
1 files changed, 14 insertions, 0 deletions
diff --git a/pykolab/setup/setup_mta.py b/pykolab/setup/setup_mta.py
index f2883a7..d7f070c 100644
--- a/pykolab/setup/setup_mta.py
+++ b/pykolab/setup/setup_mta.py
@@ -442,6 +442,20 @@ result_format = "shared+%%s"
myaugeas.save()
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'
clamavservice = 'clamd@amavisd.service'
if os.path.isfile('/usr/lib/systemd/system/amavis.service'):