Gentoo Websites Logo
Go to: Gentoo Home Documentation Forums Lists Bugs Planet Store Wiki Get Gentoo!
Bug 332181 - sys-apps/openrc-0.6.1-r1 bonding: problem with handling of slaves, primary via sysfs
Summary: sys-apps/openrc-0.6.1-r1 bonding: problem with handling of slaves, primary vi...
Status: RESOLVED FIXED
Alias: None
Product: Gentoo Linux
Classification: Unclassified
Component: [OLD] baselayout (show other bugs)
Hardware: All Linux
: High normal (vote)
Assignee: OpenRC Team
URL:
Whiteboard: openrc:oldnet
Keywords: InOverlay
Depends on:
Blocks:
 
Reported: 2010-08-11 06:20 UTC by Lutz Heermann
Modified: 2010-08-14 00:32 UTC (History)
0 users

See Also:
Package list:
Runtime testing required: ---


Attachments
Solve bonding problems with slaves and primary (openrc-bonding_slaves_primary.patch,992 bytes, patch)
2010-08-11 06:29 UTC, Lutz Heermann
Details | Diff

Note You need to log in before you can comment on or make changes to this bug.
Description Lutz Heermann 2010-08-11 06:20:27 UTC
The bonding rc script tries to set the slaves and primary before is up, which results in the following error message:
/lib64/rc/net/bonding.sh: line 48: echo: write error: Operation not permitted
Also the primary slave will not be set as configured.

Reproducible: Always

Steps to Reproduce:
1. Configure a bond in /etc/conf.d/net:
config_bond0="192.168.127.1/32"
mode_bond0="active-backup"
miimon_bond0="100"
slaves_bond0="eth2"
primary_bond0="eth2"

2. sysfs has to be mounted
3. Start bond:
/etc/init.d/net.bond0 start
Actual Results:  
Outout is:
 * 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
 *   Adding slaves to bond0 ... *     eth2
 [ ok ]
 *   192.168.127.1/32 ... [ ok ]

Primary is not set:
# cat /sys/class/net/bond0/bonding/primary


Expected Results:  
No error messages.
Primary should be set in /sys/class/net/bond0/bonding/primary
Comment 1 Lutz Heermann 2010-08-11 06:29:26 UTC
Created attachment 242373 [details, diff]
Solve bonding problems with slaves and primary

The solution is quiet simple:
- put content from slaves_${IFVAR} and primary_${IFVAR} into local variables
- unset slaves_${IFVAR} and primary_${IFVAR} to have them not written to sysfs in line 48
- handle primary (if set) on its own before other slaves
Comment 2 Anthony Basile gentoo-dev 2010-08-13 21:36:02 UTC
I've check this and it looks good.  A slightly modified version of this patch will be in the next version bump.  Thanks.
Comment 3 Jory A. Pratt gentoo-dev 2010-08-14 00:32:40 UTC
(In reply to comment #2)
> I've check this and it looks good.  A slightly modified version of this patch
> will be in the next version bump.  Thanks.
> 

Closing as it is already commited in our overlay, please check next release
which will happen later this week to ensure problem is resolved, as always if
it is not please reopen the bug.