linux开机自启动redis服务
[Unit]Description
=The redis-server Process ManagerDocumentation
=https://redis.io/After
=network.target[Service]
Type
=forkingExecStart
=/root/redis-5.0.7/src/redis-server /root/redis-5.0.7/redis.conf
#有密码则需要在cli后面加 -a "密码"ExecStop
=/root/redis-5.0.7/src/redis-cli shutdown[Install]
WantedBy
=multi-user.target
1.先输入
vi /lib/systemd/system/redis.service
把上述配置复制进去,保存退出
2.设置开机自启动
systemctl enable redis
3.使用命令
#开启服务systemctl start redis
#停止服务
systemctl stop redis
#查看运行状态
system status redis
以上是 linux开机自启动redis服务 的全部内容, 来源链接: utcz.com/z/512695.html