fix debian sysvinit script fails to restart docker daemon when stopped

Fixes: #44130
Signed-off-by: Yann Autissier <yann.autissier@gmail.com>
(cherry picked from commit 8ad8c6d887)
Signed-off-by: Sebastiaan van Stijn <github@gone.nl>
This commit is contained in:
Yann Autissier 2022-09-10 13:37:19 +00:00 committed by Sebastiaan van Stijn
parent 40b28dc7e1
commit 7f94f2b393
No known key found for this signature in database
GPG key ID: 76698F39D527CE8C

View file

@ -131,7 +131,7 @@ case "$1" in
restart)
check_init
fail_unless_root
docker_pid=$(cat "$DOCKER_SSD_PIDFILE" 2> /dev/null)
docker_pid=$(cat "$DOCKER_SSD_PIDFILE" 2> /dev/null || true)
[ -n "$docker_pid" ] \
&& ps -p $docker_pid > /dev/null 2>&1 \
&& $0 stop