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 (cherry picked from commitb1e992a739
) (cherry picked from commit8c2862d230
) (cherry picked from commit46ad1e676d
)
This commit is contained in:
parent
8e412bd6ce
commit
6a3ebac50a
@ -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
|
||||
|
Loading…
Reference in New Issue
Block a user