-
Notifications
You must be signed in to change notification settings - Fork 25.1k
Description
Description
The example service definition file uses KillSignal=SIGINT however it does not actually work the way it is described. As the comment for SystemdLifetime says:
systemd only sends SIGTERM to the service process, so we only listen for that signal.
Other signals (ex. SIGINT/SIGQUIT) will be handled by the default .NET runtime signal handler
and won't cause a graceful shutdown of the systemd service.
So what actually happens when using KillSignal=SIGINT is that the ASP.NET Core application is not shutdown gracefully and it leaves resources behind since they are not disposed properly. For example when the application listens on Unix socket then the socket is not deleted when the service ends and cannot be started again since the file already exists.
The next paragraph then suggests
Use TimeoutStopSec to configure the duration of time to wait for the app to shut down after it receives the initial interrupt signal. If the app doesn't shut down in this period, SIGKILL is issued to terminate the app.
however it is not understood how this could even work in light of the above information that SIGINT terminates the application abruptly.
Page URL
Content source URL
https://github.com/dotnet/AspNetCore.Docs/blob/main/aspnetcore/host-and-deploy/linux-nginx.md
Document ID
815fe034-c9fc-aee3-a8b5-f2e860b30302