Skip to content

fix(network-legacy): write fallback teamd config to /etc/teamd - #2605

Open
prabhakarpujeri wants to merge 1 commit into
dracut-ng:mainfrom
prabhakarpujeri:fix/network-legacy-teamd-conf-path
Open

fix(network-legacy): write fallback teamd config to /etc/teamd#2605
prabhakarpujeri wants to merge 1 commit into
dracut-ng:mainfrom
prabhakarpujeri:fix/network-legacy-teamd-conf-path

Conversation

@prabhakarpujeri

@prabhakarpujeri prabhakarpujeri commented Aug 18, 2026

Copy link
Copy Markdown

Problem

Booting with team=<master>:<slaves>[:<runner>] on the kernel command line and no host ifcfg TEAM_CONFIG relies on the fallback configuration that modules.d/35network-legacy/parse-team.sh generates. Commit e4483e5 ("Configure the runner for team interfaces") changed the output path of that generated config from /etc/teamd/<master>.conf to /tmp/<master>.conf — but the consumer was never updated: ifup.sh:380 still launches

teamd -d -U -n -N -t <master> -f /etc/teamd/<master>.conf

So the fallback config is written to a location nobody reads. With a real teamd this fails as:

Failed to get absolute path of "/etc/teamd/team0.conf": No such file or directory

teamd exits, the team master is never created, and network boot over a team is broken for the cmdline-only (no host config) case. Setups whose host TEAM_CONFIG was installed into /etc/teamd/ at image build time (module-setup.sh) are unaffected — which is presumably why this went unnoticed since 2020.

Fix

Restore writing the fallback config to /etc/teamd/<master>.conf, matching the consumer in ifup.sh and the pre-e4483e59 behavior. One line changed. The /tmp/team.<master>.info / /tmp/team.<master>.up state files correctly stay in /tmp (they are consumed by ifup.sh directly).

Verification

No CI coverage for this path (the network-legacy BOND/BRIDGE/VLAN tests covering team were removed in 88406ce as always-skipped), so verified manually end-to-end with the real parse-team.sh and the real teamd 1.32 on Fedora 44 in private mount/network namespaces:

===== BEFORE (current master) =====
WARN: Team master team0 specified ... Using activebackup.
--- teamd invocation (same flags as ifup.sh:380):
>>> teamd DEAD, team0 ABSENT. teamd log:
Failed to get absolute path of "/etc/teamd/team0.conf": No such file or directory

===== AFTER (this PR) =====
WARN: Team master team0 specified ... Using activebackup.
>>> teamd RUNNING, team0 device EXISTS. teamdctl state:
setup:
  runner: activebackup
4: team0: <BROADCAST,MULTICAST> mtu 1500 qdisc noop state DOWN ...

(team0 is DOWN only because no ports are enslaved in this minimal test — ifup.sh enslaves the working slaves right after starting teamd. The failing part — loading the config and creating the device with the right runner — works.)

The generated JSON {"runner": {"name": "activebackup"}, "link_watch": {"name": "ethtool"}} is identical in both runs; only its location changes.

@prabhakarpujeri
prabhakarpujeri requested a review from a team as a code owner August 18, 2026 03:45
@github-actions github-actions Bot added modules Issue tracker for all modules network-legacy Issues related to the network-legacy module labels Aug 18, 2026
@devkontrol

devkontrol commented Aug 18, 2026

Copy link
Copy Markdown
Collaborator

CC @aafeijoo-suse @Nowa-Ammerlaan - can you please help with the maintenance of network-legacy and help to review this PR ? Thanks !

@devkontrol

Copy link
Copy Markdown
Collaborator

Context

Part of a bug-review pass over the tree (this is finding H4 there). Same pass produced #2599, #2600 and the analysis behind #2603.

What is the relevance of this section for this PR ?

@prabhakarpujeri

Copy link
Copy Markdown
Author

You're right — that paragraph was leftover from our internal review notes, removed from the description. Thanks for the review.

@prabhakarpujeri
prabhakarpujeri force-pushed the fix/network-legacy-teamd-conf-path branch from f0d1d68 to 21ad78a Compare August 19, 2026 03:51
Commit e4483e5 ("Configure the runner for team interfaces") made
parse-team.sh write the fallback teamd configuration for a kernel cmdline
"team=" specification to /tmp/<teammaster>.conf, but ifup.sh launches

  teamd -d -U -n -N -t <teammaster> -f /etc/teamd/<teammaster>.conf

