summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorStephen Hemminger <stephen.hemminger@vyatta.com>2010-10-25 09:15:18 -0700
committerStephen Hemminger <stephen.hemminger@vyatta.com>2010-10-25 09:15:18 -0700
commit6c0a3aa59ed28dceddd8e5f09fdad12e255639ee (patch)
tree129f1c9ad43763a4961429ba3352e52e302b9cd3
parent227ba9c0795cbe3a800266a17a5e762ea60c904d (diff)
downloadvyatta-cfg-system-6c0a3aa59ed28dceddd8e5f09fdad12e255639ee.tar.gz
vyatta-cfg-system-6c0a3aa59ed28dceddd8e5f09fdad12e255639ee.zip
Wait to bring up bond interface until end
Setting bonding parameter requires setting interface down. Avoid flapping interface unnecessarily on boot, by defering setting link up until end of boot.
-rw-r--r--templates/interfaces/bonding/node.def11
1 files changed, 9 insertions, 2 deletions
diff --git a/templates/interfaces/bonding/node.def b/templates/interfaces/bonding/node.def
index 211140da..2346c490 100644
--- a/templates/interfaces/bonding/node.def
+++ b/templates/interfaces/bonding/node.def
@@ -9,9 +9,10 @@ syntax:expression: pattern $VAR(@) "^bond[0-9]+$" \
begin: if [ ! -f /sys/class/net/bonding_masters ]; then
sudo modprobe bonding max_bonds=0 miimon=250
fi
+
create: sudo sh -c "echo +$VAR(@) > /sys/class/net/bonding_masters" || exit 1
- ip link set "$VAR(@)" up
- /opt/vyatta/sbin/vyatta-link-detect $VAR(@) on
+ touch /tmp/bonding_$VAR(@).$PPID
+
delete: SLAVES=`cat /sys/class/net/$VAR(@)/bonding/slaves`;
if [ -z "$SLAVES" ]
then
@@ -20,3 +21,9 @@ delete: SLAVES=`cat /sys/class/net/$VAR(@)/bonding/slaves`;
echo "bonded interface $VAR(@) still has slaves: $SLAVES"
exit 1;
fi
+
+end: if [ -f /tmp/bonding_$VAR(@).$PPID ]
+ then rm -f /tmp/bonding_$VAR(@).$PPID
+ ip link set "$VAR(@)" up
+ /opt/vyatta/sbin/vyatta-link-detect $VAR(@) on
+ fi