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
174
174
use Symfony\Component\Console\Event\ConsoleSignalEvent;
175
175
176
176
$dispatcher->addListener(ConsoleEvents::SIGNAL, function (ConsoleSignalEvent $event) {
177
-
177
+
178
178
// gets the signal number
179
179
$signal = $event->getHandlingSignal();
180
-
180
+
181
181
if (\SIGINT === $signal) {
182
182
echo "bye bye!";
183
183
}
@@ -218,6 +218,18 @@ handle signals themselves. To do so, implement the
218
218
}
219
219
}
220
220
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
+
221
233
.. _`reserved exit codes` : https://www.tldp.org/LDP/abs/html/exitcodes.html
222
234
.. _`Signals` : https://en.wikipedia.org/wiki/Signal_(IPC)
223
235
.. _`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