标签(空格分隔):Linux
Centos7.1 redis-3.0.6
**service和chkconfig命令的功能好像都被阉割了,而且好像已经被systemctl命令取代了**
找到redis安装包
复制redis_init_script文件到/etc/init.d/
修改下文件内容
设置可执行权限
开自启
弃用[提示不能用]
新建redis.service服务文件
vim /usr/lib/systemd/system/redis.service修改redis.service文件内容
- 创建软连接
ln -s /usr/lib/systemd/system/redis.service /etc/systemd/system/multi-user.target.wants/redis.service - 刷新systemctl
systemctl daemon-reload - 设置开机自启动
systemctl enable redis
systemctl disable redis - 启动redis
systemctl start redis
systemctl stop redis 重启
reboot
来源:博客园
作者:凑阿屎
链接:https://www.cnblogs.com/yanweifeng/p/11571871.html