Fix: Revert to using sudo in launcher.php to support visudo configuration
This commit is contained in:
@@ -1755,13 +1755,13 @@ if ($type == "set_cpu_power_mode") {
|
||||
if ($type == "screen_control") {
|
||||
$action = $_GET['action'];
|
||||
if ($action == "start") {
|
||||
// Run as background process without sudo (requires www-data in video group)
|
||||
// Run as background process with sudo (requires nopasswd in sudoers)
|
||||
// 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 &';
|
||||
$command = 'export DISPLAY=:0 && nohup sudo /usr/bin/python3 /var/www/nebuleair_pro_4g/screen_control/screen.py > /tmp/screen_control.log 2>&1 &';
|
||||
shell_exec($command);
|
||||
echo "Started. Check /tmp/screen_control.log for details.";
|
||||
} elseif ($action == "stop") {
|
||||
$command = 'pkill -f "screen.py" 2>&1';
|
||||
$command = 'sudo pkill -f "screen.py" 2>&1';
|
||||
$output = shell_exec($command);
|
||||
echo "Stopped. Output: " . $output;
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user