Redis fails to start on OpenSuse Leap 42.1 after upgrade

tftd asked:

I decided to upgrade a machine running 13.2 to the latest Leap 42.1. I started the process and it did the upgrade. After the reboot everything is working except for the redis server service. I can’t start the redis service using:

# service redis start

The status is:

# service redis status - Redis target allowing to start/stop all [email protected] instances at once
   Loaded: loaded (/usr/lib/systemd/system/; static)
   Active: active since Fri 2015-11-20 03:47:07 EET; 1s ago

Although it says it’s “active”, when I check if the process is running it’s actually not:

# ps ax | grep -i redis
20892 pts/0    S+     0:00 grep -i redis

The only way I can start the redis server is by manually running:

# redis-server /etc/redis/default.conf

which starts the server without any problems.

I’ve tried to reinstall the redis package and tried to change the vendor from the “official” to “server:database” repository. None of these seem to be fixing the issue.

My default.conf file is pretty much the “default” template which only has these changed:

daemonize yes #default is no
bind #default is

The service files:

Description=Redis target allowing to start/stop all [email protected] instances at once

/usr/lib/systemd/system/[email protected]

ExecStart=/usr/sbin/redis-server /etc/redis/%i.conf

#ExecStart=/usr/sbin/openvpn --daemon --suppress-timestamps --writepid /var/run/openvpn/ --cd /etc/openvpn/ --config %i.conf
#ExecReload=/sbin/killproc -p /var/run/openvpn/ -HUP /usr/sbin/openvpn


Any ideas what has changed from 13.2 to 42.1 and why has the service stopped working? Also I don’t seem to recall how I previously had the redis listed in chkconfig – after the upgrade it’s gone from there, although I’m not quite sure that’s part of the problem.

Here is the log file thanks to @Michael Hampton:

9042:signal-handler (1448036091) Received SIGTERM scheduling shutdown...
           _.-``__ ''-._
      _.-``    `.  `_.  ''-._           Redis 3.0.4 (00000000/0) 64 bit
  .-`` .-```.  ```\/    _.,_ ''-._
 (    '      ,       .-`  | `,    )     Running in standalone mode
 |`-._`-...-` __...-.``-._|'` _.-'|     Port: 6379
 |    `-._   `._    /     _.-'    |     PID: 9042
  `-._    `-._  `-./  _.-'    _.-'
 |`-._`-._    `-.__.-'    _.-'_.-'|
 |    `-._`-._        _.-'_.-'    | 
  `-._    `-._`-.__.-'_.-'    _.-'
 |`-._`-._    `-.__.-'    _.-'_.-'|
 |    `-._`-._        _.-'_.-'    |
  `-._    `-._`-.__.-'_.-'    _.-'
      `-._    `-.__.-'    _.-'
          `-._        _.-'

9042:M 20 Nov 18:14:51.090 # Server started, Redis version 3.0.4
9042:M 20 Nov 18:14:51.091 * DB loaded from disk: 0.000 seconds
9042:M 20 Nov 18:14:51.091 * The server is now ready to accept connections on port 6379
9042:M 20 Nov 18:14:51.091 # User requested shutdown...
9042:M 20 Nov 18:14:51.091 * Saving the final RDB snapshot before exiting.
9042:M 20 Nov 18:14:51.126 * DB saved on disk
9042:M 20 Nov 18:14:51.126 * Removing the pid file.
9042:M 20 Nov 18:14:51.126 # Redis is now ready to exit, bye bye...

I’m not sure why it decides to spontaneously just quit due to “user requested shutdown”.

My answer:

This is a systemd unit which is capable of instantiating multiple copies of a server with different configurations.

To use it, specify the name of the instance you want to use. For instance, your existing configuration seems to have the name default:

systemctl enable [email protected]
systemctl start [email protected]

You will probably have to change the /etc/redis/default.conf so that it writes the pidfile in the location that systemd expects.

pidfile /var/run/redis/

View the full question and any other answers on Server Fault.

Creative Commons License
This work is licensed under a Creative Commons Attribution-ShareAlike 3.0 Unported License.