我的/etc/systemd/system/redis.service是
# /etc/systemd/system/redis.service
[Unit]
Description=Redis Server
After=network.target
[Service]
User=redis
Group=redis
ExecStart=/usr/local/bin/redis-server /etc/redis/redis.conf
ExecStop=/usr/local/bin/redis-cli shutdown
Restart=always
Type=notify
#Type=forking
[Install]
WantedBy=multi-user.target
做得好。
但是当我将类型从“通知”更改为网络建议“分叉”时 我收到错误,无法重新启动或停止redis.server
$systemctl restart redis
Job for redis.service failed because a timeout was exceeded. See "systemctl status redis.service" and "journalctl -xe" for details.