Skip to content

Distributed Peer-to-Peer Web Search Engine and Intranet Search Appliance

Fixed docker stop behavior.

luccioman1eafa7bfaf6b
diff --git a/docker/Dockerfile b/docker/Dockerfile
index 401d1f1d0..95f6d509c 100644
--- a/docker/Dockerfile
+++ b/docker/Dockerfile
@@ -53,4 +53,4 @@ VOLUME ["/opt/yacy_search_server/DATA"]
USER yacy
# Start yacy in debug mode (-d) to display console logs and to wait for yacy process
-CMD sh /opt/yacy_search_server/startYACY.sh -d
+CMD ["/bin/sh","/opt/yacy_search_server/startYACY.sh","-d"]
diff --git a/docker/Dockerfile.alpine b/docker/Dockerfile.alpine
index 77134f222..245da0a5c 100755
--- a/docker/Dockerfile.alpine
+++ b/docker/Dockerfile.alpine
@@ -85,4 +85,4 @@ VOLUME ["/opt/yacy_search_server/DATA"]
USER yacy
# Start yacy in debug mode (-d) to display console logs and to wait for yacy process
-CMD sh /opt/yacy_search_server/startYACY.sh -d
+CMD ["/bin/sh","/opt/yacy_search_server/startYACY.sh","-d"]
diff --git a/docker/Readme.md b/docker/Readme.md
index 9c9d7c07e..64787b4b3 100755
--- a/docker/Readme.md
+++ b/docker/Readme.md
@@ -140,6 +140,10 @@ And configure the pkcs12XXX properties accordingly :
docker exec [your_container_name] /opt/yacy_search_server/stopYACY.sh
+* OR run :
+
+ docker stop [your_container_name]
+
### Upgrade
You can upgrade your YaCy container the Docker way with the following commands sequence.
diff --git a/startYACY.sh b/startYACY.sh
index f935ae2e3..eea089f01 100755
--- a/startYACY.sh
+++ b/startYACY.sh
@@ -224,10 +224,16 @@ else
echo "** STOP YaCy: execute stopYACY.sh and wait some seconds **"
echo "** GET HELP for YaCy: see http://wiki.yacy.net and http://forum.yacy.de **"
echo "*******************************************************************************"
- echo " >> YaCy started as daemon process. Administration at http://localhost:$PORT << "
- eval $cmdline
- if [ "$TAILLOG" -eq "1" -a ! "$DEBUG" -eq "1" ];then
- sleep 1
- tail -f DATA/LOG/yacy00.log
+ if [ $DEBUG -eq 1 ] #debug
+ then
+ # with exec the java process become the main process and will receive signals such as SIGTERM
+ exec $cmdline
+ else
+ echo " >> YaCy started as daemon process. Administration at http://localhost:$PORT << "
+ eval $cmdline
+ if [ "$TAILLOG" -eq "1" -a ! "$DEBUG" -eq "1" ];then
+ sleep 1
+ tail -f DATA/LOG/yacy00.log
+ fi
fi
fi