Gentoo Websites Logo
Go to: Gentoo Home Documentation Forums Lists Bugs Planet Store Wiki Get Gentoo!
Bug 408337 - sys-apps/openrc-0.8.3: /etc/init.d/../conf.d/net: line 739: echo: write error: Operation not permitted
Summary: sys-apps/openrc-0.8.3: /etc/init.d/../conf.d/net: line 739: echo: write error...
Status: RESOLVED INVALID
Alias: None
Product: Gentoo Hosted Projects
Classification: Unclassified
Component: OpenRC (show other bugs)
Hardware: All Linux
: Normal normal (vote)
Assignee: OpenRC Team
URL:
Whiteboard: openrc:oldnet
Keywords:
Depends on:
Blocks:
 
Reported: 2012-03-15 11:47 UTC by Martin Mokrejš
Modified: 2013-04-25 23:08 UTC (History)
0 users

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


Attachments

Note You need to log in before you can comment on or make changes to this bug.
Description Martin Mokrejš 2012-03-15 11:47:48 UTC
Although I just upgraded to latest openrc, I am reporting here the following error with a previous version.



 * Bringing up interface bond0
 *   Running preup ...
/etc/init.d/../conf.d/net: line 739: echo: write error: Operation not permitted
 *     Bonding mode is set to active-backup on bond0
 *     MII monitor interval is set to 100 ms on bond0
 *   Adding slaves to bond0 ...
 *     eth0 eth1
 *     Removing addresses
 *       Removing addresses
 [ ok ]
 *   Changing MAC address of bond0 ...
 [ ok ]
 *     changed to 00:25:90:18:3f:2e
 *   172.25.9.182/24 ...
 [ ok ]
 *   Adding routes
 *     default via 172.25.9.1 ...
 [ ok ]
 * Bringing up interface eth0
 *   Running preup ...
 *     Doing nothing on eth0
 *   Changing MAC address of eth0 ...
 [ ok ]
 *     changed to 00:25:90:18:3f:2c
 *   null ...
 [ ok ]
 * Bringing up interface eth1
 *   Running preup ...
 *     Doing nothing on eth1
 *   Changing MAC address of eth1 ...
 [ ok ]
 *     changed to 00:25:90:18:3f:2d
 *   null ...
 [ ok ]
 * Mounting NFS filesystem ...
 [ ok ]
 * Mounting misc binary format filesystem ...
 [ ok ]
 * Starting sshd ...
 [ ok ]
 * Activating swap devices ...
 [ ok ]
 * Initializing random number generator ...
 [ ok ]

rc boot logging stopped at Fri Feb 25 11:13:46 2011



Could it happen that during bootup the file /sys/class/net/bond0/bonding/mode is not YET writable/existing, e.g. no sysfs mounted?


# grep -v "^#" /etc/conf.d/net | uniq

routes_bond0=(
        "default via 172.25.9.1"                # IPv4 default route
)

config_eth0=( "null" )
config_eth1=( "null" )

slaves_bond0="eth0 eth1"
config_bond0=( "172.25.9.182/24" ) # You may not want to assign an IP the the bond

dns_domain_eth0="xxxxx"
dns_servers_eth0="172.25.8.83"

        # Adjusting the bonding mode / MII monitor
        # Possible modes are : 0, 1, 2, 3, 4, 5, 6,
        #     OR
        #   balance-rr, active-backup, balance-xor, broadcast,
        #   802.3ad, balance-tlb, balance-alb
        # MII monitor time interval typically: 100 milliseconds
        #if [[ ${IFACE} == "bond0" ]] ; then
        #       BOND_MODE="active-backup"
        #       BOND_MIIMON="100"
        #       echo ${BOND_MODE} >/sys/class/net/bond0/bonding/mode
        #       echo ${BOND_MIIMON}  >/sys/class/net/bond0/bonding/miimon
        #       einfo "Bonding mode is set to ${BOND_MODE} on ${IFACE}"
        #       einfo "MII monitor interval is set to ${BOND_MIIMON} ms on ${IFACE}"
        #else
        #       einfo "Doing nothing on ${IFACE}"
        #fi
        #return 0
