Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

generated network files do not use renamed interface name #6

Closed
rnissl opened this issue Jan 5, 2022 · 6 comments
Closed

generated network files do not use renamed interface name #6

rnissl opened this issue Jan 5, 2022 · 6 comments

Comments

@rnissl
Copy link

rnissl commented Jan 5, 2022

In /etc/udev/rules.d/70-persistent-net.rules I do have entries like this one:
SUBSYSTEM=="net", ACTION=="add", DRIVERS=="?", ATTR{address}=="00:15:5d:85:04:21", ATTR{dev_id}=="0x0", ATTR{type}=="1", KERNEL=="eth", NAME="ext1"

And /usr/lib/udev/rules.d/90-issue-generator.rules contains:
ACTION=="add", SUBSYSTEM=="net", RUN+="/usr/sbin/issue-generator network add $env{INTERFACE}"
ACTION=="remove", SUBSYSTEM=="net", RUN+="/usr/sbin/issue-generator network del $env{INTERFACE}"

The above action "add" will generate a file in /run/issue.d (for example /run/issue.d/70-eth1.conf) which uses the original interface name.

Hence, no interface adresses will be shown as issue.

@thkukuk
Copy link
Owner

thkukuk commented Oct 31, 2022

Our 70-persistent-net.rules looks similar and it works there.
It sounds like you are running in e.g. this bug: systemd/systemd#14935 ?

@rnissl
Copy link
Author

rnissl commented Nov 2, 2022

So shouldn't /usr/lib/udev/rules.d/90-issue-generator.rules then be changed like that:
ACTION=="add", SUBSYSTEM=="net", RUN+="/usr/sbin/issue-generator network add $name"
ACTION=="remove", SUBSYSTEM=="net", RUN+="/usr/sbin/issue-generator network del $name"

This file is part of https://ftp.opensuse.org/distribution/leap/15.3/repo/oss/noarch/issue-generator-1.7-1.17.noarch.rpm and hasn't been changed since 2019-05-05, while https://ftp.opensuse.org/update/leap/15.3/sle/x86_64/dracut-049.1+suse.238.gd8dbb075-150200.3.60.1.x86_64.rpm contains this change:

Wed Sep 29 14:00:00 2021
thomas.blume@suse.com

  • Update to version 049.1+suse.207.g72a93d93:
    • fcoe/fcoe-genrules.sh: use $name instead of $env{INTERFACE} (bsc#1186260)
    • fix: /var/lib/nfs/statd/sm is /var/lib/nfs/sm on SUSE (bsc#1184970)

I'm going to upgrade to Leap 15.4 in January -- would be nice, if the issue could be fixed till then 😉

@thkukuk
Copy link
Owner

thkukuk commented Nov 2, 2022

If you want to get something fixed in a Linux distribution, you have to report that bug against that Linux distribution, and not a random upstream github project and not even mentioning it there...

@thkukuk
Copy link
Owner

thkukuk commented Nov 2, 2022

Since you did report this against this project/code: did you try the current code at all?
Since you have problems with renaming interfaces, I would bet that this code is missing in your version.

@rnissl
Copy link
Author

rnissl commented Nov 2, 2022

The current code works better than the original distributed by Leap 15.3, i. e. it lists the 4 renamed interfaces + the 4 original interfaces eth0 ... eth3 (my adjusted regex is ^[^l]).

Using the original code with $name works as expected. Only the renamed interfaces get listet.

@thkukuk
Copy link
Owner

thkukuk commented Nov 10, 2022

The current version from this project works fine for me in all cases. I assume you did not update the whole code but only the udev rule?
Anyways, your udev rule with the current git code works on Leap for me.

@thkukuk thkukuk closed this as completed Nov 10, 2022
jepio added a commit to flatcar/init that referenced this issue Sep 4, 2023
A user is trying to rename network interfaces. This is working but the login
issue file still has the initial network interface names. This appears to be
similar to thkukuk/issue-generator#6, fix it by using
$name instead of $ENV{INTERACE}, so that the rule runs with a changed name.

Signed-off-by: Jeremi Piotrowski <jpiotrowski@microsoft.com>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants