systemctl start不返回/退出

insrf1ej  于 2021-06-10  发布在  Redis
关注(0)|答案(1)|浏览(1446)

我正在尝试为redis启动一个服务文件,我读过很多关于将其作为systemd服务运行的帖子,我不知道为什么会发生这种情况。
当我跑的时候 sudo systemctl start redis-server.service 它不返回/退出-只是坐在那里光标闪烁,直到我ctrl-c。我已经确认服务器已启动并运行,所以服务器似乎工作正常-我不知道为什么systemctl start永远不会退出。redis要使用systemd和参数--supervised systemd服务的类型应该是type=notify。
我的服务文件是:

[Unit]
Description=Redis

[Service]
Type=notify
User=john
Group=john
ExecStart=/usr/local/bin/redis-server /home/john/redis/redis.conf --supervised systemd --daemonize no
ExecStop=/usr/local/bin/redis-cli shutdown
Restart=on-success
WorkingDirectory=/home/john/redis

[Install]
WantedBy=multi-user.target

redis.conf的内容是:

port              6379
save              60 1
bind              127.0.0.1
tcp-keepalive     300
dbfilename        dump.rdb
dir               ./
logfile           ./redis-server.log
nsc4cvqm

nsc4cvqm1#

从redis的版本6来看,它似乎需要使用 libsystemd-dev 安装在ubuntu+debian上的包。查看此github问题:https://github.com/redis/redis/issues/7284.
安装这个包并重新编译redis修复了这个问题。

相关问题