LinuxQuestions.org

LinuxQuestions.org (/questions/)
-   Slackware (http://www.linuxquestions.org/questions/slackware-14/)
-   -   What happaned to /etc/udev/rules.d/75-network-devices.rules ? (http://www.linuxquestions.org/questions/slackware-14/what-happaned-to-etc-udev-rules-d-75-network-devices-rules-4175459287/)

czezz 04-23-2013 09:29 AM

What happaned to /etc/udev/rules.d/75-network-devices.rules ?
 
I have upgraded Slackware 13.37 to 14 (x86).
After upgrade all seems to be working fine.

However, I can see that I am missing file: /etc/udev/rules.d/75-network-devices.rules
That file allowed me in previous version to manage my NICs.

My question is:
- is that file deprecated in 14 ? If so, how can I now manage with my NICs ?
- could it be that my upgrade didnt go well and somehow this file is missing ?


Code:

# cat /etc/udev/rules.d/75-network-devices.rules
# Local network rules to name your network cards.
#
# These rules were generated by nethelper.sh, but you can
# customize them.
#
# You may edit them as needed.
# (If, for example, your machine has more than one network
# card and you need to be sure they will always be given
# the same name, like eth0, based on the MAC address)
#
# If you delete this file, /lib/udev/nethelper.sh will try to
# generate it again the next time udev is started.

KERNEL=="eth?", ATTR{address}=="00:0c:29:a3:ed:27", NAME="eth3"
KERNEL=="eth?", ATTR{address}=="00:0c:29:a3:ed:31", NAME="eth1"
KERNEL=="eth?", ATTR{address}=="00:0c:29:a3:ed:3b", NAME="eth2"
KERNEL=="eth?", ATTR{address}=="00:0c:29:2b:7c:a0", NAME="eth0"
KERNEL=="eth?", ATTR{address}=="00:0c:29:2b:7c:aa", NAME="eth4"
KERNEL=="eth?", ATTR{address}=="00:0c:29:2b:7c:b4", NAME="eth5"


ponce 04-23-2013 09:33 AM

the stuff you're looking for is in /etc/udev/rules.d/70-persistent-net.rules (have a look at it).

czezz 04-23-2013 10:05 AM

Hey, thats the point. After the upgrade, Im missing any similar file.
This is content of my: /etc/udev/rules.d/

Code:

root@slacx:~# ls -al /etc/udev/rules.d/
total 16
drwxr-xr-x 2 root root 4096 Apr 23 17:09 ./
drwxr-xr-x 3 root root 4096 Sep 10  2012 ../
-rw-r--r-- 1 root root  543 Jun  2  2011 70-persistent-cd.rules
-rw-r--r-- 1 root root  341 Apr 23 16:17 99-vmware-scsi-udev.rules


ponce 04-23-2013 10:16 AM

have you upgraded udev too? try to rename your old 75-network-devices.rules (if there) and reboot, the file should be recreated by udevd.

you can read about its function in CHANGES_AND_HINTS.TXT (that you should read together with UPGRADE.TXT when upgrading).

notice that /etc/udev/rules.d should be a pretty much empty directory (here, beside that file I got in it only 70-persistent-cd.rules), because the rules moved to /lib/udev/rules.d and the files in /etc/udev/rules.d override what's in /lib (this is still described in CHANGES_AND_HINTS.TXT): maybe your problem is related to this... (EDIT: ok, I read your edit and you can ignore this last paragraph)

czezz 04-23-2013 10:29 AM

Hi, thanks for quick reply.
Im just reading that link to CHANGES_AND_HINTS.TXT. Useful.
I think that putting file with exact name into /etc/udev/rules.d/ will overwrite defaults in /lib/udev/rules.d/

My problem is that file /etc/udev/rules.d/70-persistent-net.rules was never created for me.
My udev version:
Code:

root@slacx:~# ls -al /var/log/packages/ | grep udev
-rw-r--r--  1 root root    6128 Apr 19 17:00 udev-182-i486-5

How the heck my network works then ???

czezz 04-24-2013 06:25 AM

I have removed udev package and installed it once again (form Slackware 14 DVD) and no changes ;(

Code:

# ls -al /etc/udev/rules.d/
total 16
drwxr-xr-x 2 root root 4096 Apr 24 12:26 ./
drwxr-xr-x 3 root root 4096 Sep 10  2012 ../
-rw-r--r-- 1 root root  543 Jun  2  2011 70-persistent-cd.rules
-rw-r--r-- 1 root root  341 Apr 23 16:17 99-vmware-scsi-udev.rules


onebuck 04-24-2013 07:48 AM

Member Response
 
Hi,

My /etc/udev/rules.d/70-persistent-net.rules
Code:

# PCI device 0x10ec:/sys/devices/pci0000:00/0000:00:1c.5/0000:0a:00.0 (r8169)
SUBSYSTEM=="net", ACTION=="add", DRIVERS=="?*", ATTR{address}=="84:8f:69:c4:6a:e2", ATTR{dev_id}=="0x0", ATTR{type}=="1", KERNEL=="eth*", NAME="eth0"

# PCI device 0x8086:/sys/devices/pci0000:00/0000:00:1c.1/0000:03:00.0 (iwlwifi)
SUBSYSTEM=="net", ACTION=="add", DRIVERS=="?*", ATTR{address}=="58:91:cf:5c:3b:04", ATTR{dev_id}=="0x0", ATTR{type}=="1", KERNEL=="wlan*", NAME="wlan0"

excerpt from CHANGES_AND_HINTS.TXT
Quote:

As with 13.37, 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. 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 (or just remove them and reboot to create new ones).
If you are upgrading (as opposed to a new install), there are some stale files in /etc/modprobe.d/ that you will need to remove: blacklist.conf, bluetooth.conf, isapnp.conf, psmouse.conf, and usb-controller.conf See /etc/modprobe.d/README for a more detailed explanation.
Please note the underlined statement above.

If you look at '/lib/udev/rules.d/75-persistent-net-generator.rules' & '/lib/udev/write_net_rules' to see where the device rules for net devices are generated from initially or when changes are made to the system.

Since you say that this is a upgrade, I would also look at /etc/modprobe.d/ to be sure nothing is stale there or misconfiguration by upgrade.

The '/etc/udev/rules.d/70-persistent-net.rules' are generated by '/lib/udev/rules.d/75-persistent-net-generator.rules' & '/lib/udev/write_net_rules' at initial boot or whenever changes have been made to the system.

Quote:

excerpt from '/lib/udev/write_net_rules'
#!/bin/sh -e

# This script is run to create persistent network device naming rules
# based on properties of the device.
# If the interface needs to be renamed, INTERFACE_NEW=<name> will be printed
# on stdout to allow udev to IMPORT it.

czezz 04-25-2013 07:59 AM

Hello onebuck,
thank you for reply and nice explanations.

I did a simple experiment - I added a new NIC to my system. Rebooted and still missing /etc/udev/rules.d/70-persistent-net.rules.
It makes me little bit wondering why both NICs are detected and network configuration works ?

No clue what is happening in my system since upgrade :(

onebuck 04-25-2013 10:32 AM

Member Response
 
Hi,

Several ways to troubleshoot the problem. You can do a find or locate for '70-persistent-net.rules'.

Or you could create a empty file to echo too by 'touch /root/test-70-net'. Then place a 'echo "Test message" >> /root/test-70-net' by edit '/lib/udev/write_net_rules' and place;

Code:

#test 04-25-13 gws test
echo "test was reached" >>/root/test-70-net #<< place this line in file at this point above the following line

RULES_FILE='/etc/udev/rules.d/70-persistent-net.rules'

Then just reboot and see if you are even attempting to re-write the rules file '70-persistent-net.rules'. If you do not get a message in the '/root/test-70-net' file then 'udev' does have a persistent file or flagged as such.

One other thought; what do you see in '/etc/udev'? Be sure you do not have any rules files in '/etc/udev' except
'/etc/udev/udev.conf'.

Plus check '/etc/udev/udev.conf' for any unnecessary/errant options;
Quote:

My 'udev.conf' by cat /etc/udev/udev.conf
# udev.conf
# The main config file for udev
#
# This file can be used to override some of udev's default values for where it
# looks for files, and where it places device nodes.

# udev_root - where in the filesystem to place the device nodes
udev_root="/dev/"

# udev_log - The initial syslog(3) priority: "err", "info", "debug" or
# its numerical equivalent. For runtime debugging, the daemons
# internal state can be changed with: udevadm control log_priority=<value>
udev_log="err"
Hope this helps.

ponce 04-25-2013 10:40 AM

Quote:

Originally Posted by ponce (Post 4937277)
CHANGES_AND_HINTS.TXT (that you should read together with UPGRADE.TXT when upgrading)

see also if you missed some of the necessary upgrading steps indicated in the two files (read the two from top to bottom).

czezz 04-26-2013 10:46 AM

Hi onebuck,


I did your tests but unfortunately all of them failed ;(.

1. find for 70-persistent-net.rules gives no result
Code:

root@slacx:~# find /lib -name 70-persistent-net.rules
root@slacx:~# find /etc -name 70-persistent-net.rules

2. Added entry to /lib/udev/write_net_rules. That failed too. After reboot /root/test-70-net is still empty.
3. /etc/udev contains /etc/udev/udev.conf only
4. /etc/udev/udev.conf is exactly like you presented

Im little bit worried about test 2. If that faild then it simply means that /lib/udev/write_net_rules is not executed... how can it be when during booting I can see: http://imageshack.us/photo/my-images...426093958.png/

onebuck 04-26-2013 02:08 PM

Member Response
 
Hi,

Do you have a '/etc/rc.d/rc.netdevice' by chance from earlier 13.37 placement or earlier upgrades?

czezz 04-29-2013 02:18 AM

Hmm... not in the current upgraded system:
Code:

root@slacx:~# ls -al /etc/rc.d/rc.n*
-rw-r--r-- 1 root root 1669 Aug 15  2012 /etc/rc.d/rc.networkmanager
-rw-r--r-- 1 root root 2449 Mar 22  2011 /etc/rc.d/rc.nfsd
-rw-r--r-- 1 root root  804 Jan 26  2011 /etc/rc.d/rc.ntpd

If that file is needed I can checked in the backup of 13.37.

onebuck 04-29-2013 07:40 AM

Member Response
 
Hi,

The '/etc/rc.d/rc.networkdevice' should not be created for a new install. As a user you can still create that file. I just queried to see if by chance you had the file and forgot about it since you said this was a upgrade.


All times are GMT -5. The time now is 05:19 AM.