centos7 redis添加开机启动服务

vim /etc/systemd/system/redis-server.service

[Unit]
Description=The redis-server Process Manager
After=syslog.target network.target

[Service]
Type=simple
PIDFile=/var/run/redis_6379.pid
ExecStart=/usr/local/redis/redis-server /usr/local/redis/redis.conf
ExecReload=/bin/kill -USR2 $MAINPID
ExecStop=/bin/kill -SIGINT $MAINPID

[Install]
WantedBy=multi-user.target

设置

1 systemctl daemon-reload
2 systemctl start redis-server.service
3 systemctl enable redis-server.servic

------------恢复内容开始------------

vim /etc/systemd/system/redis-server.service

[Unit]
Description=The redis-server Process Manager
After=syslog.target network.target

[Service]
Type=simple
PIDFile=/var/run/redis_6379.pid
ExecStart=/usr/local/redis/redis-server /usr/local/redis/redis.conf
ExecReload=/bin/kill -USR2 $MAINPID
ExecStop=/bin/kill -SIGINT $MAINPID

[Install]
WantedBy=multi-user.target

设置

1 systemctl daemon-reload
2 systemctl start redis-server.service
3 systemctl enable redis-server.servic

------------恢复内容结束------------

posted @ 2020-10-20 09:55  李悠然  阅读(700)  评论(0编辑  收藏  举报