Stop the Stop button from killing the web server

UI-launched jobs inherited php-fpm's process group, so stopping one that was
actually running group-killed the WebGUI; setsid makes the job its own group
leader and stop.php now refuses to signal any group it does not lead.
This commit is contained in:
Gmer4Lfe
2026-08-08 11:09:08 -04:00
parent 228aae31c9
commit 2ab7d3d98a
3 changed files with 44 additions and 12 deletions
+3 -1
View File
@@ -106,6 +106,8 @@ $extraStr = '';
foreach (preg_split('/\s+/', $extra_args, -1, PREG_SPLIT_NO_EMPTY) as $tok) {
$extraStr .= ' ' . escapeshellarg($tok);
}
exec('nohup bash ' . escapeshellarg($runner) . ' ' . escapeshellarg($id) . ' ' . escapeshellarg($script) . ' --dry-run' . ($flags ? " $flags" : '') . ' --manual' . $locArg . $extraStr . ' >> ' . escapeshellarg($logFile) . ' 2>&1 </dev/null &');
// setsid for the same reason as api/run.php — a dry run is stoppable too, and Stop resolves the
// group from the stat file without caring which endpoint started the job.
exec('setsid nohup bash ' . escapeshellarg($runner) . ' ' . escapeshellarg($id) . ' ' . escapeshellarg($script) . ' --dry-run' . ($flags ? " $flags" : '') . ' --manual' . $locArg . $extraStr . ' >> ' . escapeshellarg($logFile) . ' 2>&1 </dev/null &');
echo json_encode(['ok' => true]);