-
-
Notifications
You must be signed in to change notification settings - Fork 428
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
*) ./stopYACY:sh -f kills YaCy in case regular shutdown does not work
git-svn-id: https://svn.berlios.de/svnroot/repos/yacy/trunk@7667 6c8d7289-2bf4-0310-a012-ef5d649a1542
- Loading branch information
low012
committed
Apr 18, 2011
1 parent
3d5104d
commit 7c149e0
Showing
1 changed file
with
48 additions
and
23 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,34 +1,59 @@ | ||
#!/bin/sh | ||
cd `dirname $0` | ||
|
||
if [ -x `which wget` ] | ||
# KILL YACY IF SCRIPT HAS BEEN STARTED WITH PARAMETER -f | ||
if [ $# -eq 1 ] | ||
then | ||
bin/apicall.sh "Steering.html?shutdown=true" | ||
if [ $1 = "-f" ] | ||
then | ||
if [ -e "yacy.pid" ] | ||
then | ||
PID=`cat yacy.pid` | ||
kill -9 "$PID" 2> /dev/null | ||
if [ $? -ne 0 ] | ||
then | ||
echo "Unable to force closed YaCy, daemon seems to have terminated already." | ||
else | ||
echo "Force closed YaCy (process ID was $PID)." | ||
fi | ||
else | ||
echo "Unable to determine YaCy process ID, aborting operation." | ||
fi | ||
fi | ||
|
||
# ELSE TRY TO STOP YACY GRACEFULLY | ||
else | ||
|
||
echo "Please wait until the YaCy daemon process terminates [wget]" | ||
echo "You can monitor this with 'tail -f DATA/LOG/yacy00.log' and 'fuser log/yacy00.log'" | ||
if [ -x `which wget` ] | ||
then | ||
bin/apicall.sh "Steering.html?shutdown=true" | ||
|
||
elif [ -x `which curl` ] | ||
then | ||
bin/apicall.sh "Steering.html?shutdown=true" | ||
echo "Please wait until the YaCy daemon process terminates [wget]" | ||
echo "You can monitor this with 'tail -f DATA/LOG/yacy00.log' and 'fuser log/yacy00.log'" | ||
|
||
echo "Please wait until the YaCy daemon process terminates [curl]" | ||
echo "You can monitor this with 'tail -f DATA/LOG/yacy00.log' and 'fuser log/yacy00.log'" | ||
elif [ -x `which curl` ] | ||
then | ||
bin/apicall.sh "Steering.html?shutdown=true" | ||
|
||
elif [ -x `which java` ] | ||
then | ||
# generating the proper classpath | ||
CLASSPATH="" | ||
for N in lib/*.jar; do CLASSPATH="$CLASSPATH$N:"; done | ||
for N in libx/*.jar; do CLASSPATH="$CLASSPATH$N:"; done | ||
echo "Please wait until the YaCy daemon process terminates [curl]" | ||
echo "You can monitor this with 'tail -f DATA/LOG/yacy00.log' and 'fuser log/yacy00.log'" | ||
|
||
java -classpath classes:htroot:$CLASSPATH net.yacy.yacy -shutdown | ||
elif [ -x `which java` ] | ||
then | ||
# generating the proper classpath | ||
CLASSPATH="" | ||
for N in lib/*.jar; do CLASSPATH="$CLASSPATH$N:"; done | ||
for N in libx/*.jar; do CLASSPATH="$CLASSPATH$N:"; done | ||
|
||
echo "Please wait until the YaCy daemon process terminates [java]" | ||
echo "You can monitor this with 'tail -f DATA/LOG/yacy00.log' and 'fuser log/yacy00.log'" | ||
java -classpath classes:htroot:$CLASSPATH net.yacy.yacy -shutdown | ||
|
||
else | ||
port=`cat DATA/SETTINGS/yacy.conf |grep "^port="|sed "s/.*=//"` | ||
echo "Neither wget nor java could be found or are not executable." | ||
echo "Visit http://localhost:$port/Steering.html?shutdown=true to stop YaCy or (in emergency case) use ./killYACY.sh" | ||
fi | ||
echo "Please wait until the YaCy daemon process terminates [java]" | ||
echo "You can monitor this with 'tail -f DATA/LOG/yacy00.log' and 'fuser log/yacy00.log'" | ||
|
||
else | ||
port=`cat DATA/SETTINGS/yacy.conf |grep "^port="|sed "s/.*=//"` | ||
echo "Neither wget nor java could be found or are not executable." | ||
echo "Visit http://localhost:$port/Steering.html?shutdown=true to stop YaCy or (in emergency case) use ./killYACY.sh" | ||
fi | ||
|
||
fi |