|
From: Dominic R. <dl...@ed...> - 2010-04-26 18:24:11
|
On 26/04/2010 16:13, Heiko Zuerker wrote: > Hey, > > Quoting Dominic Raferd<dl...@ed...>: > > >> Regarding udev, I found info at >> http://www.reactivated.net/writing_udev_rules.html#why about how it >> works which mentions some udev tools - udevinfo, udevtest, udevtrigger, >> udevcontrol - which are missing in DL, and might be worth adding. >> > Those are the old tools, they have been replaced by 'udevadm'. > Excecute 'udevadm help' for details. > cool, thanks >> udevtrigger seems to be the way to reprocess udev rules without >> rebooting. Altering (or deleting) 70-persistent-net.rules + udevtrigger >> + /etc/init.d/network restart should be a way to fix a broken network >> connection after a hardware change. At the moment I think you have to >> save-config and reboot instead of udevtrigger. >> > We use the the trigger and settle commands in /etc/init.d/boot. > So I see, and I learn something! > >> If this worked, then a new option could be added for the network script, >> say '-redetect' which would stop the network, delete >> 70-persistent-net.rules, then run udevtrigger before starting the >> network again. It should also post an advisory message that the change >> will not persist under DL unless configuration is saved. >> > To fix a simple broken network connection after a hardware change (especially if using the autoselect option in Setup/Network i.e. letting udev choose the network card module), here is a patch for the network script (DL 1.4RC3): --- /etc/init.d/network 1980-01-01 01:01:01.000000000 +0000 +++ /home/z-shares/scripts/network 2010-04-26 19:21:47.000000000 +0100 @@ -517,0 +518,15 @@ + + redetect) + $0 stop $ONLY_INTERFACE + sleep 1 + echo -n "Removed persistent record(s) for " + egrep -o "NAME=\"[^\"]*" /etc/udev/rules.d/70-persistent-net.rules|awk -F \" '{print $2}' + rm /etc/udev/rules.d/70-persistent-net.rules + udevadm trigger --subsystem-match=net + udevadm settle + echo -n "Redetected and recreated persistent record(s) for " + egrep -o "NAME=\"[^\"]*" /etc/udev/rules.d/70-persistent-net.rules|awk -F \" '{print $2}' + $0 start $ONLY_INTERFACE + echo "Network devices redetected. Run save-config to make changes permanent." + ;; + @@ -519 +534 @@ - echo "Usage: $0 {start|stop|restart} [interface]" + echo "Usage: $0 {start|stop|restart|redetect} [interface]" |