Преглед на файлове

Fix nsenter PATH: nmcli not found in minimal PID 1 environment

Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
tuanchris преди 4 месеца
родител
ревизия
c2d018d432
променени са 1 файла, в които са добавени 4 реда и са изтрити 1 реда
  1. 4 1
      modules/wifi/manager.py

+ 4 - 1
modules/wifi/manager.py

@@ -28,7 +28,10 @@ def run_host_command(*args: str, timeout: int = 30) -> subprocess.CompletedProce
     In venv: executes directly.
     """
     if is_docker():
-        cmd = ["nsenter", "-t", "1", "-m", "-u", "-i", "-n", "-p", "--"] + list(args)
+        # Use env to set PATH because nsenter into PID 1 has a minimal PATH
+        # that may not include /usr/bin where nmcli lives
+        cmd = ["nsenter", "-t", "1", "-m", "-u", "-i", "-n", "-p", "--",
+               "env", "PATH=/usr/local/sbin:/usr/local/bin:/usr/sbin:/usr/bin:/sbin:/bin"] + list(args)
     else:
         cmd = list(args)