From b3b8aeaedb490a07ed417ba64e942f3976cc4f29 Mon Sep 17 00:00:00 2001 From: Hugo Peixoto Date: Sun, 2 Oct 2022 13:16:47 +0100 Subject: [PATCH] Use docker stop in systemd services --- roles/container-postgres/files/unit.service | 3 ++- roles/container-saucy/files/unit.service | 3 ++- 2 files changed, 4 insertions(+), 2 deletions(-) diff --git a/roles/container-postgres/files/unit.service b/roles/container-postgres/files/unit.service index f206b07..014845f 100644 --- a/roles/container-postgres/files/unit.service +++ b/roles/container-postgres/files/unit.service @@ -6,7 +6,8 @@ After=network-online.target [Service] Restart=on-failure TimeoutStopSec=70 -ExecStart=/usr/bin/docker run --rm -it --name postgres --env-file /srv/postgres/env -v /srv/postgres/data:/var/lib/postgresql/data -p5432:5432 postgres:latest +ExecStart=/usr/bin/docker run --rm --name postgres --env-file /srv/postgres/env -v /srv/postgres/data:/var/lib/postgresql/data -p5432:5432 postgres:latest +ExecStop=/usr/bin/docker stop postgres [Install] WantedBy=multi-user.target default.target diff --git a/roles/container-saucy/files/unit.service b/roles/container-saucy/files/unit.service index bed24dc..aa9a5eb 100644 --- a/roles/container-saucy/files/unit.service +++ b/roles/container-saucy/files/unit.service @@ -6,7 +6,8 @@ After=network-online.target container-postgres.service [Service] Restart=on-failure TimeoutStopSec=70 -ExecStart=/usr/bin/docker run --pull=always --rm -it --name saucy --env-file /srv/saucy/env -v /srv/saucy/data:/data -p80:3000 git.ansol.org/ansol/saucy:latest +ExecStart=/usr/bin/docker run --pull=always --rm --name saucy --env-file /srv/saucy/env -v /srv/saucy/data:/data -p80:3000 git.ansol.org/ansol/saucy:latest +ExecStop=/usr/bin/docker stop saucy [Install] WantedBy=multi-user.target default.target