2

I'm using Arch Linux and I noticed that since I installed memcached the system takes much longer to shut down, I checked and verified that this service was indeed the one which was causing it, because it keeps trying to stop it until it timeouts after one minute and a half.If I try to stop the service while the system is up the same happens, and this appears in the journal:

jun 11 13:54:27 Gawain systemd[1]: Stopping Memcached Daemon...
jun 11 13:55:57 Gawain systemd[1]: memcached.service: State 'stop-sigterm' timed out. Killing.
jun 11 13:55:57 Gawain systemd[1]: memcached.service: Killing process 5372 (memcached) with signal SIGKILL.
jun 11 13:55:57 Gawain systemd[1]: memcached.service: Killing process 5379 (n/a) with signal SIGKILL.
jun 11 13:55:57 Gawain systemd[1]: memcached.service: Killing process 5380 (memcached) with signal SIGKILL.
jun 11 13:55:57 Gawain systemd[1]: memcached.service: Main process exited, code=killed, status=31/SYS
jun 11 13:55:57 Gawain systemd[1]: memcached.service: Failed with result 'timeout'.
jun 11 13:55:57 Gawain systemd[1]: Stopped Memcached Daemon.    
jasonwryan
  • 71,734
  • 34
  • 193
  • 226
user2859982
  • 305
  • 1
  • 2
  • 13
  • There may be something wrong with your systemd unit file for memcached, the posted logs say the regular stop timed out so systemd had to go with the fallback `SIGKILL`. Could you post any associated systemd unit files? I would think something is wrong with the `ExecStop` or `KillSignal` setting, in that it does not actually stop your memcached service. – GracefulRestart Jun 13 '18 at 21:58
  • This is the unit file: https://pastebin.com/LJZQRpsf – user2859982 Jun 13 '18 at 22:02
  • With no specified `ExecStop` or `KillSignal`, the default action of systemd is to send a `SIGTERM` to the process on stop. I was unable to test the `-o modern` option, but when running `memcached` with the rest of your `ExecStart` command, `memcached` shutdown very quickly on `SIGTERM`. – GracefulRestart Jun 13 '18 at 22:43
  • In my case the memcached process stays in state after SIGTERM, and the same happens with systemctl until it is removed from the process table I guess. It happens both with and without `-o modern` – user2859982 Jun 13 '18 at 23:24

0 Answers0