1 (edited by KB7777 2017-05-26 08:27:04)

Topic: Redis systemd problem


After redis installation at CentOS 7 (full update) there is problem with launching redis service.
The proper /etc/systemd/system/multi-user.target.wants/redis.service in my case is:

Description=Redis persistent key-value database

ExecStartPre=-/usr/bin/mkdir /var/run/redis
ExecStartPre=/usr/bin/chown -R :redis /var/run/redis
ExecStartPre=/usr/bin/chmod g+w /var/run/redis
ExecStart=/usr/bin/redis-server /etc/redis.conf --daemonize no


and after every update I had to add this 3 lines with "ExecStartPre".

It is because of /run which is tmpfs -- https://blog.hqcodeshop.fi/archives/93- … stemd.html

Is the default redis systemd configuration from remi repo intended or I have some misconfiguration at my CentOS? smile


Re: Redis systemd problem

1/ never modify system distributed file (/usr/lib/systemd/system/redis.service), this is NOT a configuration file, and thus your change are lost on update

=> use "systemctl edit redis.service" to create a override configuration file

2/ /Var/run/redis is not used by the package, unneeded by default configuration, so not provided

3/ use /etc/tmpfiles.d/xxx.conf to configure needed directory / file, which will be created during boot process

Desktop: Fedora 25 x86_64 + rpmfusion + remi-test + remi-dev
Laptop:  Fedora 24 x86_64 + remi (SCL only)
Hosting Server: CentOS 6.8 x86_64 + EPEL + remi + remi-php70

3 (edited by KB7777 2017-05-29 10:07:26)

Re: Redis systemd problem

Thank you for clarification smile

/etc/tmpfiles.d/redis.conf works fine big_smile