puppet-redis icon indicating copy to clipboard operation
puppet-redis copied to clipboard

Systemd service stop issues with multiple redis instances

Open radarnex opened this issue 4 years ago • 1 comments

Affected Puppet, Ruby, OS and module versions/distributions

  • Distribution: Ubuntu
  • Module version: 6.19.0

How to reproduce (e.g Puppet code you use)

Service template contains the parameter RuntimeDirectory which tells systemd to delete the dir when stopped. It was introduced more than 1 year ago (https://github.com/voxpupuli/puppet-redis/commit/8749ce7e52aece238ef1a56a1f2ffa13d4582d37).

If you use multiple redis instances it can cause issues if you stop one of the instances (it'll delete all sockets and pid files inside the dir). In that case, you need to stop all instances and start them again at the same time, otherwise, it'll not work (kind of race condition).

My suggestion would be to add the parameter RuntimeDirectoryPreserve=yes to the service template. The only drawback is that when you stop the service the runtime folder /var/run/redis will not be deleted.

radarnex avatar Jan 20 '21 16:01 radarnex