[Unit]
Description=redis
After=network.target
[Service]
Type=forking
PIDFile=/var/run/redis_6379.pid
ExecStart=/usr/local/redis/src/redis-server /usr/local/redis/redis.conf
ExecReload=/bin/kill -s HUP $MAINPID
ExecStop=/bin/kill -s QUIT $MAINPID
PrivateTmp=true
[Install] WantedBy=multi-user.target
注意,路径替换成你自己的安装路径, pid路径和 redis.conf里面的路径保持一致
systemctl daemon-reload //刚刚配置的服务需要让systemctl能识别,就必须刷新配置
systemctl enable redis.service //加入开机启动
Original: https://www.cnblogs.com/justuntil/p/13325474.html
Author: 暗渡陈仓xy
Title: redis配置systemctl
原创文章受到原创版权保护。转载请注明出处:https://www.johngo689.com/529044/
转载文章受原作者版权保护。转载请注明原作者出处!