SHA256
1
0
forked from pool/docker

Accepting request 449885 from home:jordimassaguerpla:branch:Vc:add_wait_on_service_startup

- add "a wait" when starting docker service to fix
  bsc#1019251

OBS-URL: https://build.opensuse.org/request/show/449885
OBS-URL: https://build.opensuse.org/package/show/Virtualization:containers/docker?expand=0&rev=163
This commit is contained in:
Aleksa Sarai 2017-01-13 13:05:35 +00:00 committed by Git OBS Bridge
parent d7c5e8e7f3
commit 82acbf96ef
4 changed files with 33 additions and 1 deletions

View File

@ -1,3 +1,9 @@
-------------------------------------------------------------------
Wed Jan 11 12:47:16 UTC 2017 - jmassaguerpla@suse.com
- add "a wait" when starting docker service to fix
bsc#1019251
------------------------------------------------------------------- -------------------------------------------------------------------
Tue Dec 20 12:41:33 UTC 2016 - normand@linux.vnet.ibm.com Tue Dec 20 12:41:33 UTC 2016 - normand@linux.vnet.ibm.com

View File

@ -10,7 +10,9 @@ EnvironmentFile=/etc/sysconfig/docker
# While Docker has support for socket activation (-H fd://), this is not # While Docker has support for socket activation (-H fd://), this is not
# enabled by default because enabling socket activation means that on boot your # enabled by default because enabling socket activation means that on boot your
# containers won't start until someone tries to administer the Docker daemon. # containers won't start until someone tries to administer the Docker daemon.
Type=simple
ExecStart=/usr/bin/dockerd --containerd /run/containerd/containerd.sock $DOCKER_NETWORK_OPTIONS $DOCKER_OPTS ExecStart=/usr/bin/dockerd --containerd /run/containerd/containerd.sock $DOCKER_NETWORK_OPTIONS $DOCKER_OPTS
ExecStartPost=/usr/lib/docker/docker_service_helper.sh wait
ExecReload=/bin/kill -s HUP $MAINPID ExecReload=/bin/kill -s HUP $MAINPID
# Having non-zero Limit*s causes performance problems due to accounting overhead # Having non-zero Limit*s causes performance problems due to accounting overhead

View File

@ -1,7 +1,7 @@
# #
# spec file for package docker # spec file for package docker
# #
# Copyright (c) 2016 SUSE LINUX GmbH, Nuernberg, Germany. # Copyright (c) 2017 SUSE LINUX GmbH, Nuernberg, Germany.
# #
# All modifications and additions to the file contributed by third parties # All modifications and additions to the file contributed by third parties
# remain the property of their copyright owners, unless otherwise agreed # remain the property of their copyright owners, unless otherwise agreed
@ -59,6 +59,7 @@ Source7: README_SUSE.md
Source8: docker-audit.rules Source8: docker-audit.rules
Source9: docker-update-message.txt Source9: docker-update-message.txt
Source10: tests.sh Source10: tests.sh
Source11: docker_service_helper.sh
# Fixes for architecture-specific issues (gcc-go). # Fixes for architecture-specific issues (gcc-go).
Patch100: gcc-go-patches.patch Patch100: gcc-go-patches.patch
Patch102: netlink_netns_powerpc.patch Patch102: netlink_netns_powerpc.patch
@ -316,6 +317,7 @@ cp -av tests.main tests.sh %{buildroot}%{_prefix}/src/docker/hack/
# #
install -D -m 0644 %{SOURCE1} %{buildroot}%{_unitdir}/%{name}.service install -D -m 0644 %{SOURCE1} %{buildroot}%{_unitdir}/%{name}.service
ln -sf service %{buildroot}%{_sbindir}/rcdocker ln -sf service %{buildroot}%{_sbindir}/rcdocker
install -D -m 0755 %{SOURCE11} %{buildroot}/%{_libexecdir}/docker/
# #
# udev rules that prevents dolphin to show all docker devices and slows down # udev rules that prevents dolphin to show all docker devices and slows down

22
docker_service_helper.sh Normal file
View File

@ -0,0 +1,22 @@
#!/bin/bash
if [ "$1" != "wait" ];then
echo "Usage $0 option"
echo "options can be"
echo " wait: wait for the daemon to start"
exit -1
fi
echo "Waiting for docker daemon to start"
for i in {1..60};do
docker version > /dev/null 2>&1 && break
sleep 1
done
if docker version > /dev/null 2>&1;then
echo "Docker is alive"
exit 0
else
echo "Docker is dead"
exit 1
fi