From a208540093595b27e46309ca313e1c8b2e80369b Mon Sep 17 00:00:00 2001 From: PaulVua Date: Tue, 17 Feb 2026 12:54:40 +0100 Subject: [PATCH] Fix: Remove sudo usage in launcher.php to avoid password prompt; enable logging --- html/launcher.php | 9 +++++---- 1 file changed, 5 insertions(+), 4 deletions(-) diff --git a/html/launcher.php b/html/launcher.php index 1f62403..65e3a0d 100755 --- a/html/launcher.php +++ b/html/launcher.php @@ -1755,12 +1755,13 @@ if ($type == "set_cpu_power_mode") { if ($type == "screen_control") { $action = $_GET['action']; if ($action == "start") { - // Run as background process - $command = 'nohup sudo /usr/bin/python3 /var/www/nebuleair_pro_4g/screen_control/screen.py > /dev/null 2>&1 &'; + // Run as background process without sudo (requires www-data in video group) + // Redirecting to a temp log file to debug startup issues + $command = 'export DISPLAY=:0 && nohup /usr/bin/python3 /var/www/nebuleair_pro_4g/screen_control/screen.py > /tmp/screen_control.log 2>&1 &'; shell_exec($command); - echo "Started"; + echo "Started. Check /tmp/screen_control.log for details."; } elseif ($action == "stop") { - $command = 'sudo pkill -f "screen.py" 2>&1'; + $command = 'pkill -f "screen.py" 2>&1'; $output = shell_exec($command); echo "Stopped. Output: " . $output; }