diff options
| author | Hannu Nyman <hannu.nyman@iki.fi> | 2015-03-05 17:57:48 +0200 |
|---|---|---|
| committer | Hannu Nyman <hannu.nyman@iki.fi> | 2015-03-05 17:57:48 +0200 |
| commit | 44356cac79f95425f318894bc46c056d2a14009e (patch) | |
| tree | c5cf1ac8f1822fa98ea27d3601f26645a999bfd0 | |
| parent | 17b6911cde98b61f1ac4af427c3a9bee318e945c (diff) | |
sqm-scripts: backport "make run.sh ignore spurious incomplete hotplug ifups"
Backport from trunk the commit improving hotplug action.
https://github.com/openwrt/packages/commit/1b5afe8f464bae8fa38317548ec95fe303334c0d
Signed-off-by: Hannu Nyman <hannu.nyman@iki.fi>
| -rw-r--r-- | net/sqm-scripts/Makefile | 2 | ||||
| -rwxr-xr-x[-rw-r--r--] | net/sqm-scripts/files/etc/hotplug.d/iface/11-sqm | 4 | ||||
| -rwxr-xr-x | net/sqm-scripts/files/usr/lib/sqm/run.sh | 10 |
3 files changed, 10 insertions, 6 deletions
diff --git a/net/sqm-scripts/Makefile b/net/sqm-scripts/Makefile index 25c964bad..79112227d 100644 --- a/net/sqm-scripts/Makefile +++ b/net/sqm-scripts/Makefile @@ -9,7 +9,7 @@ include $(TOPDIR)/rules.mk PKG_NAME:=sqm-scripts PKG_VERSION:=8 -PKG_RELEASE:=1 +PKG_RELEASE:=2 PKG_LICENSE:=GPLv2 PKG_BUILD_DIR := $(BUILD_DIR)/$(PKG_NAME) diff --git a/net/sqm-scripts/files/etc/hotplug.d/iface/11-sqm b/net/sqm-scripts/files/etc/hotplug.d/iface/11-sqm index 9543acd76..99796021d 100644..100755 --- a/net/sqm-scripts/files/etc/hotplug.d/iface/11-sqm +++ b/net/sqm-scripts/files/etc/hotplug.d/iface/11-sqm @@ -1,7 +1,3 @@ #!/bin/sh -# teach SQM to re-enable itself when an interface re-appears -logger -t SQM -s "hotplug on interface: ${DEVICE} action: ${ACTION}" - [ "$ACTION" = ifup ] && /usr/lib/sqm/run.sh interface ${DEVICE} - diff --git a/net/sqm-scripts/files/usr/lib/sqm/run.sh b/net/sqm-scripts/files/usr/lib/sqm/run.sh index 8995213d7..968292bcd 100755 --- a/net/sqm-scripts/files/usr/lib/sqm/run.sh +++ b/net/sqm-scripts/files/usr/lib/sqm/run.sh @@ -23,7 +23,7 @@ case ${1} in ;; interface) START_ON_IF=$2 # only process this interface - logger -t SQM -s "Re/starting sqm on interface ${START_ON_IF}" + logger -t SQM -s "Trying to re-start SQM on interface ${START_ON_IF}" # TODO if $2 is empty just bail... if [ -z ${START_ON_IF} ] ; then @@ -108,6 +108,14 @@ run_simple_qos() { logger -t SQM -s "${0} SQM qdiscs on ${IFACE} removed" return 0 fi + # in case of spurious hotplug events, try double check whether the interface is really up + if [ ! -d /sys/class/net/${IFACE} ] ; + then + echo "${IFACE} does currently not exist, not even trying to start SQM on nothing." > /dev/kmsg + logger -t SQM -s "${IFACE} does currently not exist, not even trying to start SQM on nothing." + return 0 + fi + logger -t SQM -s "${0} Queue Setup Script: ${SCRIPT}" [ -x "$SCRIPT" ] && { $SCRIPT ; touch ${ACTIVE_STATE_FILE_FQN}; } } |
