Created attachment 978626 [details] Configuration and log files Description of problem: Sometimes a interface is not yet available when it is brought up by network.service during boot. Even if DEVTIMEOUT is defined the scripts does not wait for the interface do become available. Version-Release number of selected component (if applicable): initscripts-9.56.1-6.fc21.x86_64 How reproducible: About once in 10 reboots. Steps to Reproduce: 1. Configure the system to use network.service instead of NetworkManager 2. Define DEVTIMEOUT=5 in /etc/sysconfig/network 3. Repeatedly reboot until problem is seen. Actual results: Ethernet interface not brought up during boot. Error message "Device enp1s0 does not seem to be present, delaying initialization." Expected results: Ethernet interfaces up after boot. Additional info: Configuration and log attached. When network.service starts function is_available_wait() is called. This then calls is_available(). And if return status is 1 a loop is entered to wait for the interface. However if the interface is not yet available, and there is no "alias" in /etc/modprobe.d/*.conf, is_availble() returns 2. Thus the wait loop is not entered when needed. This patch works for me. --- /etc/sysconfig/network-scripts/network-functions.original +++ /etc/sysconfig/network-scripts/network-functions @@ -333,27 +333,27 @@ is_available_wait () { [ -z "$1" ] && return 1 local retry=${2##*[!0-9]*} is_available $1 ret=$? - [ 0"$ret" -ne 1 ] && return $ret + [ 0"$ret" -ne 2 ] && return $ret while [ 0"$retry" -gt 0 ]; do sleep 1 [ -d "/sys/class/net/$1" ] && return 0 retry=$(($retry -1)) done - return 1 + return 2 } need_hostname () { CHECK_HOSTNAME=$(hostname) if [ "$CHECK_HOSTNAME" = "(none)" -o "$CHECK_HOSTNAME" = "localhost" -o \ "$CHECK_HOSTNAME" = "localhost.localdomain" ]; then return 0 else
Actually this was written specifically fro the case when is_available return 1, so that needs to stay. So I would suggest something like: diff --git a/sysconfig/network-scripts/network-functions b/sysconfig/network-scripts/network-functions index 1ecbcfc..9a5e359 100644 --- a/sysconfig/network-scripts/network-functions +++ b/sysconfig/network-scripts/network-functions @@ -336,18 +336,16 @@ is_available_wait () local retry=${2##*[!0-9]*} - is_available $1 + is_available $1 && return 0 ret=$? - [ 0"$ret" -ne 1 ] && return $ret - while [ 0"$retry" -gt 0 ]; do sleep 1 [ -d "/sys/class/net/$1" ] && return 0 retry=$(($retry -1)) done - return 1 + return $ret } need_hostname ()
(In reply to Lukáš Nykrýn from comment #1) I have tested your patch and confirm it solves the problem.
Thanks for testing, the patch is now in upstream and will be in next release of initscripts. https://git.fedorahosted.org/cgit/initscripts.git/commit/?id=1f230a3d2e2733e30577c91645005801ab2c0f40
This message is a reminder that Fedora 21 is nearing its end of life. Approximately 4 (four) weeks from now Fedora will stop maintaining and issuing updates for Fedora 21. It is Fedora's policy to close all bug reports from releases that are no longer maintained. At that time this bug will be closed as EOL if it remains open with a Fedora 'version' of '21'. Package Maintainer: If you wish for this bug to remain open because you plan to fix it in a currently maintained version, simply change the 'version' to a later Fedora version. Thank you for reporting this issue and we are sorry that we were not able to fix it before Fedora 21 is end of life. If you would still like to see this bug fixed and are able to reproduce it against a later version of Fedora, you are encouraged change the 'version' to a later Fedora version prior this bug is closed as described in the policy above. Although we aim to fix as many bugs as possible during every release's lifetime, sometimes those efforts are overtaken by events. Often a more recent Fedora release includes newer upstream software that fixes bugs or makes them obsolete.
Fedora 21 changed to end-of-life (EOL) status on 2015-12-01. Fedora 21 is no longer maintained, which means that it will not receive any further security or bug fix updates. As a result we are closing this bug. If you can reproduce this bug against a currently maintained version of Fedora please feel free to reopen this bug against that version. If you are unable to reopen this bug, please file a new report against the current release. If you experience problems, please add a comment to this bug. Thank you for reporting this bug and we are sorry it could not be fixed.
Just for those (like me) who spent a lot of time with Microsoft Hyper-V and initscripts to get up the network interface during boot (because synthetic network interfaces are initialized with ~ 15 seconds delay): Yes, it's this issue and RHEL 7 suffers the same problem, this is however bug #1287726 ;-)
Robert, thanks for bringing this up to our attention. I will reopen the BZ, so the patch from RHEL is considered for Fedora as well. However, I can't set any ETA, we are currently very busy... Thank you for your understanding.
This message is a reminder that Fedora 25 is nearing its end of life. Approximately 4 (four) weeks from now Fedora will stop maintaining and issuing updates for Fedora 25. It is Fedora's policy to close all bug reports from releases that are no longer maintained. At that time this bug will be closed as EOL if it remains open with a Fedora 'version' of '25'. Package Maintainer: If you wish for this bug to remain open because you plan to fix it in a currently maintained version, simply change the 'version' to a later Fedora version. Thank you for reporting this issue and we are sorry that we were not able to fix it before Fedora 25 is end of life. If you would still like to see this bug fixed and are able to reproduce it against a later version of Fedora, you are encouraged change the 'version' to a later Fedora version prior this bug is closed as described in the policy above. Although we aim to fix as many bugs as possible during every release's lifetime, sometimes those efforts are overtaken by events. Often a more recent Fedora release includes newer upstream software that fixes bugs or makes them obsolete.
Already fixed some time ago: https://github.com/fedora-sysv/initscripts/commit/1f230a3d2e2733e30577c916450058