1
0
Fork 0
mirror of https://github.com/moby/moby.git synced 2022-11-09 12:21:53 -05:00

Stop returns 0 when docker service was not running

In case when docker was not running init script stop was returning value <> 0.
Due to this fact it was impossible to uninstall the docker-engine if the docker service was stopped.

Signed-off-by: Cyprian Gracz <cyprian.gracz@micro-jumbo.eu>

Fixed message logging

Signed-off-by: Cyprian Gracz <cyprian.gracz@micro-jumbo.eu>
This commit is contained in:
Cyprian Gracz 2016-10-25 10:12:59 +02:00
parent 28ef366cea
commit 74cf6157ef

View file

@ -119,9 +119,13 @@ case "$1" in
stop)
check_init
fail_unless_root
log_begin_msg "Stopping $DOCKER_DESC: $BASE"
start-stop-daemon --stop --pidfile "$DOCKER_SSD_PIDFILE" --retry 10
log_end_msg $?
if [ -f "$DOCKER_SSD_PIDFILE" ]; then
log_begin_msg "Stopping $DOCKER_DESC: $BASE"
start-stop-daemon --stop --pidfile "$DOCKER_SSD_PIDFILE" --retry 10
log_end_msg $?
else
log_warning_msg "Docker already stopped - file $DOCKER_SSD_PIDFILE not found."
fi
;;
restart)