Skip to content
This repository has been archived by the owner on Nov 30, 2021. It is now read-only.

Commit

Permalink
fix(systemd): handle app containers on restarts
Browse files Browse the repository at this point in the history
This was missed in 66660a4, which allows app containers to be
properly restarted on ungraceful host reboots. See the discussion
at #871 for more information.
  • Loading branch information
Matthew Fisher committed May 5, 2014
1 parent 7ab736e commit 5521435
Showing 1 changed file with 1 addition and 2 deletions.
3 changes: 1 addition & 2 deletions controller/scheduler/coreos.py
Original file line number Diff line number Diff line change
Expand Up @@ -195,11 +195,10 @@ def attach(self, name):
CONTAINER_TEMPLATE = """
[Unit]
Description={name}
After=docker.service
Requires=docker.service
[Service]
ExecStartPre=/usr/bin/docker pull {image}
ExecStartPre=/bin/sh -c "docker inspect {name} >/dev/null 2>&1 && docker rm -f {name} || true"
ExecStart=-/usr/bin/docker run --name {name} -P -e PORT={port} {image} {command}
ExecStartPost=-/bin/sh -c "until docker inspect {name} >/dev/null 2>&1; do sleep 1; done"; \
-/bin/sh -c "arping -Idocker0 -c1 `docker inspect -f '{{{{ .NetworkSettings.IPAddress }}}}' {name}`"
Expand Down

0 comments on commit 5521435

Please sign in to comment.