소스 검색

Ticket #48779 - Remove startpidfile check in start-dirsrv

Description:  Since this fix was made, startpid file is not longer
generated in the systemd start.
  Ticket 47951 - Add PIDFile option to .service
  commit d4deb29a2ed2c738fab41500e6c806f40c4dff17
start-dirsrv script should be updated to adjust to the fix.

https://fedorahosted.org/389/ticket/48779

Reviewed by [email protected] (Thank you, William!!)
Noriko Hosoi 9 년 전
부모
커밋
46dbd62db4
1개의 변경된 파일1개의 추가작업 그리고 27개의 파일을 삭제
  1. 1 27
      ldap/admin/src/scripts/start-dirsrv.in

+ 1 - 27
ldap/admin/src/scripts/start-dirsrv.in

@@ -41,16 +41,6 @@ start_instance() {
     export DS_CONFIG_DIR
     PIDFILE=$RUN_DIR/$PRODUCT_NAME-$SERV_ID.pid
     
-    STARTPIDFILE=$RUN_DIR/$PRODUCT_NAME-$SERV_ID.startpid
-    if test -f $STARTPIDFILE ; then
-        PID=`cat $STARTPIDFILE`
-        if kill -s 0 $PID > /dev/null 2>&1 ; then
-            echo There is an ns-slapd process already running: $PID
-            return 2;
-        else
-            rm -f $STARTPIDFILE
-        fi
-    fi
     if test -f $PIDFILE ; then
         PID=`cat $PIDFILE`
         if kill -s 0 $PID > /dev/null 2>&1 ; then
@@ -70,27 +60,12 @@ start_instance() {
             return 1
         fi
     else
-        $SERVERBIN_DIR/ns-slapd -D $CONFIG_DIR -i $PIDFILE -w $STARTPIDFILE "$@"
+        $SERVERBIN_DIR/ns-slapd -D $CONFIG_DIR -i $PIDFILE "$@"
         if [ $? -ne 0 ]; then
             return 1
         fi
     fi
     loop_counter=1
-    # wait for 10 seconds for the start pid file to appear
-    max_count=${STARTPID_TIME:-10}
-    while test $loop_counter -le $max_count; do
-        loop_counter=`expr $loop_counter + 1`
-        if test ! -f $STARTPIDFILE ; then
-            sleep 1;
-        else
-            PID=`cat $STARTPIDFILE`
-        fi
-    done
-    if test ! -f $STARTPIDFILE ; then
-        echo Server failed to start !!! Please check errors log for problems
-        return 1
-    fi
-    loop_counter=1
     # wait for 10 minutes (600 times 1 seconds)
     max_count=${PID_TIME:-600}
     while test $loop_counter -le $max_count; do
@@ -104,7 +79,6 @@ start_instance() {
         fi
         else
             PID=`cat $PIDFILE`
-            rm -f $STARTPIDFILE
             return 0;
         fi
     done