Browse Source

Merge pull request #29902 from caervs/add_autorestart

Add on-failure to default restart policy
Brian Goff 8 years ago
parent
commit
0fcd55072b
2 changed files with 8 additions and 0 deletions
  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
 Delegate=yes
 # kill only the docker process, not all processes in the cgroup
 # kill only the docker process, not all processes in the cgroup
 KillMode=process
 KillMode=process
+# restart the docker process if it exits prematurely
+Restart=on-failure
+StartLimitBurst=3
+StartLimitInterval=60s
 
 
 [Install]
 [Install]
 WantedBy=multi-user.target
 WantedBy=multi-user.target

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

@@ -23,6 +23,10 @@ TimeoutStartSec=0
 Delegate=yes
 Delegate=yes
 # kill only the docker process, not all processes in the cgroup
 # kill only the docker process, not all processes in the cgroup
 KillMode=process
 KillMode=process
+# restart the docker process if it exits prematurely
+Restart=on-failure
+StartLimitBurst=3
+StartLimitInterval=60s
 
 
 [Install]
 [Install]
 WantedBy=multi-user.target
 WantedBy=multi-user.target