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:58 +0100
commiteea5b0dfad7c1d3109f6def64dc676de70a71d98 (patch)
tree17a7c2038660f36f46e41d99a4ecfb0eb463f984 /pykolab
parente6394be1054d08a095ccc72ad560ce842fa06f48 (diff)
downloadpykolab-eea5b0dfad7c1d3109f6def64dc676de70a71d98.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."))