-
-
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.
Added a stop command using the existing stop script to the snap package
- Loading branch information
Showing
5 changed files
with
46 additions
and
13 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 | Original file line | Diff line number | Diff line change |
---|---|---|---|
@@ -0,0 +1,12 @@ | |||
#!/usr/bin/env sh | |||
# Check the snap configuration to properly fill the YACY_DATA_PATH environment variable | |||
|
|||
DATA_VERSIONED="$(snapctl get data.versioned)" | |||
if [ "$DATA_VERSIONED" = "false" ]; then | |||
# YaCy data is in the Snap common (non versioned) user data | |||
YACY_DATA_PATH="$SNAP_USER_COMMON/DATA" | |||
else | |||
# Defaults : YaCy data is in the Snap versioned user data | |||
YACY_DATA_PATH="$SNAP_USER_DATA/DATA" | |||
fi | |||
export YACY_DATA_PATH |
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
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 | Original file line | Diff line number | Diff line change |
---|---|---|---|
@@ -0,0 +1,9 @@ | |||
#!/usr/bin/env sh | |||
|
|||
# Wrapper script for Snap package specific instructions before calling the stopYACY.sh script | |||
|
|||
cd "`dirname $0`" | |||
|
|||
. ./exportYacyDataPath.sh | |||
|
|||
sh "$SNAP/yacy/stopYACY.sh" |
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
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 | Original file line | Diff line number | Diff line change |
---|---|---|---|
@@ -1,15 +1,29 @@ | |||
#!/usr/bin/env sh | #!/usr/bin/env sh | ||
# Shutdown a running YaCy server through API call | |||
# | |||
# $YACY_DATA_PATH : path to the YaCy DATA folder to use. When not set, the relative ./DATA path is used as a default. | |||
|
|||
cd `dirname $0` | cd `dirname $0` | ||
|
|
||
(bin/protectedPostApiCall.sh "Steering.html" "shutdown=true" > /dev/null && \ | if [ -z "$YACY_DATA_PATH" ]; then | ||
YACY_DATA_PATH="DATA" | |||
fi | |||
|
|||
if [ ! -d "$YACY_DATA_PATH" ]; then | |||
echo "Invalid YaCy DATA folder path : $YACY_DATA_PATH" | |||
echo "Please fill the YACY_DATA_PATH environment variable with a valid YaCy DATA folder path." | |||
exit 2 | |||
fi | |||
|
|
||
(bin/protectedPostApiCall.sh "Steering.html" "shutdown=true" && \ | |||
echo "Please wait until the YaCy daemon process terminates [wget]" && \ | echo "Please wait until the YaCy daemon process terminates [wget]" && \ | ||
echo "You can monitor this with 'tail -f DATA/LOG/yacy00.log' and 'fuser DATA/LOG/yacy00.log'") || \ | echo "You can monitor this with 'tail -f $YACY_DATA_PATH/LOG/yacy00.log' and 'fuser $YACY_DATA_PATH/LOG/yacy00.log'") || \ | ||
exit $? | exit $? | ||
|
|
||
# wait until the yacy.running file disappears which means that YaCy has terminated | # wait until the yacy.running file disappears which means that YaCy has terminated | ||
# If you don't want to wait, just run this concurrently | # If you don't want to wait, just run this concurrently | ||
while [ -f "DATA/yacy.running" ] | while [ -f "$YACY_DATA_PATH/yacy.running" ] | ||
do | do | ||
echo "WAITING" | |||
sleep 1 | sleep 1 | ||
done | done |