Re: [systemd-devel] networkd-218 seems to ignore .link files

2015-04-20 Thread Andrew Cooks
On Tue, Apr 21, 2015 at 12:40 AM, Lennart Poettering lenn...@poettering.net
 wrote:

 On Wed, 15.04.15 01:08, Andrew Cooks (aco...@linux.com) wrote:

  On Tue, Jan 13, 2015 at 6:46 AM, Jan Engelhardt jeng...@inai.de wrote:
 
  
   On Monday 2015-01-12 18:29, Tom Gundersen wrote:
In systemd-218, I have configured the following testcase:
   
/etc/systemd/network# ls -al
total 20
drwxr-xr-x 2 root root 4096 Jan 11 18:14 .
drwxr-xr-x 5 root root 4096 Jan 11 16:23 ..
-rw-r--r-- 1 root root   96 Jan 11 18:14 99a-ether.link
   
   Hm, isn't this just a problem of 99a-ether.link being ordered after
   99-default.link?
  
   Well, the manpage states: All link files are collectively
   sorted and processed in lexical order, with that, I would assume
   that 99a, being processed after 99, would override 99.
  
   It works for me when naming it 98-ether.link instead.
  
   Not in my case. I have a feeling networkd won't touch
   [08:00:27:0a:c5:b2]'s interface name because it has already
   been named by udev to enp0s3 before networkd got a chance to run.
   Could that be it?

 Note that networkd doesn't rename interfaces, only udev does.

 udev implements .link processing, nothing else.

  I'm having a similar problem while running systemd version-219. Did you
  work out what was wrong?

 Maybe this is debian and the saving of interface names is still in
 place?


Nope, sorry, this is based on yocto. The good news is that all legacy stuff
can be safely ignored.



  # cat /etc/systemd/network/01-mgmt.link
  [Match]
  Path=pci-:01:00.0
  Type=ether
 
  [Link]
  Name=mgmt
  MACAddressPolicy=persistent

 Consider testing the .link file with udevadm test-builtin
 net_setup_link...


Thanks, this is exactly what I needed to find the problem.

There were two issues with my .link file:
I needed to call my local override 100-mgmt.link instead of 01-mgmt.link.
IMHO, the ordering of the .link files is somewhat unfortunate, even though
the documentation did try to explain it.

Secondly, the Path in the [Match] section was wrong. The examples use
pci-:xx:yy.0-* and 'udevadm info /sys/class/net/enp1s0' shows
'ID_PATH=pci-:01:00.0' (exactly what I used, as the man page
instructs), but it only started working when I tried 'Path=*:01:00.0*'.

# udevadm test-builtin net_setup_link /sys/class/net/enp1s0
calling: test-builtin
=== trie on-disk ===
tool version:  219
file size: 6685604 bytes
header size 80 bytes
strings1715076 bytes
nodes  4970448 bytes
Load module index
timestamp of '/etc/systemd/network' changed
Parsed configuration file /etc/systemd/network/enp3s0.link
Parsed configuration file /etc/systemd/network/enp2s0.link
Parsed configuration file /lib/systemd/network/99-default.link
Parsed configuration file /etc/systemd/network/100-mgmt.link
Created link configuration context.
device 0xb77f6040 has devpath
'/devices/pci:00/:00:04.0/:01:00.0/ne'
ID_NET_DRIVER=r8169
device 0xb77f6040 filled with db file data
device 0xb77f6940 has devpath
'/devices/pci:00/:00:04.0/:01:00.0'
Config file /lib/systemd/network/99-default.link applies to device enp1s0
ID_NET_LINK_FILE=/lib/systemd/network/99-default.link
Unload module index
Unloaded link configuration context.


# cat 100-mgmt.link
[Match]
Path=*:01:00.0*

[Link]
Name=ManagementPort
MACAddressPolicy=persistent



Thanks for the help, Lennart!

a.
___
systemd-devel mailing list
systemd-devel@lists.freedesktop.org
http://lists.freedesktop.org/mailman/listinfo/systemd-devel


Re: [systemd-devel] networkd-218 seems to ignore .link files

2015-04-14 Thread Andrew Cooks
On Tue, Jan 13, 2015 at 6:46 AM, Jan Engelhardt jeng...@inai.de wrote:


 On Monday 2015-01-12 18:29, Tom Gundersen wrote:
  In systemd-218, I have configured the following testcase:
 
  /etc/systemd/network# ls -al
  total 20
  drwxr-xr-x 2 root root 4096 Jan 11 18:14 .
  drwxr-xr-x 5 root root 4096 Jan 11 16:23 ..
  -rw-r--r-- 1 root root   96 Jan 11 18:14 99a-ether.link
 
 Hm, isn't this just a problem of 99a-ether.link being ordered after
 99-default.link?

 Well, the manpage states: All link files are collectively
 sorted and processed in lexical order, with that, I would assume
 that 99a, being processed after 99, would override 99.

 It works for me when naming it 98-ether.link instead.

 Not in my case. I have a feeling networkd won't touch
 [08:00:27:0a:c5:b2]'s interface name because it has already
 been named by udev to enp0s3 before networkd got a chance to run.
 Could that be it?


I'm having a similar problem while running systemd version-219. Did you
work out what was wrong?

My link file is ignored even when I symlink
/etc/systemd/network/99-default.link to /dev/null. I don't see anything
interesting in 'journalctl'.

# udevadm info /sys/class/net/eth0
P: /devices/pci:00/:00:04.0/:01:00.0/net/eth0
E: DEVPATH=/devices/pci:00/:00:04.0/:01:00.0/net/eth0
E: ID_BUS=pci
E: ID_MODEL_FROM_DATABASE=RTL8111/8168/8411 PCI Express Gigabit Ethernet
Contror
E: ID_MODEL_ID=0x8168
E: ID_NET_DRIVER=r8169
E: ID_NET_NAME_MAC=enx000db936008c
E: ID_NET_NAME_PATH=enp1s0
E: ID_OUI_FROM_DATABASE=PC Engines GmbH
E: ID_PATH=pci-:01:00.0
E: ID_PATH_TAG=pci-_01_00_0
E: ID_PCI_CLASS_FROM_DATABASE=Network controller
E: ID_PCI_SUBCLASS_FROM_DATABASE=Ethernet controller
E: ID_VENDOR_FROM_DATABASE=Realtek Semiconductor Co., Ltd.
E: ID_VENDOR_ID=0x10ec
E: IFINDEX=3
E: INTERFACE=eth0
E: SUBSYSTEM=net
E: SYSTEMD_ALIAS=/sys/subsystem/net/devices/eth0
E: TAGS=:systemd:
E: USEC_INITIALIZED=53326


# networkctl status --no-pager eth0
��● 3: eth0
   Link File: n/a
Network File: n/a
Type: ether
   State: off (unmanaged)
Path: pci-:01:00.0
  Driver: r8169
  Vendor: Realtek Semiconductor Co., Ltd.
   Model: RTL8111/8168/8411 PCI Express Gigabit Ethernet Controller
  HW Address: 00:0d:b9:36:00:8c (PC Engines GmbH)
 MTU: 1500


# cat /etc/systemd/network/01-mgmt.link
[Match]
Path=pci-:01:00.0
Type=ether

[Link]
Name=mgmt
MACAddressPolicy=persistent
___
systemd-devel mailing list
systemd-devel@lists.freedesktop.org
http://lists.freedesktop.org/mailman/listinfo/systemd-devel