What is the correct way to restart udev?
Solution 1:
I don't know if this helps in reloading the network configuration, but when I modified /etc/udev/rules.d/70-persistent-cd.rules
to correct the DVD device link from /dev/dvd1
to /dev/dvd
, I had to run
sudo udevadm trigger
to get have the new links created.
Solution 2:
You have to combine all the advice given here in the right order:
- Bring down the network
service networking stop
- Unload the driver module from the kernel
- Find the name of the module
lspci -v
and look for "Kernel driver in use:" modprobe -r <driver module>
- Find the name of the module
- Reload the udev rules
udevadm control --reload-rules
- Trigger the new rules
udevadm trigger
- Load driver
modprobe <driver module>
- Restart the network
service networking start
- (optional) Re-run any
iptables
scripts that referenced theeth
interface name before it was up.
I suspect either step 4 or step 5 isn't really needed, but these steps worked for me. You could check after step 4 with step 2.1 to see if the trigger command already did step 5, edit this answer to reflect your findings if you do.
Solution 3:
I had a similar problem. Since I didn't want to take the time to reboot, I ran a one liner using Chris Wesseling's suggestion.
/etc/init.d/networking stop && modprobe -r tg3 && udevadm control --reload-rules && udevadm trigger && modprobe tg3 && /etc/init.d/networking start
This worked for me using Ubuntu 12.04.02 server. My nics were using the tg3 kernel module driver, so change tg3 to the module your interfaces are using. I found the ones mine used in /etc/udev/rules.d/70-persistent-net.rules
:
PCI device 0x14e4:/sys/devices/pci0000:00/0000:00:1c.4/0000:02:00.1 (tg3) <-kernel module driver for the nic
The one issue I had was a bad route which I fixed with a simple route add command. Thanks for the help Chris!