Blob Blame History Raw
diff -ur bdii-5.1.5.orig/etc/init.d/bdii bdii-5.1.5/etc/init.d/bdii
--- bdii-5.1.5.orig/etc/init.d/bdii	2010-05-23 15:53:06.176116947 +0200
+++ bdii-5.1.5/etc/init.d/bdii	2010-05-23 19:01:17.577368324 +0200
@@ -18,12 +18,24 @@
 
 shopt -s expand_aliases
 
-if [ -f /lib/lsb/init-functions ]; then
-    . /lib/lsb/init-functions
+if [ -f /etc/init.d/functions ]; then
+    . /etc/init.d/functions
 else
-    echo "Error: Cannot source /lib/lsb/init-functions"
+    echo "Error: Cannot source /etc/init.d/functions"
 fi
 
+log_success_msg ()
+{
+  success
+  echo
+}
+
+log_failure_msg()
+{
+  failure
+  echo
+}
+
 prog=bdii
 lockfile=/var/lock/subsys/$prog
 
@@ -95,7 +107,7 @@
     sudo -u ${BDII_USER} cp ${DB_CONFIG} ${SLAPD_DB_DIR}/stats/
     sudo -u ${BDII_USER} cp ${DB_CONFIG} ${SLAPD_DB_DIR}/glue2/
 
-    echo -n "Starting SLAPD: "
+    echo -n "Starting BDII slapd: "
     COMMAND="${SLAPD} -f ${SLAPD_CONF} -h ldap://$(hostname -f):${SLAPD_PORT} -u ${BDII_USER}"
     ${COMMAND}
     touch ${SLAPD_LOCK_FILE}
@@ -111,7 +123,7 @@
     fi
 
     if [ ${RETVAL} -gt 0 ]; then
-        echo -n "SLAPD failed to start" 1>&2
+        echo -n "BDII slapd failed to start" 1>&2
 
         rm -f ${SLAPD_LOCK_FILE}
         eval log_failure_msg
@@ -139,9 +151,9 @@
         RETVAL=1
     fi
 
-    echo -n "Starting update process: "
+    echo -n "Starting BDII update process: "
     if [ ${RETVAL} -gt 0 ]; then
-        echo -n "Update process failed to start" 1>&2
+        echo -n "BDII update process failed to start" 1>&2
         rm -f ${UPDATE_LOCK_FILE}
         eval log_failure_msg
         return 1
@@ -158,18 +170,18 @@
     if [ ! -f "${SLAPD_LOCK_FILE}" ] &&  [ ! -f "${UPDATE_LOCK_FILE}" ]; then
         echo -n "Stopping BDII: "
         result=$($0 status)
-        if [ $? -gt 0 ]; then
+        if [ $? -gt 0 -a $? -ne 3 ]; then
             echo ${result} 1>&2
             return 1
         else
-            echo "BDII Already stopped"
+            echo "BDII already stopped"
             return 0
         fi
     fi
 
     RETVAL=0
 
-    echo -n "Stopping update process: "
+    echo -n "Stopping BDII update process: "
 
     if [ -f "${UPDATE_PID_FILE}" ]; then
         UPDATE_PID=$(cat ${UPDATE_PID_FILE})
@@ -186,7 +198,7 @@
                 sleep 2
                 ps ${UPDATE_PID} >/dev/null 2>&1
                 if [ $? = 0 ]; then
-                    echo -n "Could not kill update process ${UPDATE_PID}" 1>&2
+                    echo -n "Could not kill BDII update process ${UPDATE_PID}" 1>&2
                     RETVAL=1
                 fi
             fi
@@ -201,7 +213,7 @@
         eval log_failure_msg
     fi
 
-    echo -n "Stopping SLAPD: "
+    echo -n "Stopping BDII slapd: "
 
     if [ -f "${SLAPD_PID_FILE}" ]; then
         SLAPD_PID=$(cat ${SLAPD_PID_FILE})
@@ -218,7 +230,7 @@
                 sleep 2
                 ps ${SLAPD_PID} >/dev/null 2>&1
                 if [ $? = 0 ]; then
-                    echo -n "Could not kill slapd process ${SLAPD_PID}" 1>&2
+                    echo -n "Could not kill BDII slapd process ${SLAPD_PID}" 1>&2
                     RETVAL=2
                 else
                     rm -f {SLAPD_PID_FILE}
@@ -253,12 +265,12 @@
     if [ -f ${SLAPD_PID_FILE} ]; then
         ps $(cat ${SLAPD_PID_FILE}) >/dev/null 2>&1
         if [ ! $? = 0 ]; then
-            echo -n "SLAPD PID file exists but the process died" 1>&2
+            echo -n "BDII slapd PID file exists but the process died" 1>&2
             eval log_failure_msg
             return 1
         fi
     else
-        echo -n "SLAPD PID file ${SLAPD_PID_FILE} does not exist" 1>&2
+        echo -n "BDII slapd PID file ${SLAPD_PID_FILE} does not exist" 1>&2
         eval log_failure_msg
         return 1
     fi
@@ -266,12 +278,12 @@
     if [ -f ${UPDATE_PID_FILE} ]; then
         ps $(cat ${UPDATE_PID_FILE}) >/dev/null 2>&1
         if [ ! $? = 0 ]; then
-            echo -n "Update process died" 1>&2
+            echo -n "BDII update process died" 1>&2
             eval log_failure_msg
             return 1
         fi
     else
-        echo -n "Update process failed to start" 1>&2
+        echo -n "BDII update process failed to start" 1>&2
         eval log_failure_msg
         return 1
     fi