소스 검색

Add on-failure to default restart policy

In the event that the docker daemon is managed by systemd and spontaneously
dies the default service configuration does not have docker restart. For people
who just want to install and start docker then never worry about whether docker
is running a better default may be to restart the service on a failure.

Signed-off-by: Ryan Abrams <rdabrams@gmail.com>
Ryan Abrams 8 년 전
부모
커밋
7b9ecb9700
2개의 변경된 파일8개의 추가작업 그리고 0개의 파일을 삭제
  1. 4 0
      contrib/init/systemd/docker.service
  2. 4 0
      contrib/init/systemd/docker.service.rpm

+ 4 - 0
contrib/init/systemd/docker.service

@@ -24,6 +24,10 @@ TimeoutStartSec=0
 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
+StartLimitBurst=3
+StartLimitInterval=60s
 
 [Install]
 WantedBy=multi-user.target

+ 4 - 0
contrib/init/systemd/docker.service.rpm

@@ -23,6 +23,10 @@ TimeoutStartSec=0
 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
+StartLimitBurst=3
+StartLimitInterval=60s
 
 [Install]
 WantedBy=multi-user.target