Comment 1 Martin Mokrejš 2012-03-15 15:47:12 UTC
(In reply to comment #0)

>  * Bringing up interface bond0
>  *   Running preup ...
> /etc/init.d/../conf.d/net: line 739: echo: write error: Operation not permitted

[cut]

>         #       echo ${BOND_MODE} >/sys/class/net/bond0/bonding/mode
>         #       echo ${BOND_MIIMON}  >/sys/class/net/bond0/bonding/miimon

I see a similar issue others reported:

https://bugs.launchpad.net/ubuntu/+source/linux/+bug/688703/comments/14
https://bugs.launchpad.net/ubuntu/+source/linux/+bug/688703/comments/15

I wonder whether this has to with CONFIG_SYSFS_DEPRECATED or CONFIG_SYSFS_DEPRECATED_V2 kernel options or not.
Comment 2 William Hubbs gentoo-dev 2012-03-18 22:05:13 UTC
Is this still an issue with the version you are currently running?
Comment 3 Martin Mokrejš 2012-03-19 12:43:49 UTC
I did a lot of upgrades and changed the /etc/conf.net file to match current openrc. The problematic section I copied from Gentto Wiki, as found by robbat2 (bug #408333#c3). As I do not alter the MAC adress of the bond0 interface as I was told NOT to do it (again bug #408333#c3) everything works for me now. ;-)

No, I do not get this error anymore as I dropped the problematic pre_up() section.

root # gzip -dc /proc/config.gz | grep CONFIG_SYSFS
# CONFIG_SYSFS_DEPRECATED is not set
CONFIG_SYSFS=y
root #

The question now would be. Should somebody change the Gentoo Wiki page or shall I try to re-introduce the pre_up() function and study the underlying error for the "echo: write error: Operation not permitted" error? At the very moment I just could not get it at all.


/var/log/rc.log says:

 * Bringing up interface eth0
 [ ok ]
 * Bringing up interface eth1
 [ ok ]
 * Bringing up interface bond0
 *   Setting mode: active-backup
 *   Setting miimon: 100
 *   Adding slaves to bond0 ...
 *     eth0 eth1
 *     Removing addresses
 *       Removing addresses
 [ ok ]
 *   172.25.9.182/24 ...
 [ ok ]
 *   Adding routes
 *     default via 172.25.9.1 ...
 [ ok ]


root # grep -v "^#" /etc/conf.d/net | uniq

config_eth0="null"
config_eth1="null"

slaves_bond0="eth0 eth1"
config_bond0="172.25.9.182/24"

miimon_bond0=100
mode_bond0="active-backup"

rc_net_bond0_need="net.eth0 net.eth1"

routes_bond0="default via 172.25.9.1"

dns_domain_eth0="xxxxx"
dns_servers_eth0="172.25.8.83"

root #


My grub.conf contains:
title Gentoo Linux 2.6.39.4
root (hd0,0)
kernel /boot/vmlinuz-2.6.39.4 root=/dev/md1 bonding.mode=1 bonding.miimon=100 console=ttyS0,115200n8 console=tty0 udev
makeactive

I should probably try to delete the "bonding.mode=1 bonding.miimon=100" from it to be sure /etc/conf.d/net is doing its job because I already set it via kernel command line:

Mar 19 14:11:56 s00142 kernel: [    8.901433] Intel(R) Gigabit Ethernet Network Driver - version 3.0.6-k2
Mar 19 14:11:56 s00142 kernel: [    8.908273] Copyright (c) 2007-2011 Intel Corporation.
Mar 19 14:11:56 s00142 kernel: [    8.913734] igb 0000:08:00.0: power state changed by ACPI to D0
Mar 19 14:11:56 s00142 kernel: [    8.919883] igb 0000:08:00.0: power state changed by ACPI to D0
Mar 19 14:11:56 s00142 kernel: [    8.926046] igb 0000:08:00.0: PCI INT A -> GSI 28 (level, low) -> IRQ 28
Mar 19 14:11:56 s00142 kernel: [    8.932972] igb 0000:08:00.0: setting latency timer to 64
Mar 19 14:11:56 s00142 kernel: [    8.933210] igb 0000:08:00.0: irq 72 for MSI/MSI-X
Mar 19 14:11:56 s00142 kernel: [    8.933214] igb 0000:08:00.0: irq 73 for MSI/MSI-X
Mar 19 14:11:56 s00142 kernel: [    8.933218] igb 0000:08:00.0: irq 74 for MSI/MSI-X
Mar 19 14:11:56 s00142 kernel: [    8.933222] igb 0000:08:00.0: irq 75 for MSI/MSI-X
Mar 19 14:11:56 s00142 kernel: [    8.933225] igb 0000:08:00.0: irq 76 for MSI/MSI-X
Mar 19 14:11:56 s00142 kernel: [    8.933229] igb 0000:08:00.0: irq 77 for MSI/MSI-X
Mar 19 14:11:56 s00142 kernel: [    8.933233] igb 0000:08:00.0: irq 78 for MSI/MSI-X
Mar 19 14:11:56 s00142 kernel: [    8.933237] igb 0000:08:00.0: irq 79 for MSI/MSI-X
Mar 19 14:11:56 s00142 kernel: [    8.933241] igb 0000:08:00.0: irq 80 for MSI/MSI-X
Mar 19 14:11:56 s00142 kernel: [    9.164596] igb 0000:08:00.0: Intel(R) Gigabit Ethernet Network Connection
Mar 19 14:11:56 s00142 kernel: [    9.171701] igb 0000:08:00.0: eth0: (PCIe:2.5Gb/s:Width x4) 00:25:90:18:3f:2c
Mar 19 14:11:56 s00142 kernel: [    9.179132] igb 0000:08:00.0: eth0: PBA No: FFFFFF-0FF
Mar 19 14:11:56 s00142 kernel: [    9.184503] igb 0000:08:00.0: Using MSI-X interrupts. 8 rx queue(s), 8 tx queue(s)
Mar 19 14:11:56 s00142 kernel: [    9.197522] igb 0000:08:00.1: power state changed by ACPI to D0
Mar 19 14:11:56 s00142 kernel: [    9.203667] igb 0000:08:00.1: power state changed by ACPI to D0
Mar 19 14:11:56 s00142 kernel: [    9.209832] igb 0000:08:00.1: PCI INT B -> GSI 40 (level, low) -> IRQ 40
Mar 19 14:11:56 s00142 kernel: [    9.216758] igb 0000:08:00.1: setting latency timer to 64
Mar 19 14:11:56 s00142 kernel: [    9.216982] igb 0000:08:00.1: irq 81 for MSI/MSI-X
Mar 19 14:11:56 s00142 kernel: [    9.216987] igb 0000:08:00.1: irq 82 for MSI/MSI-X
Mar 19 14:11:56 s00142 kernel: [    9.216991] igb 0000:08:00.1: irq 83 for MSI/MSI-X
Mar 19 14:11:56 s00142 kernel: [    9.216994] igb 0000:08:00.1: irq 84 for MSI/MSI-X
Mar 19 14:11:56 s00142 kernel: [    9.216998] igb 0000:08:00.1: irq 85 for MSI/MSI-X
Mar 19 14:11:56 s00142 kernel: [    9.217002] igb 0000:08:00.1: irq 86 for MSI/MSI-X
Mar 19 14:11:56 s00142 kernel: [    9.217006] igb 0000:08:00.1: irq 87 for MSI/MSI-X
Mar 19 14:11:56 s00142 kernel: [    9.217010] igb 0000:08:00.1: irq 88 for MSI/MSI-X
Mar 19 14:11:56 s00142 kernel: [    9.217013] igb 0000:08:00.1: irq 89 for MSI/MSI-X
Mar 19 14:11:56 s00142 kernel: [    9.251946] ata4: SATA link down (SStatus 0 SControl 300)
Mar 19 14:11:56 s00142 kernel: [    9.268240] ata3: SATA link down (SStatus 0 SControl 300)
Mar 19 14:11:56 s00142 kernel: [    9.461381] igb 0000:08:00.1: Intel(R) Gigabit Ethernet Network Connection
Mar 19 14:11:56 s00142 kernel: [    9.468480] igb 0000:08:00.1: eth1: (PCIe:2.5Gb/s:Width x4) 00:25:90:18:3f:2d
Mar 19 14:11:56 s00142 kernel: [    9.475915] igb 0000:08:00.1: eth1: PBA No: FFFFFF-0FF
Mar 19 14:11:56 s00142 kernel: [    9.481285] igb 0000:08:00.1: Using MSI-X interrupts. 8 rx queue(s), 8 tx queue(s)
Mar 19 14:11:56 s00142 kernel: [    9.489305] bonding: Ethernet Channel Bonding Driver: v3.7.0 (June 2, 2010)
Mar 19 14:11:56 s00142 kernel: [    9.496498] bonding: MII link monitoring set to 100 ms
[cut]
Mar 19 14:11:56 s00142 kernel: [   38.153205] igb: eth0 NIC Link is Up 1000 Mbps Full Duplex, Flow Control: RX
Mar 19 14:11:56 s00142 kernel: [   40.443225] igb: eth1 NIC Link is Up 1000 Mbps Full Duplex, Flow Control: RX
Mar 19 14:11:56 s00142 kernel: [   47.254464] bonding: bond0: setting mode to active-backup (1).
Mar 19 14:11:56 s00142 kernel: [   47.256603] bonding: bond0: Setting MII monitoring interval to 100.
Mar 19 14:11:56 s00142 kernel: [   47.947150] bonding: bond0: Adding slave eth0.
Mar 19 14:11:56 s00142 kernel: [   48.030383] bonding: bond0: enslaving eth0 as a backup interface with a down link.
Mar 19 14:11:56 s00142 kernel: [   48.032418] bonding: bond0: Adding slave eth1.
Mar 19 14:11:56 s00142 kernel: [   48.115769] bonding: bond0: enslaving eth1 as a backup interface with a down link.
Mar 19 14:11:56 s00142 kernel: [   50.611091] igb: eth0 NIC Link is Up 1000 Mbps Full Duplex, Flow Control: RX
Mar 19 14:11:56 s00142 kernel: [   50.650501] bonding: bond0: link status definitely up for interface eth0, 1000 Mbps full duplex.
Mar 19 14:11:56 s00142 kernel: [   50.650507] bonding: bond0: making interface eth0 the new active one.
Mar 19 14:11:56 s00142 kernel: [   50.650748] bonding: bond0: first active interface up!
Mar 19 14:11:56 s00142 kernel: [   50.900138] igb: eth1 NIC Link is Up 1000 Mbps Full Duplex, Flow Control: RX
Mar 19 14:11:56 s00142 kernel: [   50.949556] bonding: bond0: link status definitely up for interface eth1, 1000 Mbps full duplex.


What I have installed/running?

[ebuild   R    ] sys-apps/baselayout-2.1  USE="-build" 0 kB
[ebuild   R    ] sys-apps/openrc-0.9.9.3  USE="ncurses pam static-libs unicode -debug (-selinux)" 0 kB

on a vanilla 2.6.39.4 kernel.
Comment 4 Robin Johnson archtester Gentoo Infrastructure gentoo-dev Security 2012-03-19 20:20:59 UTC
Closing this was caused by somebody else's bash outside of openrc.
Please update the wiki page.

I made the bonding documentation in net.example more explicit:
http://git.overlays.gentoo.org/gitweb/?p=proj/openrc.git;a=commit;h=76d3fceb58d757a2acd72a89f6098a45b53fc944
Comment 5 Martin Mokrejš 2012-03-21 23:48:58 UTC
(In reply to comment #4)
> Closing this was caused by somebody else's bash outside of openrc.
> Please update the wiki page.

Hmm, looks this is not "an official Gentoo Wiki site" (http://www.gentoo-wiki.info/HOWTO_Setup_Bonded_ethernet_adapters).

http://nickstallman.net/page/3/ says:
<quote>
Gentoo Wiki is down, but all is not lost!

by on Oct.26, 2008, under gentoo, mirror, wiki

Well the Gentoo Wiki is down with no backups which created a lot of headaches for everyone.
So with 48 hours of work I reconstructed the wiki.

I present to you, http://www.gentoo-wiki.info/

Its a full read only copy of the wiki. Enjoy. :)
</quote>

Re-reading the website contents, it really is an outdated set of HOWTOS. The "newer Gentooo" which is referred to in the text is from around 2008, so baselayout-1, etc. :( 

I contacted nick@luxuryhomesaustralia.com.au. Let's see what happens. Maybe an issue for PR@gentoo.org? ;-)