aboutsummaryrefslogtreecommitdiffstats
path: root/sysconfig
diff options
context:
space:
mode:
authorDavid Kaspar [Dee'Kej] <dkaspar@redhat.com>2018-05-02 15:53:04 +0200
committerDee'Kej <deekej@linuxmail.org>2018-05-17 14:34:09 +0200
commitaed9dbbe5c70c973df0691b8d0e3565241120fe0 (patch)
tree43ef14cbe9f6f4e730cb739c9899064e30d5afe9 /sysconfig
parent3f178ab90d8b06f0396c9580b7886de1e2a92b49 (diff)
downloadinitscripts-aed9dbbe5c70c973df0691b8d0e3565241120fe0.tar
initscripts-aed9dbbe5c70c973df0691b8d0e3565241120fe0.tar.gz
initscripts-aed9dbbe5c70c973df0691b8d0e3565241120fe0.tar.bz2
initscripts-aed9dbbe5c70c973df0691b8d0e3565241120fe0.tar.xz
initscripts-aed9dbbe5c70c973df0691b8d0e3565241120fe0.zip
network-functions: add error messages for bonding installation
Instead of displaying messages without context, like this: ./network-functions: line 571: echo: write error: Invalid argument ./network-functions: line 598: echo: write error: Permission denied We will now display pretty error messages (via net_log) about what has actually failed...
Diffstat (limited to 'sysconfig')
-rw-r--r--sysconfig/network-scripts/network-functions22
1 files changed, 17 insertions, 5 deletions
diff --git a/sysconfig/network-scripts/network-functions b/sysconfig/network-scripts/network-functions
index 9d6f9366..bf5d2146 100644
--- a/sysconfig/network-scripts/network-functions
+++ b/sysconfig/network-scripts/network-functions
@@ -554,6 +554,8 @@ bond_master_exists ()
install_bonding_driver ()
{
+ local fn="install_bonding_driver"
+
if ! bond_master_exists ${1}; then
modprobe bonding || return 1
echo "+$1" > /sys/class/net/bonding_masters 2>/dev/null
@@ -578,11 +580,15 @@ install_bonding_driver ()
value=${bopts_vals[$idx]}
if [ "${key}" = "mode" ] ; then
- echo "${value}" > /sys/class/net/${DEVICE}/bonding/$key
+ echo "${value}" > /sys/class/net/${DEVICE}/bonding/$key || {
+ net_log $"Failed to set value '$value' [mode] to ${DEVICE} bonding device" err $fn
+ }
bopts_keys[$idx]=""
fi
if [ "${key}" = "miimon" ] ; then
- echo "${value}" > /sys/class/net/${DEVICE}/bonding/$key
+ echo "${value}" > /sys/class/net/${DEVICE}/bonding/$key || {
+ net_log $"Failed to set value '$value' [miimon] to ${DEVICE} bonding device" err $fn
+ }
bopts_keys[$idx]=""
fi
done
@@ -600,16 +606,22 @@ install_bonding_driver ()
IFS=',';
for arp_ip in $value; do
if ! grep -q $arp_ip /sys/class/net/${DEVICE}/bonding/$key; then
- echo +$arp_ip > /sys/class/net/${DEVICE}/bonding/$key
+ echo +$arp_ip > /sys/class/net/${DEVICE}/bonding/$key || {
+ net_log $"Failed to set '$arp_ip' value [arp_ip_target] to ${DEVICE} bonding device" err $fn
+ }
fi
done
IFS=$OLDIFS;
elif [ "${key}" = "arp_ip_target" ]; then
if ! grep -q ${value#+} /sys/class/net/${DEVICE}/bonding/$key; then
- echo "$value" > /sys/class/net/${DEVICE}/bonding/$key
+ echo "$value" > /sys/class/net/${DEVICE}/bonding/$key || {
+ net_log $"Failed to set '$value' value [arp_ip_target] to ${DEVICE} bonding device" err $fn
+ }
fi
elif [ "${key}" != "primary" ]; then
- echo $value > /sys/class/net/${DEVICE}/bonding/$key
+ echo $value > /sys/class/net/${DEVICE}/bonding/$key || {
+ net_log $"Failed to set '$value' value [$key] to ${DEVICE} bonding device" err $fn
+ }
fi
done
fi