summaryrefslogtreecommitdiffstats
path: root/pykolab
diff options
context:
space:
mode:
authorJeroen van Meeuwen (Kolab Systems) <vanmeeuwen@kolabsys.com>2012-05-15 16:08:05 +0100
committerJeroen van Meeuwen (Kolab Systems) <vanmeeuwen@kolabsys.com>2012-05-15 16:08:05 +0100
commita71fdfdd17cdbf1e9ef17e074ab27407ed627b5e (patch)
tree10d6879355f560faf866f64f7741b6b73039553a /pykolab
parent479cbbfa20736b44d5bcf75b0ccf150801738d1e (diff)
downloadpykolab-a71fdfdd17cdbf1e9ef17e074ab27407ed627b5e.tar.gz
Make sure all services are started and configured to start on boot (#772)
Diffstat (limited to 'pykolab')
-rw-r--r--pykolab/setup/setup_mta.py18
1 files changed, 17 insertions, 1 deletions
diff --git a/pykolab/setup/setup_mta.py b/pykolab/setup/setup_mta.py
index 93db617..c86e57c 100644
--- a/pykolab/setup/setup_mta.py
+++ b/pykolab/setup/setup_mta.py
@@ -251,5 +251,21 @@ result_attribute = mail
subprocess.call(['/etc/pki/tls/certs/make-dummy-cert', '/etc/pki/tls/private/localhost.pem'])
- subprocess.call(['service', 'postfix', 'restart'])
+ if os.path.isfile('/bin/systemctl'):
+ subprocess.call(['systemctl', 'restart', 'postfix.service'])
+ subprocess.call(['systemctl', 'enable', 'postfix.service'])
+ subprocess.call(['systemctl', 'restart', 'amavisd.service'])
+ subprocess.call(['systemctl', 'enable', 'amavisd.service'])
+ subprocess.call(['systemctl', 'restart', 'clamd.amavisd.service'])
+ subprocess.call(['systemctl', 'enable', 'clamd.amavisd.service'])
+ elif os.path.isfile('/sbin/service'):
+ subprocess.call(['service', 'postfix', 'restart'])
+ subprocess.call(['chkconfig', 'postfix', 'on'])
+ subprocess.call(['service', 'amavisd', 'restart'])
+ subprocess.call(['chkconfig', 'amavisd', 'on'])
+ subprocess.call(['service', 'clamd.amavisd', 'restart'])
+ subprocess.call(['chkconfig', 'clamd.amavisd', 'on'])
+ else:
+ log.error(_("Could not start and configure to start on boot, the " + \
+ "postfix, clamav.amavisd and amavisd services."))