From 639bcfd0f563ed29871ca5bc16008b1f5c0235c8 Mon Sep 17 00:00:00 2001 From: Adrian Reber Date: Mon, 16 Dec 2019 17:06:17 +0100 Subject: [PATCH] mirrorlist: adapt service file based on official recommendation This changes the mirrorlist service file to conform to the recommendations given in: https://www.redhat.com/sysadmin/podman-shareable-systemd-services Signed-off-by: Adrian Reber --- .../mirrorlist_proxy/templates/mirrorlist.service.j2 | 9 +++++++-- 1 file changed, 7 insertions(+), 2 deletions(-) diff --git a/roles/mirrormanager/mirrorlist_proxy/templates/mirrorlist.service.j2 b/roles/mirrormanager/mirrorlist_proxy/templates/mirrorlist.service.j2 index fff8ca997a..cd56ab7021 100644 --- a/roles/mirrormanager/mirrorlist_proxy/templates/mirrorlist.service.j2 +++ b/roles/mirrormanager/mirrorlist_proxy/templates/mirrorlist.service.j2 @@ -2,11 +2,14 @@ Description=Mirrorlist Container {{ item }} [Service] +Restart=on-failure User=mirrormanager ExecStartPre=-/usr/bin/podman stop -t 1 %n ExecStartPre=-/usr/bin/podman rm %n --force +ExecStartPre=/usr/bin/rm -f /%t/%n-pid /%t/%n-cid ExecStart=/usr/bin/podman run \ - --rm=true \ + --conmon-pidfile /%t/%n-pid \ + --cidfile /%t/%n-cid \ --net=host --userns=keep-id \ --rm=true --name %n \ -v /usr/share/GeoIP:/usr/share/GeoIP \ @@ -20,8 +23,10 @@ ExecStart=/usr/bin/podman run \ --port 1808{{ item }} \ --listen 127.0.0.1 \ -l /var/log/mirrormanager/%n.log -ExecStop=/usr/bin/podman stop -t 1 %n +ExecStop=/usr/bin/sh -c "/usr/bin/podman rm -f `cat /%t/%n-cid`" KillMode=none +Type=forking +PIDFile=/%t/%n-pid [Install] WantedBy=multi-user.target