[Unit] Description=Redis Server Documentation=https://redis.io/documentation After=network.target [Service] User=redis Group=redis Environment="R_OPTIONS= /etc/redis.conf" ExecStart=/usr/bin/redisd $R_OPTIONS ExecStartPre=/usr/bin/mkdir -p /var/run/redis ExecStartPre=/usr/bin/chown redis:redis /var/run/redis ExecStartPre=/usr/bin/chmod 0755 /var/run/redis Type=forking PIDFile=/var/run/redis/redis_6379.pid # Disable service start and stop timeout logic of systemd for mysqld service. TimeoutSec=0 # Execute pre and post scripts as root PermissionsStartOnly=true Restart=on-failure RestartPreventExitStatus=1 [Install] WantedBy=multi-user.target