Page MenuHomeFeedback Tracker

Linux: No clean shutdown on SIGTERM
New, WishlistPublic


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.


Legacy ID
Dedicated Server
Steps To Reproduce
  1. run the Linux Dedicated Server with
  2. send SIGTERM
  3. watch the process get terminated immediately (due to missing signal handler)
  4. still exists (a process that is instructed to terminate gracefully is usually expected to delete its own pid-file)
Additional Information

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).

Event Timeline

Actium edited Steps To Reproduce. (Show Details)Jan 16 2015, 10:30 PM
Actium edited Additional Information. (Show Details)
Actium set Category to Dedicated Server.
Actium set Reproducibility to Always.
Actium set Severity to None.
Actium set Resolution to Open.
Actium set Legacy ID to 688077154.May 7 2016, 8:06 PM

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.

Actium added a subscriber: Actium.Dec 4 2016, 1:54 PM

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).

Gehock added a subscriber: Gehock.Aug 31 2018, 12:48 PM