From 3b8540198be800527f8fc4d4de49364c99bea4c1 Mon Sep 17 00:00:00 2001 From: fuchsi Date: Tue, 9 Oct 2007 14:53:16 +0000 Subject: [PATCH] finally fix the init script. tested this time. git-svn-id: https://svn.berlios.de/svnroot/repos/yacy/trunk@4153 6c8d7289-2bf4-0310-a012-ef5d649a1542 --- addon/yacyInit.sh | 27 +++++++++++++-------------- 1 file changed, 13 insertions(+), 14 deletions(-) diff --git a/addon/yacyInit.sh b/addon/yacyInit.sh index b5a7999c4..7364cfda9 100755 --- a/addon/yacyInit.sh +++ b/addon/yacyInit.sh @@ -15,8 +15,11 @@ USER=yacy # databases. SHUTDOWN_TIMEOUT=20 +# Don't run if not installed +test -f $DAEMON_DIR/startYACY.sh || exit 0 # generating the proper classpath +cd $DAEMON_DIR CLASSPATH="" for N in lib/*.jar; do CLASSPATH="$CLASSPATH$N:"; done for N in libx/*.jar; do CLASSPATH="$CLASSPATH$N:"; done @@ -25,9 +28,6 @@ NAME="yacy" DESC="YaCy HTTP Proxy" PID_FILE=/var/run/$NAME.pid -# Don't run if not installed -test -f $DAEMON || exit 0 - JAVA=$(which java) if [ -f $PID_FILE ]; then @@ -44,7 +44,7 @@ case "$1" in echo -n "Starting $DESC: " start-stop-daemon --start --background --make-pidfile --chuid $USER\ --pidfile $PID_FILE --chdir $DAEMON_DIR --startas $JAVA\ - -- -classpath $CLASSPATH yacy $DAEMON_DIR + -- -classpath $CLASSPATH yacy $DAEMON_DIR > yacy.log echo "$NAME." ;; @@ -54,16 +54,15 @@ case "$1" in cd $DAEMON_DIR ./stopYACY.sh timeout=$SHUTDOWN_TIMEOUT - while [ -n "$pidno" ] - do - let timeout=$timeout-1 - if [ $timeout -eq 0 ]; then - start-stop-daemon --stop --pidfile $PID_FILE --oknodo - break - fi - echo -n "." - sleep 1 - pidno=$( ps ax | grep $pid | awk '{ print $1 }' | grep $pid ) + while [ -n "$pidno" ]; do + let timeout=$timeout-1 + if [ $timeout -eq 0 ]; then + start-stop-daemon --stop --pidfile $PID_FILE --oknodo --verbose + break + fi + echo -n "." + sleep 1 + pidno=$( ps ax | grep $pid | awk '{ print $1 }' | grep $pid ) done echo "$NAME." cd -