Currently, iproute2 is called in two ways on linux:
- via
routeCommand (on Linux that is set to = "/sbin/ip")
- and via path-lookup (
shell.Exec(log, "ip", ...), in daemon/vpn/wireguard/wireguard_linux.go and daemon/v2r/v2ray_linux.go)
If ip is not in PATH but is present in /sbin/, this can cause confusing errors where it finds ip in some cases but not others.
This is a very niche issue, but we encountered this specific issue in the Nix packaging of ivpn, where we have to patch in a hardcoded path to the ip command (because standard FHS paths don't exist in Nix), while the PATH is kept very minimal. See here for more context: NixOS/nixpkgs#474377
I'd propose either changing all the path-lookups to use /sbin/ instead, or use routeCommand and introduce a second one for ip link (as used in wireguard_linux.go)
Currently, iproute2 is called in two ways on linux:
routeCommand(on Linux that is set to= "/sbin/ip")shell.Exec(log, "ip", ...), indaemon/vpn/wireguard/wireguard_linux.goanddaemon/v2r/v2ray_linux.go)If
ipis not in PATH but is present in/sbin/, this can cause confusing errors where it findsipin some cases but not others.This is a very niche issue, but we encountered this specific issue in the Nix packaging of ivpn, where we have to patch in a hardcoded path to the
ipcommand (because standard FHS paths don't exist in Nix), while the PATH is kept very minimal. See here for more context: NixOS/nixpkgs#474377I'd propose either changing all the path-lookups to use
/sbin/instead, or userouteCommandand introduce a second one forip link(as used inwireguard_linux.go)