geerlingguy / ansible-role-redis

Ansible Role - Redis
https://galaxy.ansible.com/geerlingguy/redis/
MIT License
254 stars 197 forks source link

Redis logfile must exists before redis can start #63

Closed jwstric2 closed 2 years ago

jwstric2 commented 3 years ago

This seems to be occurring with the latest packaged versions of remi-redis.

TASK [geerlingguy.redis : Ensure Redis is running and enabled on boot.] ********
fatal: [redis]: FAILED! => {"changed": false, "msg": "Unable to start service redis: Job for redis.service failed because the control process exited with error code. See \"systemctl status redis.service\" and \"journalctl -xe\" for details.\n"}

PLAY RECAP *********************************************************************
redis                      : ok=10   changed=0    unreachable=0  

After evaluating the error, it appears later versions of redis are expecting the logfile to already be created vs creating.

Aug 23 16:01:19 redis systemd[1]: Failed to start Redis persistent key-value database.
-- Subject: Unit redis.service has failed
-- Defined-By: systemd
-- Support: http://lists.freedesktop.org/mailman/listinfo/systemd-devel
-- 
-- Unit redis.service has failed.
-- 
-- The result is failed.
Aug 23 16:01:19 redis redis-server[4310]: *** FATAL CONFIG FILE ERROR ***
Aug 23 16:01:19 redis redis-server[4310]: Reading the configuration file, at line 12
Aug 23 16:01:19 redis redis-server[4310]: >>> 'logfile /var/log/redis/redis-server.log'
Aug 23 16:01:19 redis redis-server[4310]: Can't open the log file: Permission denied
Aug 23 16:01:19 redis systemd[1]: Unit redis.service entered failed state.
Aug 23 16:01:19 redis systemd[1]: redis.service failed.
Aug 23 16:01:19 redis polkitd[330]: Unregistered Authentication Agent for unix-process:4304:20064 (system bus name :1.78, object path /org/freedesktop/Polic
[root@redis ~]# exit
jwstric2 commented 3 years ago

So this PR could be potentially closed, this was an absolute problem on our end. It ended up being part of our os_hardening changed and set /var/log at 750 as owned by root:root, thus this PR would not help anyway. Sorry for the diversion here.

stale[bot] commented 2 years ago

This pull request has been marked 'stale' due to lack of recent activity. If there is no further activity, the PR will be closed in another 30 days. Thank you for your contribution!

Please read this blog post to see the reasons why I mark pull requests as stale.

stale[bot] commented 2 years ago

This pull request has been closed due to inactivity. If you feel this is in error, please reopen the pull request or file a new PR with the relevant details.