Skip to content

Commit 1b84910

Browse files
committed
[Console] Handle SIGQUIT signal
As both PHP-FPM and NGINX use SIGQUIT for graceful shutdown, I believe it's necessary PHP applications should also support it. It's especially important in cases where you run PHP application in container running php/nginx image, since they override shutdown signal that docker uses to SIGQUIT, see nginx/docker-nginx@3fb70dd
1 parent ae16627 commit 1b84910

File tree

1 file changed

+2
-2
lines changed

1 file changed

+2
-2
lines changed

Application.php

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -97,7 +97,7 @@ public function __construct(
9797
$this->defaultCommand = 'list';
9898
if (\defined('SIGINT') && SignalRegistry::isSupported()) {
9999
$this->signalRegistry = new SignalRegistry();
100-
$this->signalsToDispatchEvent = [\SIGINT, \SIGTERM, \SIGUSR1, \SIGUSR2];
100+
$this->signalsToDispatchEvent = [\SIGINT, \SIGQUIT, \SIGTERM, \SIGUSR1, \SIGUSR2];
101101
}
102102
}
103103

@@ -984,7 +984,7 @@ protected function doRunCommand(Command $command, InputInterface $input, OutputI
984984
if (Terminal::hasSttyAvailable()) {
985985
$sttyMode = shell_exec('stty -g');
986986

987-
foreach ([\SIGINT, \SIGTERM] as $signal) {
987+
foreach ([\SIGINT, \SIGQUIT, \SIGTERM] as $signal) {
988988
$this->signalRegistry->register($signal, static fn () => shell_exec('stty '.$sttyMode));
989989
}
990990
}

0 commit comments

Comments
 (0)