From 7a856bf6f1015c862395f822d558eacc623eddb9 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Jan=20B=C3=B6hmer?= Date: Mon, 2 Feb 2026 20:37:02 +0100 Subject: [PATCH] Try to emulate nohup behavior on windows --- src/Services/System/UpdateExecutor.php | 29 ++++++++++++++++++-------- 1 file changed, 20 insertions(+), 9 deletions(-) diff --git a/src/Services/System/UpdateExecutor.php b/src/Services/System/UpdateExecutor.php index 9f73c63a..6a40af6e 100644 --- a/src/Services/System/UpdateExecutor.php +++ b/src/Services/System/UpdateExecutor.php @@ -835,15 +835,26 @@ class UpdateExecutor $this->filesystem->mkdir($logDir, 0755); } - // Use nohup to properly detach the process from the web request - // The process will continue running even after the PHP request ends - $command = sprintf( - 'nohup php %s partdb:update %s %s --force --no-interaction >> %s 2>&1 &', - escapeshellarg($consolePath), - escapeshellarg($targetVersion), - $createBackup ? '' : '--no-backup', - escapeshellarg($logFile) - ); + //If we are on Windows, we cannot use nohup + if (PHP_OS_FAMILY === 'Windows') { + $command = sprintf( + 'start /B php %s partdb:update %s %s --force --no-interaction >> %s 2>&1', + escapeshellarg($consolePath), + escapeshellarg($targetVersion), + $createBackup ? '' : '--no-backup', + escapeshellarg($logFile) + ); + } else { //Unix like platforms should be able to use nohup + // Use nohup to properly detach the process from the web request + // The process will continue running even after the PHP request ends + $command = sprintf( + 'nohup php %s partdb:update %s %s --force --no-interaction >> %s 2>&1 &', + escapeshellarg($consolePath), + escapeshellarg($targetVersion), + $createBackup ? '' : '--no-backup', + escapeshellarg($logFile) + ); + } $this->logger->info('Starting background update', [ 'command' => $command,