[PATCH 06/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:38:52 CEST 2012


---
 pykolab/setup/setup_roundcube.py |   17 +++++++++++++----
 1 file changed, 13 insertions(+), 4 deletions(-)

diff --git a/pykolab/setup/setup_roundcube.py b/pykolab/setup/setup_roundcube.py
index 0f45711..6b2c464 100644
--- a/pykolab/setup/setup_roundcube.py
+++ b/pykolab/setup/setup_roundcube.py
@@ -181,12 +181,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