0

Redis fails to start every time I start our CentOS 7/openvas server. After the server boots up I can manually start redis without any issues using systemctl start redis.service.

Below are the relevant parts from journalctl

Jan 29 06:29:28 openvas01 systemd[1]: Reached target Network is Online.
Jan 29 06:29:28 openvas01 systemd[1]: Starting Network is Online.
Jan 29 06:29:28 openvas01 systemd[1]: Started Azure Linux Agent.
Jan 29 06:29:28 openvas01 systemd[853]: Failed at step RUNTIME_DIRECTORY spawning /usr/bin/redis-server: File exists
Jan 29 06:29:28 openvas01 systemd[1]: Starting Azure Linux Agent...
Jan 29 06:29:28 openvas01 systemd[1]: Started DNS caching server..
Jan 29 06:29:28 openvas01 systemd[1]: Starting DNS caching server....
Jan 29 06:29:28 openvas01 systemd[1]: redis.service: main process exited, code=exited, status=233/RUNTIME_DIRECTORY
Jan 29 06:29:28 openvas01 systemd[860]: Failed at step RUNTIME_DIRECTORY spawning /usr/libexec/redis-shutdown: File exists
Jan 29 06:29:28 openvas01 systemd[1]: redis.service: control process exited, code=exited status=233
Jan 29 06:29:28 openvas01 systemd[1]: Failed to start Redis persistent key-value database.
Jan 29 06:29:28 openvas01 systemd[1]: Unit redis.service entered failed state.
Jan 29 06:29:28 openvas01 systemd[1]: redis.service failed.

I can't tell which file it is complaining about existing already. The /var/log/redis/redis.log doesn't mention anything about this startup issue so I am thinking that this is related to systemd.

I searched online and didn't find any obvious solutions. The service is not set to start as a daemon and I have supervised systemd in the redis config file.

Any ideas?

1

After some more troubleshooting, I figured out that the /var/run/redis directory was being created by some other process and not the redis systemd service. Further troubleshooting revealed that our server admin had unexpectedly created /etc/tmpfiles.d/redis.conf that was creating the /var/run/redis directory before the service. Deleting this file, which only had this directory in it, addressed the problem.

  • Had a similar issue with the centos/systemd docker image. /var/run/redis already exists, but redis is not installed according to yum. Solution was to rm -rf /var/run/redis then to yum install redis + systemctl enable redis.service – Vigrond Apr 9 at 2:28
0

Try add to config file of systemd service

[Service]
Type=forking
  • Thanks for the response. I just tried this. Same issue. – thebitguru Jan 29 '18 at 15:16

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.