File tree Expand file tree Collapse file tree 1 file changed +14
-2
lines changed Expand file tree Collapse file tree 1 file changed +14
-2
lines changed Original file line number Diff line number Diff line change @@ -174,10 +174,10 @@ Listeners receive a
174174 use Symfony\Component\Console\Event\ConsoleSignalEvent;
175175
176176 $dispatcher->addListener(ConsoleEvents::SIGNAL, function (ConsoleSignalEvent $event) {
177-
177+
178178 // gets the signal number
179179 $signal = $event->getHandlingSignal();
180-
180+
181181 if (\SIGINT === $signal) {
182182 echo "bye bye!";
183183 }
@@ -218,6 +218,18 @@ handle signals themselves. To do so, implement the
218218 }
219219 }
220220
221+ It is your responsibility to handle signals that are relevant to you (even
222+ ``SIGKILL ``, ``SIGTERM ``, etc). This allows you to ignore them or do tasks
223+ before terminating the process for example. This behavior is intended, as
224+ it leaves more flexibility to developers to handle each type of signal the
225+ way they want to.
226+
227+ .. deprecated :: 6.3
228+
229+ In Symfony versions previous to 6.3, all signals (except from ``SIGUSR1 `` and
230+ ``SIGUSR2 ``) would terminate the script by calling ``exit(0) ``. From Symfony 6.3,
231+ no more signal is automatically calling ``exit(0) ``.
232+
221233.. _`reserved exit codes` : https://www.tldp.org/LDP/abs/html/exitcodes.html
222234.. _`Signals` : https://en.wikipedia.org/wiki/Signal_(IPC)
223235.. _`constants of the PCNTL PHP extension` : https://www.php.net/manual/en/pcntl.constants.php
You can’t perform that action at this time.
0 commit comments