Bug 2037355

Summary: dracut does not make network configuration available after switchroot
Product: [Fedora] Fedora Reporter: Ian Dall <ian>
Component: dracutAssignee: dracut-maint-list
Status: CLOSED EOL QA Contact: Fedora Extras Quality Assurance <extras-qa>
Severity: unspecified Docs Contact:
Priority: unspecified    
Version: 36CC: dracut-maint-list, jamacku, jonathan, lnykryn, zbyszek
Target Milestone: ---   
Target Release: ---   
Hardware: Unspecified   
OS: Unspecified   
Whiteboard:
Fixed In Version: Doc Type: ---
Doc Text:
Story Points: ---
Clone Of: Environment:
Last Closed: 2023-05-25 15:55:57 UTC Type: Bug
Regression: --- Mount Type: ---
Documentation: --- CRM:
Verified Versions: Category: ---
oVirt Team: --- RHEL 7.3 requirements from Atomic Host:
Cloudforms Team: --- Target Upstream Version:
Embargoed:
Attachments:
Description Flags
dracut config dropin file
none
Patch for network state lost at switch root
none
Sample service unit file to temporarilly enable DNS resolution.
none
Sample service unit file to restore network state information after switchroot.
none
Patch to stash network configurtion for use post switchroot. none

Description Ian Dall 2022-01-05 14:02:20 UTC
Created attachment 1849030 [details]
dracut config dropin file

Description of problem:
When dracut is configured with systemd-network-manegement, the dynamic network configuration is lost at switch-root. During early boot, readonly-root.service may require hostname to be be set and server names to be resolved in order to nfs mount a state volume.

Version-Release number of selected component (if applicable):
dracut-055-6.fc35.x86_64

How reproducible:
Always

Steps to Reproduce:
1.Configure dracut to use system-network-management
2.Build iniramfs
2.In /etc/sysconf/readonly-root set CLIENTSTATE to <server>:<rootpath>
3.Boot systemd.unit=rescue.target
4.In rescue shell type findmnt /var/lib/stateless/state

Actual results:
TARGET                   SOURCE    FSTYPE OPTIONS

(/var/lib/stateless/state is not mounted).

Expected results:

TARGET                   SOURCE    FSTYPE OPTIONS
/var/lib/stateless/state <server>:<path> nfs4 rw

Additional info:

It is very difficult to get systemd-resolved to run pre readonly-root and post pivot because of ordering dependency loops.

Also, the path part of the nfs mount includes the hostname so fixing this depends on bug #2037338 

The proposed solution is to copy /run/systemd/resolve/resolv.conf and /run/systemd/netif to /run/initramfs/state. Then in early boot these can be used to maintain connectivity, eg by copying /run/initramfs/state/systemd/resolved/resolv.conf over /etc/resolv.conf. This is roughly what NetworkManager does if enabled in initrd. I'm not sure that the netif stuff is important, but it might be useful.

Comment 1 Ian Dall 2022-01-05 14:04:49 UTC
Created attachment 1849033 [details]
Patch for network state lost at switch root

Comment 2 Ian Dall 2022-01-05 14:07:57 UTC
Created attachment 1849034 [details]
Sample service unit file to temporarilly enable DNS resolution.

Comment 3 Ian Dall 2022-01-05 14:09:17 UTC
Created attachment 1849035 [details]
Sample service unit file to restore network state information after switchroot.

Comment 4 Ian Dall 2022-11-21 05:47:55 UTC
Created attachment 1926023 [details]
Patch to stash network configurtion for use post switchroot.

As of Fedora36 this is still an issue. This is a simpler patch than the previous one.

Comment 5 Ben Cotton 2022-11-29 17:36:10 UTC
This message is a reminder that Fedora Linux 35 is nearing its end of life.
Fedora will stop maintaining and issuing updates for Fedora Linux 35 on 2022-12-13.
It is Fedora's policy to close all bug reports from releases that are no longer
maintained. At that time this bug will be closed as EOL if it remains open with a
'version' of '35'.

Package Maintainer: If you wish for this bug to remain open because you
plan to fix it in a currently maintained version, change the 'version' 
to a later Fedora Linux version.

Thank you for reporting this issue and we are sorry that we were not 
able to fix it before Fedora Linux 35 is end of life. If you would still like 
to see this bug fixed and are able to reproduce it against a later version 
of Fedora Linux, you are encouraged to change the 'version' to a later version
prior to this bug being closed.

Comment 6 Ian Dall 2022-12-17 11:02:21 UTC
As of fc37 (and perhaps earlier), systemd-networkd is smart enough not to reconfigure "critical" interfaces and this patch is no longer required.

Comment 7 Ben Cotton 2023-04-25 16:47:17 UTC
This message is a reminder that Fedora Linux 36 is nearing its end of life.
Fedora will stop maintaining and issuing updates for Fedora Linux 36 on 2023-05-16.
It is Fedora's policy to close all bug reports from releases that are no longer
maintained. At that time this bug will be closed as EOL if it remains open with a
'version' of '36'.

Package Maintainer: If you wish for this bug to remain open because you
plan to fix it in a currently maintained version, change the 'version' 
to a later Fedora Linux version. Note that the version field may be hidden.
Click the "Show advanced fields" button if you do not see it.

Thank you for reporting this issue and we are sorry that we were not 
able to fix it before Fedora Linux 36 is end of life. If you would still like 
to see this bug fixed and are able to reproduce it against a later version 
of Fedora Linux, you are encouraged to change the 'version' to a later version
prior to this bug being closed.

Comment 8 Ludek Smid 2023-05-25 15:55:57 UTC
Fedora Linux 36 entered end-of-life (EOL) status on 2023-05-16.

Fedora Linux 36 is no longer maintained, which means that it
will not receive any further security or bug fix updates. As a result we
are closing this bug.

If you can reproduce this bug against a currently maintained version of Fedora Linux
please feel free to reopen this bug against that version. Note that the version
field may be hidden. Click the "Show advanced fields" button if you do not see
the version field.

If you are unable to reopen this bug, please file a new report against an
active release.

Thank you for reporting this bug and we are sorry it could not be fixed.