From af116b4ba40cfa903d9b646d4297c7367e4bcd1c Mon Sep 17 00:00:00 2001 From: Dridi Boukelmoune Date: Thu, 21 Sep 2023 18:21:25 +0200 Subject: [PATCH] Collect limits more reliably And add the configuration from /etc/security. --- varnishgather | 12 +++++++++--- 1 file changed, 9 insertions(+), 3 deletions(-) diff --git a/varnishgather b/varnishgather index 4cb9e80..4cd7ef2 100755 --- a/varnishgather +++ b/varnishgather @@ -38,7 +38,7 @@ TOPDIR=$(mktemp -d ${TMPDIR:-/tmp}/varnishgather.XXXXXXXX) ID="$(cat /etc/hostname)-$(date +'%Y%m%d-%H%M%S')" RELDIR="varnishgather-$ID" ORIGPWD=$PWD -VERSION=1.100 +VERSION=1.101 USERID=$(id -u) PID_ALL_VARNISHD=$(pidof varnishd 2> /dev/null) PID_ALL_VARNISHD_COMMA=$(pidof varnishd 2> /dev/null | sed 's/ /,/g') @@ -297,7 +297,7 @@ show_packages() { } show_limits() { - file="/proc/$(echo $PID_VARNISHD | awk '{print $1;}')/limits" + file="/proc/$1/limits" incr @@ -608,8 +608,14 @@ mycat /proc/sys/net/ipv4/tcp_tw_reuse for pid in ${PID_VARNISHD}; do run cat -v /proc/$pid/cmdline mycat /proc/$pid/cgroup + show_limits $pid +done + +for file in /etc/security/limits.conf /etc/security/limits.d/*.conf +do + test -f $file || continue + mycat $file done -show_limits mycat /etc/sysconfig/vha-agent mycat /etc/default/vha-agent