Gentoo Websites Logo
Go to: Gentoo Home Documentation Forums Lists Bugs Planet Store Wiki Get Gentoo!

Bug 310463

Summary: sys-apps/openrc-0.6.0-r1 - cosmetic issue with /lib/rc/net/bonding.sh
Product: Gentoo Linux Reporter: Doktor Notor <notordoktor>
Component: [OLD] baselayoutAssignee: Gentoo's Team for Core System packages <base-system>
Status: RESOLVED FIXED    
Severity: trivial CC: pchrist, roy, werner
Priority: High    
Version: unspecified   
Hardware: All   
OS: Linux   
Whiteboard:
Package list:
Runtime testing required: ---

Description Doktor Notor 2010-03-21 00:18:07 UTC
Getting this all the time on boot:

 * Bringing up interface bond0
/lib/rc/net/bonding.sh: line 48: echo: write error: Operation not permitted
/lib/rc/net/bonding.sh: line 48: echo: write error: Operation not permitted

Relevant configuration from /etc/conf.d/net:

config_eth0="null"
config_eth1="null"
ifdown_eth0="NO"
ifdown_eth1="NO"
config_bond0="dhcp"
dhcpcd_bond0="-t 10"
dhcp_bond0="nontp"
slaves_bond0="eth0 eth1"
miimon_bond0="100"
use_carrier_bond0="1"
downdelay_bond0="100"
updelay_bond0="100"
mode_bond0="active-backup"
primary_bond0="eth0"
Comment 1 Panagiotis Christopoulos (RETIRED) gentoo-dev 2010-03-23 21:36:42 UTC
Does this also happen with openrc-0.6.1? Please paste your emerge --info and emerge -pv openrc output. Also any dmesg or /var/log/messages output and maybe your "/etc/init.d/net.bond0 -d start" output. Thank you.
Comment 2 Doktor Notor 2010-03-23 22:01:02 UTC
Yes, it does happen with 0.6.1 as well since the relevant code in the script hasn't changed. Whatever, the reason this happens is that the code parses the configuration values for each bond slave and tries to modify sysfs values that the kernel doesn't permit to be modified at that time. Didn't bother to track down which one of the options listen in comment #0 triggers this in my case, perhaps kernel folks could say.

Frankly I don't expect any magic fix here, I'd merely suggest to redirect the output to /dev/null and move on. The bond itself is working perfectly fine (hence, the "cosmetic" in bug summary).
Comment 3 Doktor Notor 2010-03-23 22:14:17 UTC
(In reply to comment #2)
> Frankly I don't expect any magic fix here, I'd merely suggest to redirect the
> output to /dev/null and move on. The bond itself is working perfectly fine
> (hence, the "cosmetic" in bug summary).
 
As an alternative, do echo the command itself that failed on non-zero return status, i.e., what the echo "${s}" >"${x}" was that triggered "Operation not permitted" which would help with debugging. As it is, the output is just not useful. 
Comment 5 Doktor Notor 2010-03-24 20:47:25 UTC
(In reply to comment #4)
> http://roy.marples.name/projects/openrc/changeset/ae7a92ae7b54fd832a211546edeb290f854fdad2

Yeah, exactly like that, cool... consider this fixed :) Thanks.
Comment 6 William Hubbs gentoo-dev 2010-03-24 22:49:34 UTC
This has been fixed upstream.
Comment 7 werner maier 2010-05-18 13:29:08 UTC
The "cosmetic bug" is still there in openrc-0.6.1-r1.

The problem is, that /sys/class/net/bond1/bonding/slaves does follow an other syntax than the rest. This is why slaves are handled just below that loop, 
so slaves should not be handled at all in that loop.

I suggest just letting ".../bonding/slaves" alone, hence
the following fix here:
---------------------------------snip----------------------------------
--- bonding.sh.org      2010-05-18 15:17:00.544299188 +0200
+++ bonding.sh  2010-05-18 15:16:27.724300701 +0200
@@ -43,6 +43,8 @@
        # Nice and dynamic :)
        for x in /sys/class/net/"${IFACE}"/bonding/*; do
                [ -f "${x}" ] || continue
+               # slaves need another syntax and will be handled separately
+               [ "${x##*/}" == "slaves" ] && continue
                eval s=\$${x##*/}_${IFVAR}
                if [ -n "${s}" ]; then
                        echo "${s}" >"${x}"
---------------------------------snip----------------------------------