sqm-scripts: backport "make run.sh ignore spurious incomplete hotplug ifups"
Backport from trunk the commit improving hotplug action.
1b5afe8f46
Signed-off-by: Hannu Nyman <hannu.nyman@iki.fi>
This commit is contained in:
parent
17b6911cde
commit
44356cac79
|
@ -9,7 +9,7 @@ include $(TOPDIR)/rules.mk
|
||||||
|
|
||||||
PKG_NAME:=sqm-scripts
|
PKG_NAME:=sqm-scripts
|
||||||
PKG_VERSION:=8
|
PKG_VERSION:=8
|
||||||
PKG_RELEASE:=1
|
PKG_RELEASE:=2
|
||||||
PKG_LICENSE:=GPLv2
|
PKG_LICENSE:=GPLv2
|
||||||
|
|
||||||
PKG_BUILD_DIR := $(BUILD_DIR)/$(PKG_NAME)
|
PKG_BUILD_DIR := $(BUILD_DIR)/$(PKG_NAME)
|
||||||
|
|
|
@ -1,7 +1,3 @@
|
||||||
#!/bin/sh
|
#!/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}
|
[ "$ACTION" = ifup ] && /usr/lib/sqm/run.sh interface ${DEVICE}
|
||||||
|
|
||||||
|
|
|
@ -23,7 +23,7 @@ case ${1} in
|
||||||
;;
|
;;
|
||||||
interface)
|
interface)
|
||||||
START_ON_IF=$2 # only process this 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...
|
# TODO if $2 is empty just bail...
|
||||||
if [ -z ${START_ON_IF} ] ;
|
if [ -z ${START_ON_IF} ] ;
|
||||||
then
|
then
|
||||||
|
@ -108,6 +108,14 @@ run_simple_qos() {
|
||||||
logger -t SQM -s "${0} SQM qdiscs on ${IFACE} removed"
|
logger -t SQM -s "${0} SQM qdiscs on ${IFACE} removed"
|
||||||
return 0
|
return 0
|
||||||
fi
|
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}"
|
logger -t SQM -s "${0} Queue Setup Script: ${SCRIPT}"
|
||||||
[ -x "$SCRIPT" ] && { $SCRIPT ; touch ${ACTIVE_STATE_FILE_FQN}; }
|
[ -x "$SCRIPT" ] && { $SCRIPT ; touch ${ACTIVE_STATE_FILE_FQN}; }
|
||||||
}
|
}
|
||||||
|
|
Loading…
Reference in New Issue