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:
- Have a network interface with administrative state
UP but physical link DOWN (NO-CARRIER).
- The interface uses
altname (standard in newer systemd/udev naming schemes under Ubuntu).
- 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:
- Quote and safeguard the device check in
find_interface:
[ -n "$iface" ] && ip -f inet link show dev "$iface"
- 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
On modern Ubuntu installations, the
IPaddr2resource agent fails duringvalidate-allorstartwith anexit 5 (Not installed)error if there are unlinked/down interfaces or interfaces utilizingaltname.How to reproduce:
UPbut physical linkDOWN(NO-CARRIER).altname(standard in newer systemd/udev naming schemes under Ubuntu).IPaddr2manually or via Pacemaker probe.The Root Cause (from
bash -xtrace):Inside the
find_interfacefunction, the script tries to parsealtnameattributes:++++ ip -f inet link show dev ++++ grep altname Command line is not complete. Try option "help"Because
$ifaceevaluates to empty at this specific line, theipcommand 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
downif any other unrelated interface on the system is currently down/unlinked, resulting in a false-positiveexit 5.Suggested Fix:
find_interface:$nicinstead of a globalip addr show:Best regards, Ingo