Stop signalling on the strength of a stat file alone
A job killed hard never corrects its own record, so 'running' outlives the process and the pid can since belong to something else; array-start jobs get setsid too, so Stop can reach past their direct children.
This commit is contained in:
@@ -13,6 +13,8 @@ foreach (\$s as \$id => \$e) {
|
||||
: SCRIPTS_DIR . '/' . \$id;
|
||||
if (!file_exists(\$script)) continue;
|
||||
\$flags = !empty(\$e['log_enabled']) ? ' --log' : '';
|
||||
exec('nohup bash ' . escapeshellarg(\$runner) . ' ' . escapeshellarg(\$id) . ' ' . escapeshellarg(\$script) . \$flags . ' > /dev/null 2>&1 &');
|
||||
// setsid for the same reason as api/run.php: the job must lead its own process group or
|
||||
// api/stop.php cannot signal the tree, only the parent and its direct children.
|
||||
exec('setsid nohup bash ' . escapeshellarg(\$runner) . ' ' . escapeshellarg(\$id) . ' ' . escapeshellarg(\$script) . \$flags . ' > /dev/null 2>&1 &');
|
||||
}
|
||||
" 2>/dev/null
|
||||
|
||||
Reference in New Issue
Block a user