Skip to content

Commit 7674d50

Browse files
author
Gabriel Monroy
committed
fix(systemd): handle starting containers that already exist
After a reboot, named containers for Deis components often exist in a stopped state. Prior to this commit, Deis would fail to start the components due to a name conflict. Now any existing named containers are removed in ExecStartPre so ExecStart should always succeed.
1 parent c32330f commit 7674d50

1 file changed

Lines changed: 1 addition & 0 deletions

File tree

systemd/deis-controller.service

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -7,6 +7,7 @@ After=deis-logger.service
77
EnvironmentFile=/etc/environment
88
TimeoutStartSec=20m
99
ExecStartPre=/bin/sh -c "/usr/bin/docker history deis/controller >/dev/null || /usr/bin/docker pull deis/controller"
10+
ExecStartPre=/bin/sh -c "/usr/bin/docker inspect deis-controller >/dev/null && /usr/bin/docker rm -f deis-controller || true"
1011
ExecStart=/bin/sh -c "docker run --name deis-controller -p 8000:8000 -e PUBLISH=8000 -e HOST=$COREOS_PRIVATE_IPV4 --volumes-from=deis-logger deis/controller"
1112
ExecStop=/usr/bin/docker rm -f deis-controller
1213

0 commit comments

Comments
 (0)