so for any team= boot that relies on the fallback config (no host
ifcfg TEAM_CONFIG installed into the initramfs) teamd exits with

  Failed to get absolute path of "/etc/teamd/<teammaster>.conf": No such
  file or directory

and the team master never comes up, breaking network boot over team.

Restore writing the fallback config to /etc/teamd/<teammaster>.conf,
matching the consumer in ifup.sh and the pre-e4483e59 behavior. Host
TEAM_CONFIG-based setups are unaffected, and the /tmp/team.<master>.info
and /tmp/team.<master>.up state files still live in /tmp as intended.

Verified by running the real parse-team.sh + real teamd in private
mount/network namespaces:
- before: teamd dies with the error above, team0 is never created
- after: teamd parses the config, starts, and reports
  'setup: runner: activebackup' via teamdctl; ip -d link shows team0
Note: this path has no CI coverage since the network-legacy team test
(BONDBRIDGEVLAN) was removed in 88406ce.
@Nowa-Ammerlaan

Copy link
Copy Markdown
Member

CC @aafeijoo-suse @Nowa-Ammerlaan - can you please help with the maintenance of network-legacy and help to review this PR ? Thanks !

I have no knowledge of teamd, sorry.

@aafeijoo-suse

Copy link
Copy Markdown
Contributor

I have no knowledge of teamd, sorry.

Ditto. Ask @trumbaut why he changed it before assuming the LLM is right.

@prabhakarpujeri

Copy link
Copy Markdown
Author

Fair point — @trumbaut, since e4483e5 moved the fallback path from /etc/teamd/<master>.conf to /tmp/<master>.conf, could you share the original reason? If there was a rationale (e.g. something about /etc not yet being populated), I'd like to capture it here.

For context, the regression evidence posted above is empirical, not just reading code: running the real parse-team.sh and the real teamd 1.32 in sandboxed mount+network namespaces — before: teamd exits with Failed to get absolute path "/etc/teamd/team0.conf": No such file or directory, after: teamd loads the config and teamdctl reports the activebackup runner. The /tmp/team.<master>.info / /tmp/team.<master>.up state files intentionally stay in /tmp; only the config the daemon is launched with moves back to the pre-e4483e59 location.

@devkontrol

Copy link
Copy Markdown
Collaborator

CC @dracut-ng/gentoo-maint @dracut-ng/opensuse-maint

@mwilck

mwilck commented Aug 20, 2026

Copy link
Copy Markdown
Contributor

openSUSE doesn't support teamd any more.

@devkontrol

devkontrol commented Aug 20, 2026

Copy link
Copy Markdown
Collaborator

Booting with team=<master>:<slaves>[:<runner>]

openSUSE doesn't support teamd any more.

Perhaps we should be removing this code than instead of fixing it ? I also do not think we have teamd in any of the CI containers.

@mwilck

mwilck commented Aug 20, 2026

Copy link
Copy Markdown
Contributor

Perhaps we should be removing this code than instead of fixing it ?

I was just talking about openSUSE. I can't speak for other distros. But it seems that the libteam project has been inactive for some time.

@devkontrol

devkontrol commented Aug 20, 2026

Copy link
Copy Markdown
Collaborator

Perhaps we should be removing this code than instead of fixing it ?

I was just talking about openSUSE. I can't speak for other distros. But it seems that the libteam project has been inactive for some time.

Thanks @mwilck . Somehow we need to make a decision on this for the purpose of what is maintained upstream. Many distributions already gave up on network-legacy dracut module completely.

Non-systemd distributions (including Gentoo) and and openSUSE are the top use-cases left as far as I can tell. Many non-systemd distributions do not package teamd (Alpine, Void).

Would be good to hear from Gentoo on this (CC @ConiKost)

@chewi

chewi commented Aug 20, 2026

Copy link
Copy Markdown
Member

Gentoo still has a package for it. It doesn't have a dedicated maintainer, but there's probably little to do on it. I'm not sure if the reporter is actually using it or just fishing for issues with AI. Not that the fix is unwelcome. It's straightforward enough, although I wonder if it should be fixed the other way, with ifup.sh updated to use /tmp instead. Or maybe /run would be better if teamd continues to run after switching root. I don't know anything about teamd either.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

modules Issue tracker for all modules network-legacy Issues related to the network-legacy module

Projects

None yet

Development

Successfully merging this pull request may close these issues.

6 participants