Redis starts manually with init.d but not on startup

此生再无相见时 提交于 2019-12-12 23:40:22

问题


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?


回答1:


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 .




回答2:


Use the below into the terminal:

sudo systemctl enable redis

It made redis run on startup for me.




回答3:


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



来源:https://stackoverflow.com/questions/20589725/redis-starts-manually-with-init-d-but-not-on-startup

易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!