Fix killscript regex match for libpod-conmon-*
Whenever a process belongs to libpod-conmon-* scope
instead of libpod-*, wrong container name "conmon" is matched as
the container ID.
That increases memory footprint for neutron-dhcp-agent as it puts
sidecars in an endless loop, since the killscript fails with code 125.
That mostly affects higly loaded systems.
Closes-bug: #1955491
Change-Id: I972fce006c787f91e4a56b1a560d202aa9db46c9
Related: rhbz#2032010
Signed-off-by: Bogdan Dobrelya <bdobreli@redhat.com>
(cherry picked from commit 947b18cf44
)
This commit is contained in:
parent
f24ae3eae6
commit
345ac02389
|
@ -52,7 +52,7 @@ signal_container() {
|
||||||
{% raw -%}
|
{% raw -%}
|
||||||
if [ -f /proc/$PID/cgroup ]; then
|
if [ -f /proc/$PID/cgroup ]; then
|
||||||
# Get container ID based on process cgroups
|
# Get container ID based on process cgroups
|
||||||
CT_ID=$(awk 'BEGIN {FS="[-.]"} /:pids:/{print $3}' /proc/$PID/cgroup)
|
CT_ID=$(awk 'BEGIN {FS=".scope|-"} /0::|:pids:/ {if ($(NF-1)) print $(NF-1);exit}' /proc/$PID/cgroup)
|
||||||
CT_NAME=$($CLI inspect -f '{{.Name}}' $CT_ID)
|
CT_NAME=$($CLI inspect -f '{{.Name}}' $CT_ID)
|
||||||
|
|
||||||
case $SIG in
|
case $SIG in
|
||||||
|
|
Loading…
Reference in New Issue