Skip to content

Commit

Permalink
sqm-scripts: make run.sh ignore spurious incomplete hotplug ifups
Browse files Browse the repository at this point in the history
During system start up pppoe devices seem to receice ifup events
before the interface actually exists. This commit makes sqm's
run.sh script test whether the sys files for an interface
exist before actually trying to start an SQM instance on an
interface. This seems to nicely avoid starting on an not
fully established pppoe interface and avoids a number of
error messages during startup.

Signed-off-by: Sebastian Moeller <moeller0@gmx.de>
  • Loading branch information
moeller0 committed Mar 5, 2015
1 parent a4b171d commit a9020bf
Showing 1 changed file with 9 additions and 1 deletion.
10 changes: 9 additions & 1 deletion net/sqm-scripts/files/usr/lib/sqm/run.sh
Expand Up @@ -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
Expand Down Expand Up @@ -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 starting SQM on nothing." > /dev/kmsg
logger -t SQM -s "${IFACE} does currently not exist, not even trying starting SQM on nothing."
return 0
fi

logger -t SQM -s "${0} Queue Setup Script: ${SCRIPT}"
[ -x "$SCRIPT" ] && { $SCRIPT ; touch ${ACTIVE_STATE_FILE_FQN}; }
}
Expand Down

0 comments on commit a9020bf

Please sign in to comment.