udev ignores network rules on Fedora 11
Hi to all,
I am new to this forum and Linux :) sorry if I make some errors. I want to read the data written in the /etc/udev/rules.d/70-persistent-net.rules file and use them in my script lunched after that rule. So, I wrote this rule: SUBSYSTEM=="net", KERNEL=="eth*", RUN+="/usr/bin/myscript" and I added it on /etc/udev/rules.d/99-myrule.rules my script is never executed. I tried to change the conditions of my rule and I set it in this way: KERNEL=="eth*", RUN+="/usr/bin/myscript" and also this time the script is never executed. Then I tried this rule: SUBSYSTEM=="net", RUN+="/usr/bin/myscript" and the script is executed when the system shutdowns or reboots, and not at boot time. Why the conditions are not true during the boot time? Thank you very much |
hi
on my system it has this warning inside file....# This file was automatically generated by the /lib/udev/write_net_rules # program, run by the persistent-net-generator.rules rules file. # # You can modify it, as long as you keep each rule on a single # line, and change only the value of the NAME= key. 2) there are 2 ways around this both not using that file a) put your script into /etc/rcS with a number starting with S and higher than networking using root powers. b) a lot easier...add the script to rc.local with root powers as rc.local is always the Last script to execute so you can't muck it up |
Quote:
There are lots of other ways how to start your script. |
Quote:
I tried the b solution and it works fine, but I would use the udev system. I could use the a solution if it is not possible to use udev. This is the motivation about what I can do that: I have 3 PCs with the same Hardware, so I would umount the primary disk on a machine and put it on another one. The problem is that the network does not working because the MAC address changes. The easiest solution is to delete the HWADDR field in /etc/sysconfig/network-script/ifcfg-eth* and then it works, but evry time the eth* increases. So my idea is to create 2 udev rules: 1) 69-remove-persistent-net.rules: it deletes the 70-persistent-net.rules 2) 99-config-eth.rules: it reads the 70-persistent-net.rules and then modifies the /etc/sysconfig/network-script/ifcfg-eth* with the correct MAC address I prefer to use udev, it it works :) |
Strange network, how can't it works if MAC changes. MAC filtering? Avoid to use that kind of networks.
Second Quote:
There is file "local.boot" or thesame in /etc/init.d where you can place any script, it executed at boot time before first run level. |
The 3 PCs are in three different places, they are not in the same network.
The network does not work if there is enabled the persistent naming rule and if the ifcfg-eth* file contains the MAC Address. If I delete them it works fine. So my idea is to delete the 70-persistent-net.rules on the shutdown and update the ifcfg-eth* file on boot up after that udev generates the new 70-persistent-net.rules |
All times are GMT -5. The time now is 07:19 AM. |