[PATCH 11/16] Debianize service maintenance script path ("/usr/sbin/service"), start sequence-integration tool ("/usr/sbin/update-rc.d");
Johannes Graumann
johannes_graumann at web.de
Mon Oct 1 19:11:41 CEST 2012
---
pykolab/setup/setup_freebusy.py | 17 +++++++++++++----
1 file changed, 13 insertions(+), 4 deletions(-)
diff --git a/pykolab/setup/setup_freebusy.py b/pykolab/setup/setup_freebusy.py
index 22c74c4..c1492cd 100644
--- a/pykolab/setup/setup_freebusy.py
+++ b/pykolab/setup/setup_freebusy.py
@@ -110,12 +110,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'])
+ elif os.path.isfile('/usr/sbin/service'):
+ subprocess.call(['/usr/sbin/service','apache2','restart'])
+ else:
+ 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 start and configure to start on boot, the " + \
- "webserver service."))
+ log.error(_("Could not configure to start on boot, the " + \
+ "webserver server service."))
--
1.7.10.4
More information about the devel
mailing list