From 34bfa864aad205d14998a0e44184804bd2afc128 Mon Sep 17 00:00:00 2001 From: wajasu Date: Tue, 27 Mar 2012 14:27:36 -0500 Subject: [PATCH] shutdown netcfg net-profiles in reverse order to support dependent interfaces Signed-off-by: wajasu Content-Type: text/plain; charset="utf-8" --- rc.d/net-profiles | 10 +++++++--- 1 file changed, 7 insertions(+), 3 deletions(-) diff --git a/rc.d/net-profiles b/rc.d/net-profiles index e8b8bc7..7fd3242 100755 --- a/rc.d/net-profiles +++ b/rc.d/net-profiles @@ -70,9 +70,13 @@ case "$1" in # shutdown any profiles started by netcfg (or from NET_PROFILES in rc.conf) # JP: only attempt to disconnect the profiles _this daemon_ was told to control - while read profile; do - /usr/bin/netcfg2 down "$profile" - done < "$STATE_DIR/net-profiles" + # and do so in reverse order so that interfaces composing bridges can be desconstructed gracefully + running_profiles=(`cat "$STATE_DIR/net-profiles"`) + #echo "RUNNING PROFILES: ${running_profiles[*]}" + for (( i=${#running_profiles[@]}-1; i>=0; i-- )); do + running_profile=${running_profiles[i]#@} + /usr/bin/netcfg2 down "$running_profile" + done rm -f "$STATE_DIR/net-profiles" rm_daemon net-profiles ;; -- 1.7.9.4