[PATCH 09/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:03:40 CEST 2012
---
pykolab/setup/setup_kolabd.py | 20 ++++++++++++++++----
1 file changed, 16 insertions(+), 4 deletions(-)
diff --git a/pykolab/setup/setup_kolabd.py b/pykolab/setup/setup_kolabd.py
index 9e35a85..559dba2 100644
--- a/pykolab/setup/setup_kolabd.py
+++ b/pykolab/setup/setup_kolabd.py
@@ -63,8 +63,20 @@ def execute(*args, **kw):
fp.close()
if os.path.isfile('/bin/systemctl'):
- subprocess.call(['systemctl', 'restart', 'kolabd.service'])
- subprocess.call(['systemctl', 'enable', 'kolabd.service'])
+ subprocess.call(['/bin/systemctl', 'restart', 'kolabd.service'])
elif os.path.isfile('/sbin/service'):
- subprocess.call(['service', 'kolabd', 'restart'])
- subprocess.call(['chkconfig', 'kolabd', 'on'])
+ subprocess.call(['/sbin/service', 'kolabd', 'restart'])
+ elif os.path.isfile('/usr/sbin/service'):
+ subprocess.call(['/usr/sbin/service','kolabd','restart'])
+ else:
+ log.error(_("Could not start the kolab server service."))
+
+ if os.path.isfile('/bin/systemctl'):
+ 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'):
+ subprocess.call(['/usr/sbin/update-rc.d', 'kolabd', 'defaults'])
+ else:
+ log.error(_("Could not configure to start on boot, the " + \
+ "kolab server service."))
--
1.7.10.4
More information about the devel
mailing list