Package: ifupdown
Version: 0.7.8
Severity: normal
The dhclient program is started indirectly by ifup, called in
/etc/init.d/networking.
This delays boots while searching for an internet connection on occasional
random boots, and possibly is related to the operation of startpar.
It is caused by the timing of dhclient in the boot process, whether it starts
in runlevel 1 or runlevel 2.
The networking init script that starts ifup which starts dhclient runs in
runlevel 1, but there is a delay before dhclient starts. The readahead-fedora
package reduces this delay.
If it runs in 1 then the messages written to stderr will be displayed on the
console and the boot will be delayed until it has removed itself to the
background, then runlevel 2 begins. In runlevel 2 the messages from runlevel
1 scripts are automatically placed in the background so no delay occurs.
Output from stderr and stdout can be redirected when ifup is started.
dhclient should write to a terminal when called manually via ifup to give
connection information, but it is less helpful at boot, and modifying the
/etc/init.d/networking script seems the most obvious solution.
I am currently using this patch I wrote myself which apparently cures the
delays, I have been using it for a month or so now. I wrote something
similar in Debian 6 but this init script has been rewritten in 7, but still
does not fix that issue. The dhclient boothang bug has been about for a few
years now. It is a timing issue that may or may not appear on different
systems and software configurations, and does not appear on every boot because
of the random order boot scripts are run.
You just need to run ifup in the background (&) and redirect stdout and stderr
(>/dev/null 2>&1) to /dev/null. The extra brackets are needed to avoid
syntax errors. The patch below shows the changes I made. If there was some
reason you did not wish to make this change then it should serve as a helpful
reference for others affected by this problem. As boots can be delayed for a
minute when no internet connection is found it is inconvenient.
Best wishes and happy coding!
$ diff -u /opt/initbackups/networking /etc/init.d/networking
--- /opt/initbackups/networking 2014-04-05 06:41:06.317019467 +0100
+++ /etc/init.d/networking 2014-04-10 22:13:03.330378114 +0100
@@ -107,7 +107,7 @@
done)
if [ -n "$ifaces" ]
then
- ifup $ifaces "$@" || true
+ (ifup $ifaces "$@" >/dev/null 2>&1 &) || true
fi
fi
}
@@ -128,7 +128,7 @@
set -f
exclusions=$(process_exclusions)
log_action_begin_msg "Configuring network interfaces"
- if ifup -a $exclusions $verbose && ifup_hotplug $exclusions $verbose
+ if (ifup -a $exclusions $verbose >/dev/null 2>&1 &) && (ifup_hotplug
$exclusions $verbose)
then
log_action_end_msg $?
else
@@ -157,7 +157,7 @@
log_action_begin_msg "Reloading network interfaces configuration"
state=$(cat /run/network/ifstate)
ifdown -a --exclude=lo $verbose || true
- if ifup --exclude=lo $state $verbose ; then
+ if (ifup --exclude=lo $state $verbose >/dev/null 2>&1 &) ; then
log_action_end_msg $?
else
log_action_end_msg $?
@@ -175,7 +175,7 @@
ifdown -a --exclude=lo $verbose || true
set -f
exclusions=$(process_exclusions)
- if ifup -a --exclude=lo $exclusions $verbose && ifup_hotplug
$exclusions $verbose
+ if (ifup -a --exclude=lo $exclusions $verbose >/dev/null 2>&1 &) &&
(ifup_hotplug $exclusions $verbose)
then
log_action_end_msg $?
else
-- System Information:
Debian Release: 7.5
APT prefers stable
APT policy: (500, 'stable')
Architecture: i386 (i686)
Kernel: Linux 3.2.0-4-486
Locale: LANG=en_GB.utf8, LC_CTYPE=en_GB.utf8 (charmap=UTF-8)
Shell: /bin/sh linked to /bin/dash
Versions of packages ifupdown depends on:
ii dpkg 1.16.14
ii initscripts 2.88dsf-41+deb7u1
ii iproute 20120521-3+b3
ii libc62.13-38+deb7u1
ii lsb-base 4.1+Debian8+deb7u1
ifupdown recommends no packages.
Versions of packages ifupdown suggests:
ii isc-dhcp-client [dhcp-client] 4.2.2.dfsg.1-5+deb70u6
ii net-tools 1.60-24.2
pn ppp
pn rdnssd
-- Configuration Files:
/etc/init.d/networking changed [not included]
-- no debconf information
--
To UNSUBSCRIBE, email to debian-bugs-dist-requ...@lists.debian.org
with a subject of "unsubscribe". Trouble? Contact listmas...@lists.debian.org