redis7的redis.service启动配置

[Unit]
Description=Redis Server
After=network.target
 
[Service]
User=redis
Group=redis
ExecStart=/usr/bin/redis-server /etc/redis.conf
ExecStop=/usr/bin/redis-cli shutdown
Restart=always
 
[Install]
WantedBy=multi-user.target

  

 

redis.service(/usr/lib/systemd/system/)

redis.conf(/etc/redis/)

redis-server(/usr/local/bin/)

 

# 使服务自动运行
systemctl daemon-reload
systemctl enable redis
# 启动服务
systemctl restart redis
systemctl status redis
posted @ 2024-06-01 14:39  困到很想醒  阅读(5)  评论(0编辑  收藏  举报