Explorar el Código

Add PartOf to docker systemd service unit.

Currently, if iptables service is restarted,
existing iptables rules are removed.

Docker adds iptables rules dyanmically upon
startup and container creation.  Restarting
the iptables service results in a loss of these
needed iptables rules.

This commit ensures that if iptables service is
restarted by anisble or the user, docker is
also restarted.  This ensures the proper dynamic
iptables rules are in place for docker.

Fixes: openshift/origin#16709
Michael Gugino hace 7 años
padre
commit
91892aad5f
Se han modificado 1 ficheros con 6 adiciones y 0 borrados
  1. 6 0
      roles/docker/templates/custom.conf.j2

+ 6 - 0
roles/docker/templates/custom.conf.j2

@@ -3,3 +3,9 @@
 [Unit]
 Wants=iptables.service
 After=iptables.service
+
+# The following line is a work-around to ensure docker is restarted whenever
+# iptables is restarted.  This ensures the proper iptables rules will be in
+# place for docker.
+# Note:  This will also cause docker to be stopped if iptables is stopped.
+PartOf=iptables.service