Redis socket file disappears after reboot

redis

I installed redis and I am setting it to use a socket.

It works fine at the beginning but if I reboot the machine (ubuntu 14.04 via vagrant on virtualbox), Redis does not start anymore and displays this error in the log: Opening socket: bind: No such file or directory

When I look where the socket file is supposed to be, I understand the error message since the socket file is not there anymore.
Actually, the whole /var/run/redis directory does not exist anymore after I reboot.

Here is what I have in my config file:

# Accept connections on the specified port, default is 6379.
# If port 0 is specified Redis will not listen on a TCP socket.
port 0

bind 127.0.0.1

unixsocket /var/run/redis/0.sock
unixsocketperm 755

Why would the socket file disappear?

Thanks

Best Answer

My guess is you are using ubuntu or some distro that mounts /var/run as tmpfs. So each reboot /var/run is cleaned out.

Run mount and if it lists /var/run seperately then that is the case