The Linux Dedicated Server does not perform a clean shutdown on receiving SIGTERM, but instead gets terminated immediately (according to 'grep SigCgt /proc/PID/status' SIGTERM is not caught). Since SIGTERM is the default termination signal the receiving process is expected to terminate gracefully. If an immediate termination is desired, SIGKILL is to be used instead.
Description
Details
- Legacy ID
- 688077154
- Severity
- None
- Resolution
- Open
- Reproducibility
- Always
- Category
- Dedicated Server
- run the Linux Dedicated Server with -pid=arma3.pid
- send SIGTERM
- watch the process get terminated immediately (due to missing signal handler)
- arma3.pid still exists (a process that is instructed to terminate gracefully is usually expected to delete its own pid-file)
The Linux Dedicated Server already supports graceful termination on receiving SIGINT. So this bug can be easily fixed by using the signal handler that is already in place for SIGINT for SIGTERM as well.
Clients still connected to the server will get a "Session lost" error (on SIGINT) instead of the "No message from server for ... seconds" message (on SIGTERM).
Related Objects
Event Timeline
I would also like to see this bug fixed. The description above already supposes how to easily fix it, as the interrupt signal is used to bring the server down nicely. Just copy the code to catch the termination signal :) This would help in bringing a headless server down by - in my case - pressing the power button.
Almost 2 years later, this issue still persists with the current Linux Dedicated Server version (1.66.139494). Since I manage my servers using systemd, this issue can be mitigated using the KillSignal=SIGINT directive inside the [Service] section, instructing systemd to terminate the process with SIGINT, instead of the default SIGTERM.
Unfortunately, even the SIGINT-triggered graceful shutdown appears to be broken since mid of March 2016, reliably causing a SEGFAULT when terminating (T121812).