📜  redis-server.service:启动后无法打开 PID 文件运行 redis redis-server.pid(还没有?):不允许操作 - 无论代码示例

📅  最后修改于: 2022-03-11 14:57:19.439000             🧑  作者: Mango

代码示例1
[Service]
Type=forking
ExecStart=/usr/bin/redis-server /etc/redis/redis.conf
ExecStop=/bin/kill -s TERM $MAINPID
ExecStartPost=/bin/sh -c "echo $MAINPID > /var/run/redis/redis.pid"
PIDFile=/run/redis/redis-server.pid