From e2d3dd827bcca6cba9e0f2b869d872af07ff2999 Mon Sep 17 00:00:00 2001
From: Jamie Anderson <jamieand@amazon.com>
Date: Mon, 22 Mar 2021 20:33:57 +0000
Subject: [PATCH] Restore containerd dependency, restart policy, and nofile
 settings to service file

Signed-off-by: Jamie Anderson <jamieand@amazon.com>
---
 contrib/init/systemd/docker.service | 8 +++++---
 1 file changed, 5 insertions(+), 3 deletions(-)

diff --git a/contrib/init/systemd/docker.service b/contrib/init/systemd/docker.service
index 7e87245..1654f0b 100644
--- a/contrib/init/systemd/docker.service
+++ b/contrib/init/systemd/docker.service
@@ -1,7 +1,8 @@
 [Unit]
 Description=Docker Application Container Engine
 Documentation=https://docs.docker.com
-After=network-online.target docker.socket firewalld.service
+BindsTo=containerd.service
+After=network-online.target docker.socket firewalld.service containerd.service
 Wants=network-online.target
 Requires=docker.socket
 
@@ -17,7 +18,7 @@ ExecStartPre=/usr/libexec/docker/docker-setup-runtimes.sh
 # for containers run by docker
 ExecStart=/usr/bin/dockerd -H fd:// --containerd=/run/containerd/containerd.sock $OPTIONS $DOCKER_STORAGE_OPTIONS $DOCKER_ADD_RUNTIMES
 ExecReload=/bin/kill -s HUP $MAINPID
-LimitNOFILE=1048576
+LimitNOFILE=infinity
 # Having non-zero Limit*s causes performance problems due to accounting overhead
 # in the kernel. We recommend using cgroups to do container-local accounting.
 LimitNPROC=infinity
@@ -31,7 +32,8 @@ Delegate=yes
 # kill only the docker process, not all processes in the cgroup
 KillMode=process
 # restart the docker process if it exits prematurely
-Restart=on-failure
+RestartSec=2
+Restart=always
 StartLimitBurst=3
 StartLimitInterval=60s
 
-- 
2.31.0.rc2

