redis添加systemctl服务

1.编辑systemctl服务配置文件

vim /lib/systemd/system/redis.service

 

2.内容如下

[Unit]
Description=Redis
After=network.target

[Service]
Type=forking
PIDFile=/var/run/redis_6310.pid
ExecStart=/data/app/redis/src/redis-server /data/app/redis/config/redis6310.conf
ExecReload=/bin/kill -s HUP $MAINPID
ExecStop=/bin/kill -s QUIT $MAINPID
PrivateTmp=true

[Install]
WantedBy=multi-user.target

 

3.重载系统服务

systemctl daemon-reload

 

4.启动redis

systemctl start redis

systemctl status redis

 

5.设置开机启动

systemctl enable redis

posted @ 2018-12-14 21:20  鸾舞春秋  阅读(2541)  评论(0编辑  收藏  举报