From 06dc258a28784db98e44a3de488c204f01b97613 Mon Sep 17 00:00:00 2001 From: Nate Johnston Date: Fri, 17 Jan 2020 12:11:29 -0500 Subject: [PATCH] Add handling of signal 15 in kill script The reason bug #1860155 was triggered was because the kill script did not have a stanza for handling the signal that was passed in, which is signal 15. Since signal 15 is unhandled, keepalived processes will still stick around. Add handling for signal 15. Change-Id: I632a3ef5ec137df10f647335f6354589c2316fd0 Related-bug: #1860155 --- .../templates/service_kill.j2 | 15 +++++++++++---- 1 file changed, 11 insertions(+), 4 deletions(-) diff --git a/tripleo_ansible/roles/tripleo-systemd-wrapper/templates/service_kill.j2 b/tripleo_ansible/roles/tripleo-systemd-wrapper/templates/service_kill.j2 index 7abb0179e..311fe3d00 100644 --- a/tripleo_ansible/roles/tripleo-systemd-wrapper/templates/service_kill.j2 +++ b/tripleo_ansible/roles/tripleo-systemd-wrapper/templates/service_kill.j2 @@ -40,9 +40,13 @@ kill_container() { $CLI rm $2 } -hup_container() { - add_date "Sending HUP signal to $1 ($2)" - $CLI kill --signal HUP $2 +signal_container() { + SIGNAL=$3 + if [ -z "$SIGNAL" ]; then + SIGNAL="HUP" + fi + add_date "Sending signal '$SIGNAL' to $1 ($2)" + $CLI kill --signal $SIGNAL $2 } {% raw -%} @@ -53,11 +57,14 @@ if [ -f /proc/$PID/cgroup ]; then case $SIG in HUP) - hup_container $CT_NAME $CT_ID + signal_container $CT_NAME $CT_ID ;; 9) kill_container $CT_NAME $CT_ID ;; + 15) + signal_container $CT_NAME $CT_ID 15 + ;; *) add_date "Unknown action ${SIG} for ${CT_NAME} ${CT_ID}" exit 1