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
pull/1/head
fuchsi 18 years ago
parent 508de558f7
commit 3b8540198b

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

Loading…
Cancel
Save