From 49d6ea5ec9b7f72faf8acf397a8f118a82dd6d1d Mon Sep 17 00:00:00 2001 From: Clark Boylan Date: Wed, 16 Apr 2025 15:25:15 -0700 Subject: [PATCH] Use sigint instead of sighup to stop gerrit The old gerrit init script uses sighup to request a graceful shutdown of the service which is why when we ported to docker-compose we configured it to also use sighup. Unfortunately, on noble with podman the podman container apparmor profiles don't allow podman to issue a sighup to the container. This means when we try to stop the service we wait until the 5 minute timeout expires then docker compose + podman issue a sigkill. This is less graceful than we want. To address this we switch to sigint instead. The reason for this is the podman container apparmor profiles do allow signit and the jvm appears to treat sigint, sigterm, and sighup as equivalent triggers for the shutdown hook. Change-Id: Iacfc70713d63443d58bb563b895fdc5dfb0642e2 --- playbooks/roles/gerrit/templates/docker-compose.yaml.j2 | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/playbooks/roles/gerrit/templates/docker-compose.yaml.j2 b/playbooks/roles/gerrit/templates/docker-compose.yaml.j2 index e77b7c6d64..55ccb29780 100644 --- a/playbooks/roles/gerrit/templates/docker-compose.yaml.j2 +++ b/playbooks/roles/gerrit/templates/docker-compose.yaml.j2 @@ -25,7 +25,7 @@ services: command: ["/wait-for-it.sh", "127.0.0.1:3306", "--", "/run-gerrit.sh"] network_mode: host user: gerrit - stop_signal: SIGHUP + stop_signal: SIGINT stop_grace_period: 5m volumes: {% for volume in gerrit_container_volumes %}