Summary: | sys-apps/openrc-0.24.2 & sys-fs/eudev-3.2.1-r1: race condition with renamed network interfaces | ||
---|---|---|---|
Product: | Gentoo Linux | Reporter: | Mihai Moldovan <ionic> |
Component: | Current packages | Assignee: | OpenRC Team <openrc> |
Status: | RESOLVED OBSOLETE | ||
Severity: | normal | CC: | netifrc |
Priority: | Normal | ||
Version: | unspecified | ||
Hardware: | All | ||
OS: | Linux | ||
Whiteboard: | |||
Package list: | Runtime testing required: | --- |
Description
Mihai Moldovan
2017-04-09 08:53:30 UTC
Using a patch like that to trigger a short timeouted loop is allowing enough time to pass so that the device becomes available. Note that I explicitly do not upload it as an attachment to not encourage applying it, since it feels more like an ugly hack than a real solution to the problem: --- /etc/init.d/net.lo.bak 2017-03-20 03:20:31.376968301 +0100 +++ /etc/init.d/net.lo 2017-04-09 11:26:10.205556961 +0200 @@ -604,20 +604,34 @@ start() eoutdent fi - _up 2>/dev/null - - for module in ${MODULES}; do - if [ "$(command -v "${module}_pre_start")" = "${module}_pre_start" ]; then - ${module}_pre_start || exit $? + local exists_timeout="3" found_dev="0" + while [ "${exists_timeout}" -ne "0" ]; do + if ! _exists; then + ewarn "WARNING: interface ${IFACE} did not turn up yet, waiting for it ..." + sleep 1 + else + found_dev="1" + break fi + + exists_timeout="$((exists_timeout - 1))" done - if ! _exists; then + if [ "${found_dev}" -ne "1" ]; then + eerror "ERROR: timeout while waiting for interface ${IFACE}" eerror "ERROR: interface ${IFACE} does not exist" eerror "Ensure that you have loaded the correct kernel module for your hardware" return 1 fi + _up 2>/dev/null + + for module in ${MODULES}; do + if [ "$(command -v "${module}_pre_start")" = "${module}_pre_start" ]; then + ${module}_pre_start || exit $? + fi + done + if ! _wait_for_carrier; then if service_started devd; then ewarn "no carrier, but devd will start us when we have one" Result: * Executing: /lib64/rc/sh/openrc-run.sh /lib64/rc/sh/openrc-run.sh /etc/init.d/virtlogd start * Starting virtlogd ... * start-stop-daemon: fopen `/var/run/virtlogd.pid': No such file or directory * Detaching to start `/usr/sbin/virtlogd' ... [ ok ] * Executing: /lib64/rc/sh/openrc-run.sh /lib64/rc/sh/openrc-run.sh /etc/init.d/udev-settle start * Waiting for uevents to be processed ... [ ok ] * Executing: /lib64/rc/sh/openrc-run.sh /lib64/rc/sh/openrc-run.sh /etc/init.d/net.wifi start * Bringing up interface wifi * Skipping module apipa due to missing program: /sbin/arping /bin/arping * Skipping module arping due to missing program: /sbin/arping /bin/arping /usr/sbin/arping /usr/sbin/arping2 * Skipping module br2684ctl due to missing program: br2684ctl * Skipping module clip due to missing program: /usr/sbin/atmsigd * Skipping module netplugd due to missing program: /sbin/netplugd * Skipping module ifplugd due to missing program: /usr/sbin/ifplugd * Skipping module ipppd due to missing program: /usr/sbin/ipppd * Skipping module firewalld due to missing program: firewall-cmd * Skipping module pump due to missing program: /sbin/pump * Skipping module dhcpcd due to missing program: dhcpcd * Loaded modules: adsl bonding l2tp tuntap bridge ccwgroup ethtool dummy hsr macvlan macchanger macnet wpa_supplicant ssidnet iproute2 pppd system vlan dhclient ip6rd ip6to4 * WARNING: interface wifi did not turn up yet, waiting for it ... * ip link set dev wifi up * Configuring wifi for MAC address XX:XX:XX:XX:XX:XX ... [ ok ] * Starting wpa_supplicant on wifi ... * start-stop-daemon: fopen `/run/wpa_supplicant-wifi.pid': No such file or directory * Detaching to start `/usr/sbin/wpa_supplicant' ... Successfully initialized wpa_supplicant [ ok ] * Starting wpa_cli on wifi ... * start-stop-daemon: fopen `/run/wpa_cli-wifi.pid': No such file or directory * Detaching to start `/usr/bin/wpa_cli' ... [ ok ] * Backgrounding ... ... * WARNING: net.wifi has started, but is inactive * WARNING: libvirtd will start when net.wifi has started * Executing: /lib64/rc/sh/openrc-run.sh /lib64/rc/sh/openrc-run.sh /etc/init.d/xdm-setup start * WARNING: netmount will start when net.wifi has started While that hack works, I don't particularly like it. Hopefully the maintainer has got a better idea. @netifrc maintainers: Is this an OpenRC or netifrc issue? What are your thoughts about it? Thanks, William |