Am 10.11.2014 um 03:40 schrieb Michael Biebl: > My suggestion would be, to make "ifup -a" wait for all auto interfaces > to become available with a configurable timeout (60 seconds seems like a > good compromise) after which it gives up waiting for the devices, prints > a warning and proceeds. > > Re-assigning this back to ifupdown, as this is not a systemd issue.
We discussed this a bit more yesterday, and we came to the conclusion, that for jessie, it's probably the simplest solution, if we explicitly call "udevadm settle" in /etc/init.d/networking before it ifup's any devices. A "udevadm settle" will block, until all events in the udev event queue have been processed. This doesn't necessarily guarantee that all networ interfaces actuall do exist, it's behvaiour is more like the one in wheezy under sysvinit. Attached is a patch against /etc/init.d/networking. While we discussed yesterday, to only run "udevadm settle" if there are any auto interfaces, I changed it, to also cover allow-hotplug. I also changed the init script to handle allow-hotplug interfaces. I'll followup with more details later. First, it would be great if you Christop could test this patch. Both using allow-hotplug and auto. This should both bring up the devices more reliably, and also block network.target ($network) for allow-hotplug devices, i.e. services which depend on $network have a better chance to work better with allow-hotplug interfaces. Please test and report back. Michael P.S: The patch also has a downside, i.e. it will serialize early boot and make it slower. In a test VM, the "udevadm settle" call, took about 6 seconds. -- Why is it that all of the instruments seeking intelligent life in the universe are pointed away from Earth?
diff --git a/init.d/networking b/init.d/networking
index 404b525..e9fd91d 100755
--- a/init.d/networking
+++ b/init.d/networking
@@ -105,7 +105,7 @@ ifup_hotplug () {
do
link=${iface##:*}
link=${link##.*}
- if [ -e "/sys/class/net/$link" ] && [ "$(cat /sys/class/net/$link/operstate)" = up ]
+ if [ -e "/sys/class/net/$link" ]
then
echo "$iface"
fi
@@ -133,7 +133,12 @@ start)
set -f
exclusions=$(process_exclusions)
log_action_begin_msg "Configuring network interfaces"
- if ifup -a $exclusions $verbose
+ if [ -x /sbin/udevadm ]; then
+ if [ -n "$(ifquery --list -x lO)" ] || [ -n "$(ifquery --list --allow=hotplug)" ]; then
+ udevadm settle || true
+ fi
+ fi
+ if ifup -a $exclusions $verbose && ifup_hotplug $exclusions $verbose
then
log_action_end_msg $?
else
signature.asc
Description: OpenPGP digital signature

