diff --git a/README.md b/README.md index 9f94ca8..0cfd557 100644 --- a/README.md +++ b/README.md @@ -46,6 +46,7 @@ on [our virtual postcard wall](https://spatie.be/open-source/postcards). This package requires PHP 8 and the [pcntl](https://www.php.net/manual/en/intro.pcntl.php) extensions which is installed in many Unix and Mac systems by default. ❗️ [pcntl](https://www.php.net/manual/en/intro.pcntl.php) only works in CLI processes, not in a web context. +❗️ [posix](https://www.php.net/manual/en/book.posix.php) required for correct handling of process termination for Alpine Linux. ## Installation diff --git a/src/Fork.php b/src/Fork.php index 1bcc2a1..3a841a2 100644 --- a/src/Fork.php +++ b/src/Fork.php @@ -127,6 +127,10 @@ protected function forkForTask(Task $task): Task $this->executeInChildTask($task, $socketToParent); + if (extension_loaded('posix')) { + posix_kill(getmypid(), SIGKILL); + } + exit; }