A new user interface for you! Read more...

File 0005-initscripts-fix-port-up-before-master-and-port-down-.patch of Package libteam

From c0a2fa95c52abe34be7214dfeb69a06a8aa7456d Mon Sep 17 00:00:00 2001
From: Jiri Pirko <jiri@resnulli.us>
Date: Wed, 12 Feb 2014 09:51:45 +0100
Subject: [patch libteam] initscripts: fix port up before master and port down
 after master

Signed-off-by: Jiri Pirko <jiri@resnulli.us>
---
 teamd/redhat/initscripts/network-scripts/ifdown-TeamPort         | 7 ++++++-
 teamd/redhat/initscripts/network-scripts/ifup-TeamPort           | 7 ++++++-
 teamd/redhat/initscripts_systemd/network-scripts/ifdown-TeamPort | 7 ++++++-
 teamd/redhat/initscripts_systemd/network-scripts/ifup-TeamPort   | 7 ++++++-
 4 files changed, 24 insertions(+), 4 deletions(-)

diff --git a/teamd/redhat/initscripts/network-scripts/ifdown-TeamPort b/teamd/redhat/initscripts/network-scripts/ifdown-TeamPort
index bb0b7a2..5713968 100755
--- a/teamd/redhat/initscripts/network-scripts/ifdown-TeamPort
+++ b/teamd/redhat/initscripts/network-scripts/ifdown-TeamPort
@@ -1,6 +1,6 @@
 #!/bin/sh
 
-# Copyright (C) 2012-2013 Jiri Pirko <jiri@resnulli.us>
+# Copyright (C) 2012-2014 Jiri Pirko <jiri@resnulli.us>
 #
 # This library is free software; you can redistribute it and/or
 # modify it under the terms of the GNU Lesser General Public
@@ -38,6 +38,11 @@ if [ "${DEVICETYPE}" = "TeamPort" ]; then
 		net_log $"Team master is not specified for port device"
 		exit 1
 	fi
+	/sbin/ip link show ${TEAM_MASTER} > /dev/null 2>&1
+	if [ $? -ne 0 ]; then
+		net_log $"Team master is not present, skipping port device removal from master" info
+		exit 0
+	fi
 	/usr/bin/teamdctl ${TEAM_MASTER} port remove ${DEVICE} || exit 1
 fi
 
diff --git a/teamd/redhat/initscripts/network-scripts/ifup-TeamPort b/teamd/redhat/initscripts/network-scripts/ifup-TeamPort
index 6070513..3e6010d 100755
--- a/teamd/redhat/initscripts/network-scripts/ifup-TeamPort
+++ b/teamd/redhat/initscripts/network-scripts/ifup-TeamPort
@@ -1,6 +1,6 @@
 #!/bin/sh
 
-# Copyright (C) 2012-2013 Jiri Pirko <jiri@resnulli.us>
+# Copyright (C) 2012-2014 Jiri Pirko <jiri@resnulli.us>
 #
 # This library is free software; you can redistribute it and/or
 # modify it under the terms of the GNU Lesser General Public
@@ -40,6 +40,11 @@ if [ "${DEVICETYPE}" = "TeamPort" ]; then
 		net_log $"Team master is not specified for port device"
 		exit 1
 	fi
+	/sbin/ip link show ${TEAM_MASTER} > /dev/null 2>&1
+	if [ $? -ne 0 ]; then
+		net_log $"Team master is not present yet, delaying port device initialization" info
+		exit 0
+	fi
 	/sbin/ip link set dev ${DEVICE} down
 	if [ -n "${TEAM_PORT_CONFIG}" ]; then
 		/usr/bin/teamdctl ${TEAM_MASTER} port config update ${DEVICE} "${TEAM_PORT_CONFIG}" || exit 1
diff --git a/teamd/redhat/initscripts_systemd/network-scripts/ifdown-TeamPort b/teamd/redhat/initscripts_systemd/network-scripts/ifdown-TeamPort
index bb0b7a2..5713968 100755
--- a/teamd/redhat/initscripts_systemd/network-scripts/ifdown-TeamPort
+++ b/teamd/redhat/initscripts_systemd/network-scripts/ifdown-TeamPort
@@ -1,6 +1,6 @@
 #!/bin/sh
 
-# Copyright (C) 2012-2013 Jiri Pirko <jiri@resnulli.us>
+# Copyright (C) 2012-2014 Jiri Pirko <jiri@resnulli.us>
 #
 # This library is free software; you can redistribute it and/or
 # modify it under the terms of the GNU Lesser General Public
@@ -38,6 +38,11 @@ if [ "${DEVICETYPE}" = "TeamPort" ]; then
 		net_log $"Team master is not specified for port device"
 		exit 1
 	fi
+	/sbin/ip link show ${TEAM_MASTER} > /dev/null 2>&1
+	if [ $? -ne 0 ]; then
+		net_log $"Team master is not present, skipping port device removal from master" info
+		exit 0
+	fi
 	/usr/bin/teamdctl ${TEAM_MASTER} port remove ${DEVICE} || exit 1
 fi
 
diff --git a/teamd/redhat/initscripts_systemd/network-scripts/ifup-TeamPort b/teamd/redhat/initscripts_systemd/network-scripts/ifup-TeamPort
index 6070513..3e6010d 100755
--- a/teamd/redhat/initscripts_systemd/network-scripts/ifup-TeamPort
+++ b/teamd/redhat/initscripts_systemd/network-scripts/ifup-TeamPort
@@ -1,6 +1,6 @@
 #!/bin/sh
 
-# Copyright (C) 2012-2013 Jiri Pirko <jiri@resnulli.us>
+# Copyright (C) 2012-2014 Jiri Pirko <jiri@resnulli.us>
 #
 # This library is free software; you can redistribute it and/or
 # modify it under the terms of the GNU Lesser General Public
@@ -40,6 +40,11 @@ if [ "${DEVICETYPE}" = "TeamPort" ]; then
 		net_log $"Team master is not specified for port device"
 		exit 1
 	fi
+	/sbin/ip link show ${TEAM_MASTER} > /dev/null 2>&1
+	if [ $? -ne 0 ]; then
+		net_log $"Team master is not present yet, delaying port device initialization" info
+		exit 0
+	fi
 	/sbin/ip link set dev ${DEVICE} down
 	if [ -n "${TEAM_PORT_CONFIG}" ]; then
 		/usr/bin/teamdctl ${TEAM_MASTER} port config update ${DEVICE} "${TEAM_PORT_CONFIG}" || exit 1
-- 
1.8.5.3