[Bug 2083529] [NEW] networkd-dispatcher: scripts not executed for renamed interfaces
James Dingwall
2083529 at bugs.launchpad.net
Wed Oct 2 15:24:29 UTC 2024
Public bug reported:
With the advent of predictable device naming in systemd then during
system boot interfaces get renamed, e.g. eth0->eno1, eth1->eno6np1 etc.
If a networkd-dispatcher script is testing for a specific renamed
device, e.g. eno6np1, it does not execute. If in each of the
/etc/networkd-dispatcher/... directories we create a log message with
this script:
```
#!/bin/bash
set -eu
STAGE="$(basename "$(dirname "${BASH_SOURCE[0]}")")"
MESSAGE="${STAGE}: ${IFACE} - IP_ADDRS='${IP_ADDRS:-}'
IP6_ADDRS='${IP6_ADDRS:-}'"
/usr/bin/logger -t "[NET-DIS]" -p "local1.INFO" "${MESSAGE}"
```
Then checking syslog gives us:
```
Oct 2 13:47:59 router-00 [NET-DIS]: carrier.d: lo - IP_ADDRS='' IP6_ADDRS='::1'
Oct 2 13:47:59 router-00 [NET-DIS]: off.d: eth0 - IP_ADDRS='' IP6_ADDRS=''
Oct 2 13:47:59 router-00 [NET-DIS]: off.d: eth1 - IP_ADDRS='' IP6_ADDRS=''
Oct 2 13:48:00 router-00 [NET-DIS]: off.d: eth2 - IP_ADDRS='' IP6_ADDRS=''
Oct 2 13:48:00 router-00 [NET-DIS]: off.d: eth3 - IP_ADDRS='' IP6_ADDRS=''
Oct 2 13:48:00 router-00 [NET-DIS]: off.d: eth4 - IP_ADDRS='' IP6_ADDRS=''
Oct 2 13:48:01 router-00 [NET-DIS]: off.d: eth5 - IP_ADDRS='' IP6_ADDRS=''
Oct 2 13:48:01 router-00 [NET-DIS]: off.d: eth6 - IP_ADDRS='' IP6_ADDRS=''
Oct 2 13:48:01 router-00 [NET-DIS]: off.d: eth7 - IP_ADDRS='' IP6_ADDRS=''
Oct 2 13:48:10 router-00 [NET-DIS]: no-carrier.d: drbd - IP_ADDRS='' IP6_ADDRS=''
Oct 2 13:49:59 router-00 [NET-DIS]: configuring.d: eth0 - IP_ADDRS='' IP6_ADDRS=''
Oct 2 13:49:59 router-00 [NET-DIS]: carrier.d: eth0 - IP_ADDRS='' IP6_ADDRS=''
Oct 2 13:49:59 router-00 [NET-DIS]: routable.d: eth0 - IP_ADDRS='' IP6_ADDRS=''
Oct 2 13:50:01 router-00 [NET-DIS]: configured.d: eth0 - IP_ADDRS='' IP6_ADDRS=''
```
There are never any executions using the new name after the interface is
renamed. The expected behaviour is that networkd-dispatcher runs the
scripts again for the predictable name.
# lsb_release -a
No LSB modules are available.
Distributor ID: Ubuntu
Description: Ubuntu 22.04.4 LTS
Release: 22.04
Codename: jammy
# apt-cache policy networkd-dispatcher
networkd-dispatcher:
Installed: 2.1-2ubuntu0.22.04.2
Candidate: 2.1-2ubuntu0.22.04.2
** Affects: networkd-dispatcher (Ubuntu)
Importance: Undecided
Status: New
** Bug watch added: gitlab.com/craftyguy/networkd-dispatcher/-/issues #68
https://gitlab.com/craftyguy/networkd-dispatcher/-/issues/68
--
You received this bug notification because you are a member of Ubuntu
Foundations Bugs, which is subscribed to networkd-dispatcher in Ubuntu.
https://bugs.launchpad.net/bugs/2083529
Title:
networkd-dispatcher: scripts not executed for renamed interfaces
Status in networkd-dispatcher package in Ubuntu:
New
Bug description:
With the advent of predictable device naming in systemd then during
system boot interfaces get renamed, e.g. eth0->eno1, eth1->eno6np1
etc. If a networkd-dispatcher script is testing for a specific
renamed device, e.g. eno6np1, it does not execute. If in each of the
/etc/networkd-dispatcher/... directories we create a log message with
this script:
```
#!/bin/bash
set -eu
STAGE="$(basename "$(dirname "${BASH_SOURCE[0]}")")"
MESSAGE="${STAGE}: ${IFACE} - IP_ADDRS='${IP_ADDRS:-}'
IP6_ADDRS='${IP6_ADDRS:-}'"
/usr/bin/logger -t "[NET-DIS]" -p "local1.INFO" "${MESSAGE}"
```
Then checking syslog gives us:
```
Oct 2 13:47:59 router-00 [NET-DIS]: carrier.d: lo - IP_ADDRS='' IP6_ADDRS='::1'
Oct 2 13:47:59 router-00 [NET-DIS]: off.d: eth0 - IP_ADDRS='' IP6_ADDRS=''
Oct 2 13:47:59 router-00 [NET-DIS]: off.d: eth1 - IP_ADDRS='' IP6_ADDRS=''
Oct 2 13:48:00 router-00 [NET-DIS]: off.d: eth2 - IP_ADDRS='' IP6_ADDRS=''
Oct 2 13:48:00 router-00 [NET-DIS]: off.d: eth3 - IP_ADDRS='' IP6_ADDRS=''
Oct 2 13:48:00 router-00 [NET-DIS]: off.d: eth4 - IP_ADDRS='' IP6_ADDRS=''
Oct 2 13:48:01 router-00 [NET-DIS]: off.d: eth5 - IP_ADDRS='' IP6_ADDRS=''
Oct 2 13:48:01 router-00 [NET-DIS]: off.d: eth6 - IP_ADDRS='' IP6_ADDRS=''
Oct 2 13:48:01 router-00 [NET-DIS]: off.d: eth7 - IP_ADDRS='' IP6_ADDRS=''
Oct 2 13:48:10 router-00 [NET-DIS]: no-carrier.d: drbd - IP_ADDRS='' IP6_ADDRS=''
Oct 2 13:49:59 router-00 [NET-DIS]: configuring.d: eth0 - IP_ADDRS='' IP6_ADDRS=''
Oct 2 13:49:59 router-00 [NET-DIS]: carrier.d: eth0 - IP_ADDRS='' IP6_ADDRS=''
Oct 2 13:49:59 router-00 [NET-DIS]: routable.d: eth0 - IP_ADDRS='' IP6_ADDRS=''
Oct 2 13:50:01 router-00 [NET-DIS]: configured.d: eth0 - IP_ADDRS='' IP6_ADDRS=''
```
There are never any executions using the new name after the interface
is renamed. The expected behaviour is that networkd-dispatcher runs
the scripts again for the predictable name.
# lsb_release -a
No LSB modules are available.
Distributor ID: Ubuntu
Description: Ubuntu 22.04.4 LTS
Release: 22.04
Codename: jammy
# apt-cache policy networkd-dispatcher
networkd-dispatcher:
Installed: 2.1-2ubuntu0.22.04.2
Candidate: 2.1-2ubuntu0.22.04.2
To manage notifications about this bug go to:
https://bugs.launchpad.net/ubuntu/+source/networkd-dispatcher/+bug/2083529/+subscriptions
More information about the foundations-bugs
mailing list