Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

"dir" directive in configuration cannot be overriden #6306

Open
eta-orionis opened this issue Aug 6, 2019 · 1 comment
Open

"dir" directive in configuration cannot be overriden #6306

eta-orionis opened this issue Aug 6, 2019 · 1 comment

Comments

@eta-orionis
Copy link

The "dir" directive from redis.conf cannot be overriden by an included file.

Debian 9.9 stretch
Redis server v=3.2.6 sha=00000000:0 malloc=jemalloc-3.6.0 bits=64 build=a2cab475abc2115e

Steps to reproduce:

  1. Install redis from the Debian repository
  2. Stop redis service, mv /var/lib/redis to another path, e.g. /data/redis. (/data is 0755, /data/redis keeps its permissions)
  3. Add local configuration file /etc/redis/local.conf with contents "dir /data/redis"
  4. Add an include line /etc/redis/redis.conf : include /etc/redis/local.conf
  5. Try restarting the service. It will crash and complain that it cannot find /var/lib/redis

Other directives in the local.conf file are respected and will override redis.conf, only "dir" is not respected.

@ptjm
Copy link

ptjm commented Aug 8, 2019

dir changes the working directory of the server. The problem you're having isn't so much that dir can't be overridden as that it takes effect immediately. If you have two dir directives in your config file, the last one will win, but both directories have to exist. Also, any relative paths given in the config file between the two dir directives will be relative to the dir in the first one.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants