robustify start/stop of some services
authorJason Etheridge <jason@equinoxinitiative.org>
Thu, 3 Jan 2019 20:26:33 +0000 (15:26 -0500)
committerJason Etheridge <jason@equinoxinitiative.org>
Thu, 3 Jan 2019 20:26:33 +0000 (15:26 -0500)
installer/stretch/eg_stretch_installer.sh

index 89e5af7..16daf8d 100755 (executable)
@@ -402,7 +402,11 @@ function adjust_dynamic_library_path {
 function configure_ejabberd {
     echo _.-~= configuring ejabberd
     echo stopping ejabberd
-    systemctl stop ejabberd.service
+    if [ -e /etc/init.d/ejabberd ]; then
+        /etc/init.d/ejabberd stop
+    else
+        systemctl stop ejabberd.service
+    fi
     if [ ! "$(grep 'public.localhost' /etc/ejabberd/ejabberd.yml)" ]; then
         cd /etc/ejabberd/
         cp ejabberd.yml /root/ejabberd.yml
@@ -411,7 +415,11 @@ function configure_ejabberd {
     fi;
     echo starting ejabberd after patching
     date
-    systemctl start ejabberd.service
+    if [ -e /etc/init.d/ejabberd ]; then
+        /etc/init.d/ejabberd start
+    else
+        systemctl start ejabberd.service
+    fi
     echo Return Value = $?
     sleep 10;
     echo End of configuring ejabberd =~-._
@@ -516,8 +524,11 @@ function configure_websockets {
     echo Return Value = $?
 
     echo After OpenSRF is up and running, fire up the secondary Apache instance. 
-    #/etc/init.d/apache2-websockets start
-    systemctl start apache2@websockets.service
+    if [-e /etc/init.d/apache2-websockets ]; then
+        /etc/init.d/apache2-websockets start
+    else
+        systemctl start apache2@websockets.service
+    fi
     echo Return Value = $?
 
     echo End of configuring websockets =~-._