创建 redis.service
1 | cd /usr/lib/systemd/system |
编辑内容
1 | [Unit] |
创建软链接
1 | ln -s `pwd`/redis.service /etc/systemd/system/multi-user.target.wants |
重新载入 systemctl 并启动服务
1 | systemctl daemon-reload |
查看状态
1 | systemctl status redis.service |
关闭 Redis
1 | systemctl stop redis.service |
开机自启
1 | systemctl enable redis.service |
是否开机自启
1 | systemctl is-enabled redis.service |