|
|
@@ -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
|