Changelog - 2026-10-25
installShutdownSignals stops the application on SIGTERM and SIGINT
New FeatureIn one line. application.installShutdownSignals() replaces the signal handlers every app wrote by hand: it stops the application and exits when the process is told to end.
typescript
await application.start();
application.installShutdownSignals();What changed
- A new opt-in method on
ServerApplication.installShutdownSignals({ signals?, timeoutMs?, exit? })listens forSIGTERMandSIGINT(or the signals you pass) and callsstop(). - It calls
stop()once. A second signal while it runs is ignored. - It always ends the process. Exit code
0whenstop()finishes,1when it throws or does not finish withintimeoutMs(default15_000). - It is idempotent and reversible. Calling it again returns the same uninstall function and adds no listener; the uninstall function removes the listeners and cancels the pending timeout.
- Core-server only. The kernel gets no process signal handlers.
Who is affected
- Apps with hand-written
SIGTERMandSIGINThandlers. You can replace them. If you keep yours, do not also call this method: both would try to stop the application. - Everyone else. No action needed: nothing is installed unless you call it.