Bläddra i källkod

try to improve rc handling with regard to slapd/slurpd independence; start and stop both independent of the others state; status show active when either is running; in all those cases, handle slurpd only if configured

Thomas Lotterer 21 år sedan
förälder
incheckning
ad9ed60129
2 ändrade filer med 18 tillägg och 8 borttagningar
  1. 1 1
      openldap/openldap.spec
  2. 17 7
      openldap/rc.openldap

+ 1 - 1
openldap/openldap.spec

@@ -34,7 +34,7 @@ Class:        BASE
 Group:        Database
 License:      GPL
 Version:      2.2.11
-Release:      20040423
+Release:      20040424
 
 #   package options
 %option       with_fsl   yes

+ 17 - 7
openldap/rc.openldap

@@ -23,26 +23,36 @@
     openldap_slurpd_signal () {
         [ -f $openldap_slurpd_pidfile ] && kill -$1 `cat $openldap_slurpd_pidfile`
     }
+    openldap_slurpd_needed () {
+        [ ".`grep '^replogfile' $openldap_slapd_cfgfile`" != . ] && return 0
+        return 1
+    }
 
 %status -u @l_susr@ -o
     openldap_usable="unknown"
     openldap_active="no"
     rcService openldap enable yes && \
         openldap_slapd_signal 0 && openldap_active="yes"
+    rcService openldap enable yes && openldap_slurpd_needed && \
+        openldap_slurpd_signal 0 && openldap_active="yes"
     echo "openldap_enable=\"$openldap_enable\""
     echo "openldap_usable=\"$openldap_usable\""
     echo "openldap_active=\"$openldap_active\""
 
 %start -p 300 -u @l_susr@
     rcService openldap enable yes || exit 0
-    rcService openldap active yes && exit 0
-    flags="$openldap_flags"
-    echo $flags | grep -- -h >/dev/null
-    if [ $? -ne 0 -a ".$openldap_url" != . ]; then
-        flags="$flags -h \"$openldap_url\""
+    openldap_slapd_signal 0
+    if [ $? -ne 0 ]; then
+        flags="$openldap_flags"
+        echo $flags | grep -- -h >/dev/null
+        if [ $? -ne 0 -a ".$openldap_url" != . ]; then
+            flags="$flags -h \"$openldap_url\""
+        fi
+        eval @l_prefix@/libexec/openldap/slapd $flags
     fi
-    eval @l_prefix@/libexec/openldap/slapd $flags
-    if [ ".`grep '^replogfile' $openldap_slapd_cfgfile`" != . ]; then
+    openldap_slurpd_needed || exit 0
+    openldap_slurpd_signal 0
+    if [ $? -ne 0 ]; then
         @l_prefix@/libexec/openldap/slurpd
     fi