[PATCH 04/16] Debianize service maintenance script path ("/usr/sbin/service"), start sequence-integration tool ("/usr/sbin/update-rc.d") as well as webserver name ("apache2" rather than "httpd");
Johannes Graumann
johannes_graumann at web.de
Mon Oct 1 17:34:37 CEST 2012
---
pykolab/setup/setup_zpush.py | 19 ++++++++++++++-----
1 file changed, 14 insertions(+), 5 deletions(-)
diff --git a/pykolab/setup/setup_zpush.py b/pykolab/setup/setup_zpush.py
index 3aa7a0b..c236f7b 100644
--- a/pykolab/setup/setup_zpush.py
+++ b/pykolab/setup/setup_zpush.py
@@ -89,12 +89,21 @@ def execute(*args, **kw):
time.sleep(2)
if os.path.isfile('/bin/systemctl'):
- subprocess.call(['/bin/systemctl', 'restart', 'httpd.service'])
- subprocess.call(['/bin/systemctl', 'enable', 'httpd.service'])
+ subprocess.call(['/bin/systemctl', 'restart', 'httpd.target'])
elif os.path.isfile('/sbin/service'):
subprocess.call(['/sbin/service', 'httpd', 'restart'])
- subprocess.call(['/sbin/chkconfig', 'httpd', 'on'])
+ elif os.path.isfile('/usr/sbin/service'):
+ subprocess.call(['/usr/sbin/service','apache2','restart'])
else:
- log.error(_("Could not start and configure to start on boot, the " + \
- "webserver service."))
+ log.error(_("Could not start the webserver server service."))
+ if os.path.isfile('/bin/systemctl'):
+ subprocess.call(['/bin/systemctl', 'enable', 'httpd.target'])
+ elif os.path.isfile('/sbin/chkconfig'):
+ subprocess.call(['/sbin/chkconfig', 'httpd', 'on'])
+ elif os.path.isfile('/usr/sbin/update-rc.d'):
+ subprocess.call(['/usr/sbin/update-rc.d', 'apache2', 'defaults'])
+ else:
+ log.error(_("Could not configure to start on boot, the " + \
+ "webserver server service."))
+
--
1.7.10.4
More information about the devel
mailing list