I recently moved to Debian 8 "Jessie" which now use systemd and I can't find a way to run multiple redis instances.
I found out there is a
/lib/systemd/system/redis-server.service file to start redis-server on reboot. So I created a new file call
/lib/systemd/system/redis-server-2.service with this content:
[Unit] Description=Advanced key-value store After=network.target [Service] Type=forking ExecStart=/usr/bin/redis-server /etc/redis/redis-2.conf TimeoutStopSec=0 Restart=always User=redis Group=redis [Install] WantedBy=multi-user.target
But when I try to start the service like this:
service redis-server-2 start I get this error:
Job for redis-server-2.service failed. See 'systemctl status redis-server-2.service' and 'journalctl -xn' for details.
systemctl status redis-server-2.service give me:
● redis-server-2.service - Advanced key-value store Loaded: loaded (/lib/systemd/system/redis-server-2.service; disabled) Active: failed (Result: start-limit) since Sat 2015-10-10 11:09:54 CEST; 33s ago Process: 2473 ExecStart=/usr/bin/redis-server /etc/redis/redis-2.conf (code=exited, status=1/FAILURE) Main PID: 2371 (code=exited, status=1/FAILURE) Oct 10 11:09:54 server101 systemd: redis-server-2.service: control process exited, code=exited status=1 Oct 10 11:09:54 server101 systemd: Failed to start Advanced key-value store. Oct 10 11:09:54 server101 systemd: Unit redis-server-2.service entered failed state. Oct 10 11:09:54 server101 systemd: redis-server-2.service start request repeated too quickly, refusing to start. Oct 10 11:09:54 server101 systemd: Failed to start Advanced key-value store. Oct 10 11:09:54 server101 systemd: Unit redis-server-2.service entered failed state.
which is not really helping me.
But if I run
/usr/bin/redis-server /etc/redis/redis-2.conf my redis instance start correctly.
So any idea why systemd don't what to start this instance by itself ?
Thanks in advance for the help.