From 029d959d519ced840f057eca02bf6cc4475688e1 Mon Sep 17 00:00:00 2001 From: boban Date: Sun, 26 Apr 2026 21:00:33 +0200 Subject: [PATCH] Fix: ClamAV enable via Queue Job statt shell_exec im Web-Request MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit nohup/shell_exec wird von PHP-FPM-Prozessgroup nach Request-Ende gekillt. ClamavEnable Job läuft im Queue-Worker und blockiert nicht den Web-Request. Co-Authored-By: Claude Sonnet 4.6 --- app/Jobs/ClamavEnable.php | 25 ++++++++++++++++++++++ app/Livewire/Ui/Security/ClamavManager.php | 3 ++- 2 files changed, 27 insertions(+), 1 deletion(-) create mode 100644 app/Jobs/ClamavEnable.php diff --git a/app/Jobs/ClamavEnable.php b/app/Jobs/ClamavEnable.php new file mode 100644 index 0000000..d380d68 --- /dev/null +++ b/app/Jobs/ClamavEnable.php @@ -0,0 +1,25 @@ +&1', $out, $rc); + \Log::info('ClamavEnable job', ['rc' => $rc, 'out' => $out]); + if ($rc !== 0) { + throw new \RuntimeException('mailwolt-clamav enable failed (rc=' . $rc . '): ' . implode(' ', $out)); + } + } +} diff --git a/app/Livewire/Ui/Security/ClamavManager.php b/app/Livewire/Ui/Security/ClamavManager.php index 834ecb4..0197880 100644 --- a/app/Livewire/Ui/Security/ClamavManager.php +++ b/app/Livewire/Ui/Security/ClamavManager.php @@ -2,6 +2,7 @@ namespace App\Livewire\Ui\Security; +use App\Jobs\ClamavEnable; use Livewire\Attributes\Layout; use Livewire\Attributes\Title; use Livewire\Component; @@ -55,7 +56,7 @@ class ClamavManager extends Component { $this->lastError = ''; $this->lastSuccess = ''; - @shell_exec('nohup sudo -n /usr/local/sbin/mailwolt-clamav enable /tmp/mw-clamav-start.log 2>&1 &'); + ClamavEnable::dispatch(); $this->enabled = true; $this->lastSuccess = 'ClamAV wird gestartet… Dies kann bis zu 60 Sekunden dauern. Klicken Sie danach auf „Aktualisieren".'; }