From c0db3f2ae225216c106927dde213ae511c18cbd4 Mon Sep 17 00:00:00 2001 From: bergware Date: Tue, 10 Oct 2023 15:07:34 +0200 Subject: [PATCH] Update monitor_nchan --- sbin/monitor_nchan | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/sbin/monitor_nchan b/sbin/monitor_nchan index 29d8ae468..5b2efcb41 100755 --- a/sbin/monitor_nchan +++ b/sbin/monitor_nchan @@ -4,6 +4,7 @@ nchan_pid=/var/run/nchan.pid # keeps list of nchan proce disk_load=/var/local/emhttp/diskload.ini # disk load statistics nginx=/var/run/nginx.socket # nginx local access status=http://localhost/pub/session?buffer_length=1 # nchan information about GUI subscribers +nchan_id=$(basename "$0") while :; do # only act when GUI registered nchan processes are running @@ -15,7 +16,7 @@ while :; do # steady state? subs=$(curl --unix-socket $nginx $status 2>/dev/null|grep -Pom1 'subscribers: \K\d+') if [[ -z $subs || $subs -eq 0 ]]; then - logger -t monitor_nchan -- "Stop running nchan processes" + logger -t $nchan_id -- "Stop running nchan processes" # kill GUI registered nchan processes while IFS=$'\n' read -r running; do pkill -f $docroot/${running/:stop/}