Skip to content

agents: fix lnx_bonding when no bonding interface is configured#900

Open
osedlbauer wants to merge 1 commit intoCheckmk:masterfrom
osedlbauer:fix/agent-bonding-interfaces
Open

agents: fix lnx_bonding when no bonding interface is configured#900
osedlbauer wants to merge 1 commit intoCheckmk:masterfrom
osedlbauer:fix/agent-bonding-interfaces

Conversation

@osedlbauer
Copy link
Copy Markdown

General information

When /proc/net/bonding exists but no bonding interface is configured, head fails with:

head: *: No such file or directory

Fix this by checking if any interfaces exist before running head

Bug reports

  • Any Linux system with kmod-bonding loaded but no bonding interface configured (Tested on newest OpenWrt master)
  • Reproduce: load bonding kernel module without configuring a bonding interface
  • head fails with: head: *: No such file or directory

Proposed changes

  • Observed: head fails when /proc/net/bonding exists but is empty
  • Expected: empty lnx_bonding section without errors
  • Fix: check if interfaces exist before running head

When /proc/net/bonding exists but no bonding interface is configured,
head fails with:

  head: *: No such file or directory

Fix this by checking if any interfaces exist before running head

Signed-off-by: Oliver Sedlbauer <os@dev.tdt.de>
@github-actions
Copy link
Copy Markdown

github-actions Bot commented Mar 13, 2026

All contributors have signed the CLA ✍️ ✅
Posted by the CLA Assistant Lite bot.

@osedlbauer
Copy link
Copy Markdown
Author

I have read the CLA Document and I hereby sign the CLA or my organization already has a signed CLA.

@mo-ki mo-ki self-assigned this Apr 29, 2026
@mo-ki
Copy link
Copy Markdown
Member

mo-ki commented Apr 29, 2026

Hi! just to clarify: This is just to avoid the line written to stderr, right? Or is there any other impact of the failing head?
If so, I would suggest to just add 2>/dev/null; that would be more explicit about the intention IMHO.

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

Labels

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants