summaryrefslogtreecommitdiffstats
path: root/pykolab
diff options
context:
space:
mode:
authorTimotheus Pokorra <tp@tbits.net>2015-05-05 11:06:17 +0200
committerTimotheus Pokorra <tp@tbits.net>2015-05-05 11:06:17 +0200
commit6359245b344eb81e1014fa5a2f51dd261db6b4e0 (patch)
tree5f9932ec235bd88e313ecb51ba37483e8d3cc043 /pykolab
parent0c7325e65775e63ae79c11205220ab92b1c9342d (diff)
downloadpykolab-6359245b344eb81e1014fa5a2f51dd261db6b4e0.tar.gz
Debian Jessie: fix service names (#4688)
for systemd we need to use different service names for kolabd (kolab-server) and httpd (apache2) for CentOS vs Debian
Diffstat (limited to 'pykolab')
-rw-r--r--pykolab/setup/setup_kolabd.py10
-rw-r--r--pykolab/setup/setup_roundcube.py10
-rw-r--r--pykolab/setup/setup_syncroton.py10
3 files changed, 24 insertions, 6 deletions
diff --git a/pykolab/setup/setup_kolabd.py b/pykolab/setup/setup_kolabd.py
index 7c7982d..315c7a2 100644
--- a/pykolab/setup/setup_kolabd.py
+++ b/pykolab/setup/setup_kolabd.py
@@ -72,7 +72,10 @@ def execute(*args, **kw):
myaugeas.close()
if os.path.isfile('/bin/systemctl'):
- subprocess.call(['/bin/systemctl', 'restart', 'kolabd.service'])
+ if os.patch.isfile('/etc/debian_version'):
+ subprocess.call(['/bin/systemctl', 'restart', 'kolab-server.service'])
+ else:
+ subprocess.call(['/bin/systemctl', 'restart', 'kolabd.service'])
elif os.path.isfile('/sbin/service'):
subprocess.call(['/sbin/service', 'kolabd', 'restart'])
elif os.path.isfile('/usr/sbin/service'):
@@ -81,7 +84,10 @@ def execute(*args, **kw):
log.error(_("Could not start the kolab server service."))
if os.path.isfile('/bin/systemctl'):
- subprocess.call(['/bin/systemctl', 'enable', 'kolabd.service'])
+ if os.patch.isfile('/etc/debian_version'):
+ subprocess.call(['/bin/systemctl', 'enable', 'kolab-server.service'])
+ else:
+ subprocess.call(['/bin/systemctl', 'enable', 'kolabd.service'])
elif os.path.isfile('/sbin/chkconfig'):
subprocess.call(['/sbin/chkconfig', 'kolabd', 'on'])
elif os.path.isfile('/usr/sbin/update-rc.d'):
diff --git a/pykolab/setup/setup_roundcube.py b/pykolab/setup/setup_roundcube.py
index 6558989..5baf3c5 100644
--- a/pykolab/setup/setup_roundcube.py
+++ b/pykolab/setup/setup_roundcube.py
@@ -227,7 +227,10 @@ password='%s'
time.sleep(2)
if os.path.isfile('/bin/systemctl'):
- subprocess.call(['/bin/systemctl', 'restart', 'httpd.service'])
+ if os.patch.isfile('/etc/debian_version'):
+ subprocess.call(['/bin/systemctl', 'restart', 'apache2.service'])
+ else:
+ subprocess.call(['/bin/systemctl', 'restart', 'httpd.service'])
elif os.path.isfile('/sbin/service'):
subprocess.call(['/sbin/service', 'httpd', 'restart'])
elif os.path.isfile('/usr/sbin/service'):
@@ -236,7 +239,10 @@ password='%s'
log.error(_("Could not start the webserver server service."))
if os.path.isfile('/bin/systemctl'):
- subprocess.call(['/bin/systemctl', 'enable', 'httpd.service'])
+ if os.patch.isfile('/etc/debian_version'):
+ subprocess.call(['/bin/systemctl', 'enable', 'apache2.service'])
+ else:
+ subprocess.call(['/bin/systemctl', 'enable', 'httpd.service'])
elif os.path.isfile('/sbin/chkconfig'):
subprocess.call(['/sbin/chkconfig', 'httpd', 'on'])
elif os.path.isfile('/usr/sbin/update-rc.d'):
diff --git a/pykolab/setup/setup_syncroton.py b/pykolab/setup/setup_syncroton.py
index ca99bd5..f98e046 100644
--- a/pykolab/setup/setup_syncroton.py
+++ b/pykolab/setup/setup_syncroton.py
@@ -87,7 +87,10 @@ password='%s'
time.sleep(2)
if os.path.isfile('/bin/systemctl'):
- subprocess.call(['/bin/systemctl', 'restart', 'httpd.service'])
+ if os.patch.isfile('/etc/debian_version'):
+ subprocess.call(['/bin/systemctl', 'restart', 'apache2.service'])
+ else:
+ subprocess.call(['/bin/systemctl', 'restart', 'httpd.service'])
elif os.path.isfile('/sbin/service'):
subprocess.call(['/sbin/service', 'httpd', 'restart'])
elif os.path.isfile('/usr/sbin/service'):
@@ -96,7 +99,10 @@ password='%s'
log.error(_("Could not start the webserver server service."))
if os.path.isfile('/bin/systemctl'):
- subprocess.call(['/bin/systemctl', 'enable', 'httpd.service'])
+ if os.patch.isfile('/etc/debian_version'):
+ subprocess.call(['/bin/systemctl', 'enable', 'apache2.service'])
+ else:
+ subprocess.call(['/bin/systemctl', 'enable', 'httpd.service'])
elif os.path.isfile('/sbin/chkconfig'):
subprocess.call(['/sbin/chkconfig', 'httpd', 'on'])
elif os.path.isfile('/usr/sbin/update-rc.d'):