"No such file or directory" error
when we want to use redis unixsocket it is possible that given path for socket does not exist. in this situation if we start redis-server with given config, error occurred with this message: Opening Unix socket: bind: No such file or directory
To reproduce
Steps to reproduce the behavior and/or a minimal code sample.
you can delete unixsocket path and start to run redis server.
for example change unixsocket path to /var/run/redis/redis.sock and delte /var/run/redis path.
now in redis directory execute this command : src/redis-socket redis.conf
**Expected behavior ** redis most check unixsocket path and check if it does not exist create related path recursively.
Additional information
i created new pull request and push my solution.
Comment From: uhlhosting
I got same issue after upgrades and when using Sockets.
Comment From: yossigo
@uhlhosting Can you please describe the steps you took for this to happen? Did you use some pre-packaged Redis or built and installed it from source?
Comment From: uhlhosting
@yossigo it seems the issue its only when upgrading and using custom .sock settings, the upgrade will overwrite the config in our case thats manually compiled for centos 8 from source.
So the issue how I see it, would be great to avoid file overwrite of current redis config, in that way there wont be any errors.
Comment From: yossigo
@uhlhosting If you're compiling Redis from source and handle the upgrade yourself, you can also avoid overwriting the configuration file no? Maybe I misunderstand something here, but it's basically a process you implement yourself isn't it?
Comment From: coderofsalvation
running sudo mkdir /var/run/redis fixed it for me
Comment From: yossigo
To wrap it up, when using a Unix socket the directory needs to exist and be writable. Anyone who's manually installing has to handle that, and we expect package maintainers to handle that as part of the packaging.
Closing as there's unresolved problem described here.