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 commit b1e992a739
)
This commit is contained in:
parent
5375378a9f
commit
8c2862d230
|
@ -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