Hi People,
Recently an issue where I was trying to changed the group and permission associated with the device /dev/net/tun. As I knew devices were controlled by udev I went looking at its configuration and found this rule 50-udev.rules:KERNEL=="tun", NAME="net/%k". Some research on the web suggested that modifying the default rules was a bad idea and that you should in fact override them with your own custom rules. So I tried setting up a custom rule, this failed. I then tried modifying the default rule this also failed. A helpful response from here pointed me to MAKEDEV and I was able to change /etc/makedev.d/01linux-2.6.x to do what I wanted. But this has raised a couple of questions for me.
1. If udev doesn't directly control the creation of this device why is there a udev rule for it? 2. Is modifying /etc/makedev.d/01linux-2.6.x likely to cause me issues in future ?
My investigation to date has led to me to believe that devices listed in /etc/udev/makedev.d/ are the devices that you always want to be present on a system rather than relying on something about your systems Hardware configuration to lead to a device being created. Is this correct ?
Thank you for any thoughts / information you can share relating to this.
Hi,
On Tue, Oct 28, 2008 at 00:21, Clint Dilks clintd@scms.waikato.ac.nz wrote:
- Is modifying /etc/makedev.d/01linux-2.6.x likely to cause me issues in
future ?
Possibly, since this file is owned by the MAKEDEV rpm. If there is an upgrade in MAKEDEV, it may overwrite this file. Or if it doesn't, but there was an addition of a new device there, you would not get the new device. I would say it would be safer to create a separate file instead of modifying those.
From man MAKEDEV:
CONFIGURATION CONFLICTS: In the event that the set of configuration files contains multiple rules for a given device name, MAKEDEV will use all of them. The end result is typically that the last rule given (either by virtue of being listed below all other matching rules in the same file, or by being listed in a file which is read after all others which contain alternate rules) will apply. MAKEDEV reads the set of configuration files in sorted order, so this misfeature can be exploited dependably.
So I believe if you restore the 01linux-2.6.x file to its original state and create a 99local file with your customized rule, it should work. Try to do that in a test environment and let us know how that goes.
I cannot answer your other questions about why it's created with MAKEDEV and not by udev itself, unfortunately I don't know enough of udev or of /dev/net/tun to be able to tell why it's done like this.
HTH, Filipe
On Tue, Oct 28, 2008 at 09:54:07AM -0400, Filipe Brandenburger wrote:
On Tue, Oct 28, 2008 at 00:21, Clint Dilks clintd@scms.waikato.ac.nz wrote:
- Is modifying /etc/makedev.d/01linux-2.6.x likely to cause me issues in
future ?
Possibly, since this file is owned by the MAKEDEV rpm. If there is an upgrade in MAKEDEV, it may overwrite this file. Or if it doesn't, but there was an addition of a new device there, you would not get the new device. I would say it would be safer to create a separate file instead of modifying those.
In the future may include a clean install. Thus the change needs to be entered in your off line notebook so you can recall the magic you are building in your box.
Check to see if the RPM builder marked it as a config file.
rpm -qc MAKEDEV rpm -qV MAKEDEV
If it is a config file it will be paired with or as an *rpmnew or *rpmsave file. http://www.redhat.com/docs/books/max-rpm/max-rpm-html/s1-rpm-install-additio...
If it is not a config file you will need to be able to regenerate it from your notes.
Adding a local file still requires a notebook entry and also eliminates the ability to do a simple search for *rpmnew or *rpmsave files. Sysadmins need to watch for and as needed clean up these files....
$ sudo updatedb; locate -i rpm | egrep rpmnew|rpmsave
.....
The key to udev is that it is "udev - userspace device management". Today in Linux most devices are under udev. Some devices are critical to system operation and need to be in place before the user space 'udev' tools can picks up the ball. The bonds depend on the distro..
http://git.kernel.org/?p=linux/hotplug/udev.git;a=blob;hb=HEAD;f=README http://en.wikipedia.org/wiki/Udev
Another key is that the list of possible devices in a system is large, very large. If you look at all the possible devices the list can burst the limits imposed by major and minor device numbers. A number of solutions surfaced to address and manage this overflow -- udev is one of the solutions that seems to work.