[why] when execute systemctl restart docker, error message: localhost.localdomain systemd[1]:docker.service: Failed with result 'timeout'. localhost.localdomain systemd[1]:Failed to start Docker Application Container Engine.
because docker restart default timeout is 90s, when run too much containers, restart docker may need several minutes, then restart failed.
[how] set TimeoutSec=0 to avoid timeout.
Signed-off-by: Liu Yinsi liuyinsi@163.com --- sparrow/0-package/common | 3 +++ 1 file changed, 3 insertions(+)
diff --git a/sparrow/0-package/common b/sparrow/0-package/common index 5eb9f76..2753b9d 100755 --- a/sparrow/0-package/common +++ b/sparrow/0-package/common @@ -40,4 +40,7 @@ cat > /etc/docker/daemon.json <<EOF } EOF
+sed '/^Environment=/a\TimeoutSec=0' /usr/lib/systemd/system/docker.service + +systemctl daemon-reload systemctl restart docker