Created attachment 272679 [details] add a check before adding an interface as a slave Hi, /lib/rc/net/bonding.sh tries to add interface as a slave when slaves are already added. I have added a check with grep, so if interface is already there, then no addition will be made. Regards, Kfir
Yep, this needs to be fixed. Here's what I found: In my /etc/conf.d/net: config_eth0="192.168.100.221 netmask 255.255.255.0" routes_eth0="default via 192.168.100.9" config_bond0="192.168.0.2 netmask 255.255.255.0" slaves_bond0="eth1 eth2 eth3" Start up bonding, zap it to zero, even though the bond is up, try to restart: /etc/init.d/net.bond0 start /etc/init.d/net.bond0 zap /etc/init.d/net.bond0 start and you get: * Bringing up interface bond0 * Adding slaves to bond0 ... * eth1 eth2 eth3 /lib64/rc/net/bonding.sh: line 106: echo: write error: Operation not permitted /lib64/rc/net/bonding.sh: line 106: echo: write error: Operation not permitted /lib64/rc/net/bonding.sh: line 106: echo: write error: Operation not permitted [ !! ] * 192.168.0.2 ... RTNETLINK answers: File exists [ !! ] * ERROR: net.bond0 failed to start Apply the patch, fixes bonding.sh problem. You still get RTNETLINK answers: File exists [ !! ] * ERROR: net.bond0 failed to start but that's because the bond0 master still exists. I'm not sure we need to fix that because zapping always leaves things in a bad state. I'll apply Kfir's patch for now to the repo. If the team thinks we need to fix the other issue, let me know and I'll hunt that one down.
Created attachment 273429 [details, diff] refreshed patch for checking before adding an interface as a slave I forgot to add. The original patch did not apply cleanly because it was against an older version of bonding.sh. I refreshed it for the commit. I'm posting it here for completeness.
Commit db1daa5 applied your patch. Thanks for the report and the patch. This will be part of openrc-0.8.3.
Thanks Anthony for the correction of my patch, and thanks William for applying this patch. Regards, Kfir