SlackwareThis Forum is for the discussion of Slackware Linux.
Notices
Welcome to LinuxQuestions.org, a friendly and active Linux Community.
You are currently viewing LQ as a guest. By joining our community you will have the ability to post topics, receive our newsletter, use the advanced search, subscribe to threads and access many other special features. Registration is quick, simple and absolutely free. Join our community today!
Note that registered members see fewer ads, and ContentLink is completely disabled once you log in.
If you have any problems with the registration process or your account login, please contact us. If you need to reset your password, click here.
Having a problem logging in? Please visit this page to clear all LQ-related cookies.
Get a virtual cloud desktop with the Linux distro that you want in less than five minutes with Shells! With over 10 pre-installed distros to choose from, the worry-free installation life is here! Whether you are a digital nomad or just looking for flexibility, Shells can put your Linux machine on the device that you want to use.
Exclusive for LQ members, get up to 45% off per month. Click here for more info.
I use Slackware 13.37 (but I had this problem with previous versions). I set specific names for my network cards on servers (usually eth0 and eth1) using /etc/udev/rules.d/70-persistent-net.rules. Then on next reboot, udev comes along and makes a mess of the file. Usually deletes both rules I've set and adds an eth2, or switches eth0 to eth1 and so on. I don't understand what's going on.
According the the Slack 13.37 Changes and Hints document:
Quote:
As with 13.1, the system udev rules now reside in /lib/udev/rules.d/ instead
of /etc/udev/rules.d/ in older versions. There should never be a reason
to edit anything in /lib/udev/rules.d/, so if you think you have a case
where this is required, either you're wrong or it needs to be addressed in
the upstream source. However, you can override default rules by placing
one with an identical name inside /etc/udev/rules.d/ The rules files in
/etc/udev/rules.d/ are still intended to (maybe) be edited as needed by
local system administrators, and as such, the rules for optical and network
devices will still be placed there.
According to the above, I should be OK to edit the network rules. Why would udev decide to change things - when I have both interfaces listed using their MAC addresses already? Where am I going wrong? I want my interfaces to be named as I decide, not what udev finds convenient. I've been locked out of servers because of interfaces suddenly jumping around on next reboot. Sometimes I have to re-edit the file about 4 times (and reboot in between) until udev finally gives up on interfering.
Thanks allend. I will try specifying them in order next time. It is possible that is the reason udev is re-writing the rule file. It still seems silly to me - if there is a corresponding rule in there somewhere, it should just move on and leave the file alone - in my opinion.
I would not advocate subverting the udev system. What if you want to add/remove or change a network interface?
Then you add/remove or change a network interface. You don't need udev to do it. And yes, it's completely possible to get them in the right order still. There was a time that udev wasn't around to manage devices. And when udev breaks, even when you are not adding/removing or changing your network setup, then it's just getting in the way-- and I've had that happen just like the original poster.
I was thinking along the same lines. The kernel *will* give names to eth* devices anyway, isn't it? So it's not like they can't exist without udev. In the case of servers, where I want full control over which eth* interface gets what name, it sounds to me like deleting the 75-persistent-net-generator.rules files is just what's required.
Even further than that, I would suggest that the udev rule generator should have never been designed to mess about with a device which already has a naming rule in place. If something is already named, that means somebody (or a piece of software) put it there - it should not be deleted. It reminds of the days I use to work (more) with Windows, when it was damn near impossible to get the system to do what one *actually* wanted it to do. It always seemed to second guess (badly) what was wanted or required.
I have just run some more tests on this server. After about 10 reboots, I pretty much never ended up with an identical /etc/udev/rules.d/70-persistent-net.rules file from one reboot to another. This is utterly ridiculous. This server has two eth* cards and one wlan* adapter. After one reboot the file lists eth2 and wlan0 only, after next reboot only eth1 and nothing else, after another reboot eth1 and wlan0. It just goes on and on. I could never reboot my servers remotely fearing udev will start playing with my network cards naming scheme again and screw things up.
If this is how udev was meant to work - I don't have many good things to say about it. I want a system where *I* do the settings - not some little goblin in the OS. If I wanted a babysitter - I would have returned to the OS Full of Buttons (tm). I am really puzzled as to the thinking behind the udev re-write rules. I would have accepted some scripts that generate rules files *only* the first time a device is detected - letting me change them as I please later, and *not* interfering ever again, unless it detects a device which doesn't have a naming rule in place. But to re-generate the rules on every-single reboot - risking that the order and naming keeps on changing every time - that's not what I would call a recipe for grown up computing.
Well, rant over for now. The rule generator in /lib/udev/rules.d for net devices is on its way to hell and is not going to get its slimy paws on my systems again.
I am happy to submit a bug report. I only posted here first to make sure it's not something silly that I'm doing. I'd rather not waste developers' time just to find out that I'm not using a piece of software the way it's meant to be used - if I can help it.
Also - does anybody know where the bug report should be submitted - to Slackware or to udev? Is the udev rule re-generator the creation of Slackware packagers, or comes straight upstream from udev?
You should read the paragraph following the one you posted in OP;
Quote:
Speaking of udev, pay particular attention to 70-persistent-net.rules and
70-persistent-cd.rules in /etc/udev/rules.d/ -- these two are automatically
generated by the system. If you remove, add, and/or replace some hardware
(specifically network cards and/or optical drives) in a machine, you will
probably need to edit one or both of the rules files mentioned above.
I do agree that '/etc/udev/rules.d/70-persistent-net.rules' should allow for changes or additions without deleting current configs. Possibly flag the changes or modify allow query to admin. Shuffle a copy to revert or some safe guards. Depth of rules should be up to the local admin not a closed config script (/lib/udev/rules.d/75-persistent-net-generator.rules).
If you follow the rules suggestions within some of the scripts you will find that 90-network.rules states;
Quote:
Please put your
# custom rules somewhere else (90-local.rules is a good idea)
The option for custom rule is there by providing 90-local.rules within '/etc/udev/rules.d'.
I believe the above quote from 'CHANGES_AND_HINTS.TXT' is a valid alert and everyone should realize the configuration changes can be made by the admin instead of providing a rule.
The depth of control or configuration can be had for '/lib/udev/rules.d/75-persistent-net-generator.rules' but at what expense?
Speaking of udev, pay particular attention to 70-persistent-net.rules and
70-persistent-cd.rules in /etc/udev/rules.d/ -- these two are automatically
generated by the system. If you remove, add, and/or replace some hardware
(specifically network cards and/or optical drives) in a machine, you will
probably need to edit one or both of the rules files mentioned above.
would seem to suggest that it is ok to edit any of the two files. That seems misleading and confusing - as both files get overwritten on reboots. It actually should read "there is no point in editing any of the two files, as your changes will most likely be lost on next reboot".
Then the option for custom rule is there by providing rule(s) in 90-local.rules within '/etc/udev/rules.d'. This will allow admin to control the installed system devices.
Trace through the scripts and you will see this option.
Last edited by onebuck; 10-12-2011 at 09:29 PM.
Reason: typo
Hi have done some more research and testing into this. Disabling the udev rule generator does not actually solve the problem. Every few reboots, when the modules for my wired network interfaces get loaded in a different order by the kernel, the boot process hangs for about 50 to 60 seconds, after which I get the error message:
Quote:
[udev] error changing eth0 name to eth1: File exists
It looks like the kernel gives names to interfaces first, and then udev is incapable of changing these names if the name wanted already exists. Then I wonder what is the point of a software like udev, if it can't deal with a name being in use? It should be able to rename the interface which is already using the name I am after automatically to next available name, and use the name just freed (which is the name I want) for the interface I tell it to.
So udev can rename your interface, as long as it doesn't step on the toes of what the kernel chose in the first place. Marvelous capability that!
I found lots of other people from various distributions with servers with multiple interfaces complaining of this bug online. Every few reboots and udev is either re-writing the network rule, or, if set to static rules, hangs the computer has it can't finish the renaming process according to the rule in place. It is even more annoying, as it is somewhat random, depending on which order the kernel is detecting the interfaces during boot - which can't be predicted. I don't know yet if there is a fix for this bug - as all bug reports I found (mainly on distributions bug reporting systems) were closed without an actual resolution. I'll keep on looking.
If anybody else has info on this or is experiencing this bug - please post here.
LinuxQuestions.org is looking for people interested in writing
Editorials, Articles, Reviews, and more. If you'd like to contribute
content, let us know.