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:
@@ -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]);
|
||||
|
||||
Reference in New Issue
Block a user