Browse Source

collectd: sqm_collect: handle being orphaned

If the master collectd instance gets shut down in an uncontrolled
manner (crashes!) then sqm_collect scripts will be left orphaned and
will run forever.

Modify script to check if it still has a parent and if not, exit.

Signed-off-by: Kevin Darbyshire-Bryant <ldir@darbyshire-bryant.me.uk>
lilik-openwrt-22.03
Kevin Darbyshire-Bryant 3 years ago
committed by Kevin Darbyshire-Bryant
parent
commit
8322059f01
2 changed files with 3 additions and 2 deletions
  1. +1
    -1
      utils/collectd/Makefile
  2. +2
    -1
      utils/collectd/files/exec-scripts/sqm_collectd.sh

+ 1
- 1
utils/collectd/Makefile View File

@ -9,7 +9,7 @@ include $(TOPDIR)/rules.mk
PKG_NAME:=collectd
PKG_VERSION:=5.12.0
PKG_RELEASE:=12
PKG_RELEASE:=13
PKG_SOURCE:=$(PKG_NAME)-$(PKG_VERSION).tar.bz2
PKG_SOURCE_URL:=https://collectd.org/files/ \


+ 2
- 1
utils/collectd/files/exec-scripts/sqm_collectd.sh View File

@ -99,7 +99,8 @@ process_qdisc() {
json_cleanup
}
while true ; do
# while not orphaned
while [ $(awk '$1 ~ "^PPid:" {print $2}' /proc/$$/status) -ne 1 ] ; do
for ifc in "$@" ; do
process_qdisc "$ifc"
done


Loading…
Cancel
Save