On Wed, Mar 18, 2015 at 06:52:14PM +0100, Michael Biebl wrote:
> I'm with Marco here. Before adding any workarounds, we need to
> understand what the underlying problem is. Otherwise we are adding cruft
> which nobody understands anymore a few years from now.
> 
> Since I can't reproduce the issue and already have trouble keeping up
> with other bug reports, further investigation needs to be done by
> someone else.

Well, the root cause IMO is that 75-persistent-net-generator.rules is
inherently susceptible to races. It's my understanding that it's valid
for events to be triggered multiple times -- there are multiple places
in d-i that "udevadm trigger" is called, including start-udev (as
shipped by udev-udeb) which would trigger another set of "add" events
beyond the original "hotplug" one.

This is why write_net_rules operates under a lockfile too (again, AIUI).
It's just that this doesn't fix the race, just limits the race window
significantly but not entirely (as it makes write_net_rules idempotent,
but not 75-persistent-net-generator.rules).

The reason this is found in current jessie might just be that udev got
faster, or more udevadm triggers were added in other parts of the
installer etc.

In any case, if you need more input from a buggy system, feel free to
let me know and I'll try my best to get back to you with more details.

Oh, my original patch was buggy for many reasons, here's the updated
version:

diff --git a/debian/extra/write_net_rules b/debian/extra/write_net_rules
index 4379792..95939b8 100644
--- a/debian/extra/write_net_rules
+++ b/debian/extra/write_net_rules
@@ -117,6 +117,12 @@ fi
 basename=${INTERFACE%%[0-9]*}
 match="$match, KERNEL==\"$basename*\""
 
+# detect a race and abort, cf. #765577
+if [ -f $RULES_FILE ] && grep -q -F "$match" $RULES_FILE; then
+       unlock_rules_file
+       exit 0
+fi
+
 if [ "$INTERFACE_NAME" ]; then
        # external tools may request a custom name
        COMMENT="$COMMENT (custom name provided by external tool)"

Regards,
Faidon


-- 
To UNSUBSCRIBE, email to debian-bugs-dist-requ...@lists.debian.org
with a subject of "unsubscribe". Trouble? Contact listmas...@lists.debian.org

Reply via email to