From beb84b4936c70a644bc4bfa4a0902ee97e68713e Mon Sep 17 00:00:00 2001 From: joshsiv-mulga Date: Fri, 15 May 2026 09:55:34 +1000 Subject: [PATCH] fix(daemon): detect OVN pid file location at runtime Trixie OVN moved the pid/socket to /var/run/ovn/; older installs use /var/run/openvswitch/. Probe which exists so the same binary works on both layouts. --- spinifex/daemon/network.go | 10 ++++++++-- 1 file changed, 8 insertions(+), 2 deletions(-) diff --git a/spinifex/daemon/network.go b/spinifex/daemon/network.go index 6fed3bfd9..c92887fd2 100644 --- a/spinifex/daemon/network.go +++ b/spinifex/daemon/network.go @@ -157,8 +157,14 @@ func CheckOVNHealth() OVNHealthStatus { status.BrIntExists = true } - // Check ovn-controller is running via ovs-appctl (more reliable than pgrep) - if out, err := sudoCommand("ovs-appctl", "-t", "ovn-controller", "version").CombinedOutput(); err == nil && len(out) > 0 { + // Check ovn-controller is running via ovs-appctl. Trixie OVN moved the + // pid file to /var/run/ovn/; older installs use /var/run/openvswitch/. + // Probe at runtime so the same binary works on both layouts. + ovnTarget := "ovn-controller" + if _, err := os.Stat("/var/run/ovn/ovn-controller.pid"); err == nil { + ovnTarget = "/var/run/ovn/ovn-controller" + } + if out, err := sudoCommand("ovs-appctl", "-t", ovnTarget, "version").CombinedOutput(); err == nil && len(out) > 0 { status.OVNControllerUp = true }