Redis starts manually with init.d but not on start

2019-08-09 10:06发布

Redis properly starts up if I run the command:

sudo /etc/init.d/redis-server start

I've added my startup script with:

sudo update-rc.d redis-server defaults

But when I startup from a fresh boot, Redis isn't running. Where should I look to troubleshoot this?

3条回答
小情绪 Triste *
2楼-- · 2019-08-09 10:53

The defaults thing usually sets starting to 20. It's too early as redis requires networking.

So, try below:

sudo update-rc.d redis-server remove
sudo update-rc.d redis-server start 80 2 3 4 5 . stop 20 0 1 6 .

查看更多
Fickle 薄情
3楼-- · 2019-08-09 11:02

Use the below into the terminal:

sudo systemctl enable redis

It made run on startup for me.

查看更多
可以哭但决不认输i
4楼-- · 2019-08-09 11:06

In my case update-rc.d didn't work

$ sudo update-rc.d redis-server start 80 2 3 4 5 . stop 20 0 1 6 .
update-rc.d: warning: start and stop actions are no longer supported; falling back to defaults

On the other hand

sudo systemctl enable redis-server

did the trick

查看更多
登录 后发表回答