我已经按照这个教程安装了redis。一切都很顺利,直到我运行
sudo service redis_6379 start
时,我遇到如下错误:
Failed to start redis_6379.service: Unit redis_6379.service failed to load: No such file or directory.
检查后发现redis没有运行:> sudo service redis_6379 status
● redis_6379.service
Loaded: not-found (Reason: No such file or directory)
Active: inactive (dead)
我不确定 redis_6379.service
这个文件是什么,也不知道如何创建它?需要帮助吗?
编辑: 尝试使用 sudo apt-get install redis-server
安装,但出现以下错误:
adduser: Warning: The home directory `/var/lib/redis' does not belong to the user that you are currently creating.
insserv: script shlonsky: service nginx already provided!
insserv: script unicorn_my_app: service unicorn already provided!
insserv: warning: script 'vncserver' missing LSB tags and overrides
insserv: There is a loop between service unicorn and vncserver if stopped
insserv: loop involving service vncserver at depth 2
insserv: loop involving service unicorn at depth 1
insserv: Stopping vncserver depends on unicorn_faisal_lab and therefore on system facility `$all' which can not be true!
insserv: exiting now without changing boot order!
update-rc.d: error: insserv rejected the script header
dpkg: error processing package redis-server (--configure):
subprocess installed post-installation script returned error exit status 1
Processing triggers for libc-bin (2.21-0ubuntu4) ...
Processing triggers for systemd (219-7ubuntu6) ...
Processing triggers for ureadahead (0.100.0-19) ...
Errors were encountered while processing:
redis-server
E: Sub-process /usr/bin/dpkg returned an error code (1)
我创建了脚本 shlonsky
和 unicorn_my_app
来启动 nginx 和 unicorn,但我没有想到它们会影响到其他 .service 安装。你有什么建议可以让 .service 文件安装成功吗?