Skip to content

IPaddr2: [findif] fails with "Command line is not complete" when interfaces have altnames or are down #2188

Description

@86-9

On modern Ubuntu installations, the IPaddr2 resource agent fails during validate-all or start with an exit 5 (Not installed) error if there are unlinked/down interfaces or interfaces utilizing altname.

How to reproduce:

  1. Have a network interface with administrative state UP but physical link DOWN (NO-CARRIER).
  2. The interface uses altname (standard in newer systemd/udev naming schemes under Ubuntu).
  3. Call IPaddr2 manually or via Pacemaker probe.

The Root Cause (from bash -x trace):
Inside the find_interface function, the script tries to parse altname attributes:

++++ ip -f inet link show dev
++++ grep altname
Command line is not complete. Try option "help"

Because $iface evaluates to empty at this specific line, the ip command syntax breaks.

Immediately afterwards, the script falls back to a global check instead of a device-specific check:

++ ip -f inet addr show
++ grep -q '[[:space:]]\(DOWN\|LOWERLAYERDOWN\)[[:space:]]'

This causes the agent to falsely report the target interface as down if any other unrelated interface on the system is currently down/unlinked, resulting in a false-positive exit 5.

Suggested Fix:

  1. Quote and safeguard the device check in find_interface:
[ -n "$iface" ] && ip -f inet link show dev "$iface"
  1. Restrict the status check to the actual $nic instead of a global ip addr show:
ip -f inet addr show dev "$nic" | grep -q '[[:space:]]\(DOWN\|LOWERLAYERDOWN\)[[:space:]]'

Best regards, Ingo

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions