voxpupuli / puppet-redis

Puppet Module to manage Redis
https://forge.puppet.com/puppet/redis
Apache License 2.0
40 stars 183 forks source link

Systemd service stop issues with multiple redis instances #386

Open radarnex opened 3 years ago

radarnex commented 3 years ago

Affected Puppet, Ruby, OS and module versions/distributions

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.

root-expert commented 2 years ago

I think this is fixed by https://github.com/voxpupuli/puppet-redis/commit/b7f7478c4db6f57b2b724e97ae4ad86be8c68338 Can you confirm?