Network device not always renamed

Asked by eraserix

I try to name 3 network interfaces:
- lan for accessing network
- ecat0/ecat1 is fieldbus and should not be configured by the system

I've setup udev rules that names the devices, but the rule seems subject to racecondition with NetworkManager. The problem seems to be that NetworkManager grabs and ups the devices before udev had a chance to rename them. The journal contains the following errors:

Feb 18 12:57:47 testpc systemd-udevd[329]: error changing net interface name 'eth1' to 'ecat1': Device or resource busy
Feb 18 12:57:47 testpc systemd-udevd[329]: could not rename interface '3' from 'eth1' to 'ecat1': Device or resource busy

This does not happen on every boot. On other systems, I've not yet seen this problem.

My fix will be to manually order NetworkManager after "udev settle".

But: How are udev and NM supposed to work at all without proper synchronization? Or what did I miss that makes udev rules work together with NM?

Question information

Language:
English Edit question
Status:
Expired
For:
Ubuntu Edit question
Assignee:
No assignee Edit question
Last query:
Last reply:
Revision history for this message
actionparsnip (andrew-woodhead666) said :
#1

What is the output of:

lsb_release -a; uname -a

Thanks

Revision history for this message
eraserix (eraserix) said :
#2

Sorry, completely forgotten to provide this info:

$ lsb_release -a; uname -a
No LSB modules are available.
Distributor ID: Ubuntu
Description: Ubuntu 18.04.2 LTS
Release: 18.04
Codename: bionic
Linux ch10dd405 4.9.146-realtime-1-rt125 #1 SMP PREEMPT RT Fri Jan 4 08:00:02 UTC 2019 x86_64 x86_64 x86_64 GNU/Linux

Revision history for this message
eraserix (eraserix) said :
#3

I was unable to reproduce the problem with the stock 4.15 kernel. On my custom 4.9 kernel, its random how many of the 3 devices get renamed by udev.

Revision history for this message
actionparsnip (andrew-woodhead666) said :
#4

Then use the official kernel.....

Revision history for this message
eraserix (eraserix) said :
#5

I cannot use the official kernel because it lacks PREEMPT_RT.

I was hoping for some insight on how this synchronization between udev renaming and NM is supposed to work in the first place. A different kernel does not explain that.

Revision history for this message
Launchpad Janitor (janitor) said :
#6

This question was expired because it remained in the 'Open' state without activity for the last 15 days.