commit 82b4f8c3aa28339554678820995dd134140863d9 Author: Cédric Jeanneret Date: Tue Oct 6 17:20:01 2020 +0200 Instruct systemd to accept 137 and 143 exit code It might happen a container takes time to stop its running process - it therefore will call "SIGTERM" or "SIGKILL", and conmon will return the actual process exit code. Since the exit code won't be 0, it will be marked as "failed" in systemd status. Note that 137 is, actually, SIGKILL (137-128 = 9) and 143 is SIGTERM (143-128 = 15). While systemd accepts actual SIGTERM by default, it doesn't recognize that 143 exit status. We therefore have to namely point to this status code. Also, by default, SIGKILL isn't accepted as a valid, successful exit status. This change will needs to be backported down to stable/ussuri - and is the equivalent of Iffcfc8bd18a999ae6921a4131d40241df40050f1 Change-Id: I8f19a80016a67ccad0371c5d108516aec640f031 (cherry picked from commit d70250bf18e6be1f317cba03d36fb58a9d3e60ab) diff --git a/tripleo_ansible/roles/tripleo_container_manage/templates/systemd-service.j2 b/tripleo_ansible/roles/tripleo_container_manage/templates/systemd-service.j2 index 52ef92f..de292e4 100644 --- a/tripleo_ansible/roles/tripleo_container_manage/templates/systemd-service.j2 +++ b/tripleo_ansible/roles/tripleo_container_manage/templates/systemd-service.j2 @@ -12,6 +12,7 @@ ExecStart=/usr/bin/podman start {{ lookup('dict', container_data_unit).key }} ExecReload=/usr/bin/podman kill --signal HUP {{ lookup('dict', container_data_unit).key }} ExecStop=/usr/bin/podman stop -t {{ lookup('dict', container_data_unit).value.stop_grace_period | default(10) | int }} {{ lookup('dict', container_data_unit).key }} ExecStopPost=/usr/bin/podman stop -t {{ lookup('dict', container_data_unit).value.stop_grace_period | default(10) | int }} {{ lookup('dict', container_data_unit).key }} +SuccessExitStatus=137 143 KillMode=none Type=forking PIDFile=/var/run/{{ lookup('dict', container_data_unit).key }}.pid