The availability of the socket file for Redis

10 May 2017

When starting the Redis service using Systemd, the problem arises that it is not possible to share .sock file to connect to Redis third-party services in a specific folder, e.g. tmp. 

In the tmp folder is created something like systemd-private-7e30eb90bf024c93b538e4367a4cf8e8-redis-server.service-ToxKaa/tmp.

But it's easy to fix, just 3 steps...

In the file /etc/systemd/system/redis.service find (or use command systemctl edit --full redis-server):

PrivateTmp=yes

and replace to

PrivateTmp=no

Next, add the following line to the same file

ReadWriteDirectories=-/tmp

Finally, restart systemd and redis:

systemctl restart redis-server.service && systemctl daemon-reload
systemctl restart redis