diff --git a/runtime/webdav-warmup-dispatch.php b/runtime/webdav-warmup-dispatch.php new file mode 100644 index 0000000..b996c84 --- /dev/null +++ b/runtime/webdav-warmup-dispatch.php @@ -0,0 +1,105 @@ +&1', $output, $exit); + foreach ($output as $line) fwrite(STDOUT, $line."\n"); + if ($exit !== 0) $result = $exit; + } + else + { + $command = 'nohup '.$base.' >> '.escapeshellarg($log).' 2>&1 < /dev/null & echo $!'; + $output = array(); + $exit = 1; + @exec($command, $output, $exit); + $pid = isset($output[0]) ? (int)$output[0] : 0; + if ($exit !== 0 || $pid <= 0) + { + fwrite(STDERR, "Warmup für Verbindung #{$connection_id} konnte nicht gestartet werden.\n"); + $result = 1; + continue; + } + $started++; + fwrite(STDOUT, "Warmup {$mode} für Verbindung #{$connection_id} gestartet (PID {$pid}).\n"); + } +} + +if (!$wait) fwrite(STDOUT, "Gestartete Warmup-Prozesse: {$started}.\n"); +exit($result);