Files
DnsServer/DnsServerApp/systemd.service
Ingmar Stein e8b6e0d436 feat: Implement graceful shutdown on SIGTERM
Adds a handler for the SIGTERM signal on Linux and macOS to allow the DNS server to shut down gracefully. This is the standard signal sent by `systemd` and Docker to stop a service.

- Updated `DnsServerApp/Program.cs` to handle `PosixSignal.SIGTERM`.
- Removed `KillSignal=SIGINT` from `systemd.service` to use the default `SIGTERM`.
- Removed `STOPSIGNAL SIGINT` from `Dockerfile` to use the default `SIGTERM`.

This ensures that the application has a chance to clean up resources properly before exiting when stopped as a service or container.
2025-11-24 10:58:46 +01:00

14 lines
322 B
Desktop File

[Unit]
Description=Technitium DNS Server
[Service]
WorkingDirectory=/opt/technitium/dns
ExecStart=/usr/bin/dotnet /opt/technitium/dns/DnsServerApp.dll /etc/dns
Restart=always
# Restart service after 10 seconds if the dotnet service crashes:
RestartSec=10
SyslogIdentifier=dns-server
[Install]
WantedBy=multi-user.target