From b1e992a739057d0b3b72dedeb9e6c47a14f47829 Mon Sep 17 00:00:00 2001 From: Takashi Kajinami Date: Tue, 29 Jun 2021 14:04:18 +0900 Subject: [PATCH] Neutron: Use the pids subsystem to look up container id Currently we rely on cgroup name to detect id of sidecar containers but the name is not managed by podman and it is not guaranteed that it is consistent with container id. This changes switches the base record to the pid subsystem which is actively managed by podman and more likely to be consistent with container ids. Closes-Bug: #1933918 Change-Id: Id57f86e62409e257f5619dc8b360cee3f922c805 --- deployment/neutron/kill-script | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/deployment/neutron/kill-script b/deployment/neutron/kill-script index e705ac5130..f57e2d00f1 100644 --- a/deployment/neutron/kill-script +++ b/deployment/neutron/kill-script @@ -52,7 +52,7 @@ signal_container() { {% raw -%} if [ -f /proc/$PID/cgroup ]; then # Get container ID based on process cgroups - CT_ID=$(awk 'BEGIN {FS="[-.]"} /name=/{print $3}' /proc/$PID/cgroup) + CT_ID=$(awk 'BEGIN {FS="[-.]"} /:pids:/{print $3}' /proc/$PID/cgroup) CT_NAME=$($CLI inspect -f '{{.Name}}' $CT_ID) case $SIG in