Answer the question
In order to leave comments, you need to log in
How to make Redis start with the server?
After rebooting the VPS, Redis for some reason does not start. Redis itself works in unixsocket mode, here is its config:
redis.conf: https://pastebin.com/pzsC3PSq
service redis status:
● redis.service - Redis In-Memory Data Store
Loaded: loaded (/etc/systemd/system/redis.service; enabled; vendor preset: enabled)
Active: inactive (dead) (Result: exit-code) since Fri 2017-12-08 09:17:49 UTC; 1min 47s ago
Process: 2646 ExecStart=/usr/local/bin/redis-server /etc/redis/redis.conf (code=exited, status=1/FAILURE)
Main PID: 2523 (code=exited, status=1/FAILURE)
Dec 08 09:17:49 danforth systemd[1]: redis.service: Control process exited, code=exited status=1
Dec 08 09:17:49 danforth systemd[1]: Failed to start Redis In-Memory Data Store.
Dec 08 09:17:49 danforth systemd[1]: redis.service: Unit entered failed state.
Dec 08 09:17:49 danforth systemd[1]: redis.service: Failed with result 'exit-code'.
Dec 08 09:17:49 danforth systemd[1]: redis.service: Service hold-off time over, scheduling restart.
Dec 08 09:17:49 danforth systemd[1]: Stopped Redis In-Memory Data Store.
Dec 08 09:17:49 danforth systemd[1]: redis.service: Start request repeated too quickly.
Dec 08 09:17:49 danforth systemd[1]: Failed to start Redis In-Memory Data Store.
[Unit]
Description=Redis In-Memory Data Store
After=network.target
[Service]
Type=forking # <--- изначально было без этой строки, но на stackoverflow был подобный вопрос, и посоветовали добавить, однако мне это никак не помогло
User=redis
Group=redis
ExecStart=/usr/local/bin/redis-server /etc/redis/redis.conf
ExecStop=/usr/local/bin/redis-cli shutdown
Restart=always
[Install]
WantedBy=multi-user.target
Dec 08 09:26:27 danforth redis-server[3071]: 3071:M 08 Dec 09:26:27.353 # Opening Unix socket: bind: No such file or directory
Dec 08 09:26:27 danforth systemd[1]: redis.service: Control process exited, code=exited status=1
Answer the question
In order to leave comments, you need to log in
in cron, your script should run on the @reboot event.
in the
mkdir /var/run/redis script and the required chown/chmod to this folder.
if it starts like this:
then add it to autoload
if it doesn’t start after start, then find out why, autoload has nothing to do with it
Maybe there are not enough rights to write the log file, check the permissions, try setting 700 for the log filechmod 700 /var/log/redis/redis-server.log
Didn't find what you were looking for?
Ask your questionAsk a Question
731 491 924 answers to any question