summaryrefslogtreecommitdiffstats
path: root/pykolab/setup/setup_syncroton.py
diff options
context:
space:
mode:
Diffstat (limited to 'pykolab/setup/setup_syncroton.py')
-rw-r--r--pykolab/setup/setup_syncroton.py14
1 files changed, 6 insertions, 8 deletions
diff --git a/pykolab/setup/setup_syncroton.py b/pykolab/setup/setup_syncroton.py
index 9fdb04c..2f02d98 100644
--- a/pykolab/setup/setup_syncroton.py
+++ b/pykolab/setup/setup_syncroton.py
@@ -86,11 +86,12 @@ password='%s'
time.sleep(2)
+ httpservice = 'httpd.service'
+ if os.path.isfile('/usr/lib/systemd/system/apache2.service'):
+ httpservice = 'apache2.service'
+
if os.path.isfile('/bin/systemctl'):
- if os.path.isfile('/etc/debian_version'):
- subprocess.call(['/bin/systemctl', 'restart', 'apache2.service'])
- else:
- subprocess.call(['/bin/systemctl', 'restart', 'httpd.service'])
+ subprocess.call(['/bin/systemctl', 'restart', httpservice])
elif os.path.isfile('/sbin/service'):
subprocess.call(['/sbin/service', 'httpd', 'restart'])
elif os.path.isfile('/usr/sbin/service'):
@@ -99,10 +100,7 @@ password='%s'
log.error(_("Could not start the webserver server service."))
if os.path.isfile('/bin/systemctl'):
- if os.path.isfile('/etc/debian_version'):
- subprocess.call(['/bin/systemctl', 'enable', 'apache2.service'])
- else:
- subprocess.call(['/bin/systemctl', 'enable', 'httpd.service'])
+ subprocess.call(['/bin/systemctl', 'enable', httpservice])
elif os.path.isfile('/sbin/chkconfig'):
subprocess.call(['/sbin/chkconfig', 'httpd', 'on'])
elif os.path.isfile('/usr/sbin/update-rc.d'):