升级Debian后,它出现问题redis-server.service
。
在journalctl -xe
的输出中,我看到以下内容:
redis-server.service: Failed at step NAMESPACE spawning /usr/bin/redis-server: Stale file handle.
我无法启动redis-server.service并在systemctl start redis-server
的输出中启动:
Job for redis-server.service failed because the control process exited with error code.
See "systemctl status redis-server.service" and "journalctl -xe" for details.
在systemctl status redis-server
的输出中,我有:
● redis-server.service - Advanced key-value store
Loaded: loaded (/lib/systemd/system/redis-server.service; disabled; vendor preset: disabled)
Active: failed (Result: exit-code) since Mon 2018-01-29 10:29:08 MSK; 58s ago
Docs: http://redis.io/documentation,
man:redis-server(1)
Process: 11701 ExecStop=/bin/kill -s TERM $MAINPID (code=exited, status=226/NAMESPACE)
Process: 11720 ExecStart=/usr/bin/redis-server /etc/redis/redis.conf (code=exited, status=226/NAMESPACE)
Main PID: 10193 (code=exited, status=0/SUCCESS)
Jan 29 10:29:08 xxx systemd[1]: redis-server.service: Service hold-off time over, scheduling restart.
Jan 29 10:29:08 xxx systemd[1]: redis-server.service: Scheduled restart job, restart counter is at 5.
Jan 29 10:29:08 xxx systemd[1]: Stopped Advanced key-value store.
我的问题如何解决此问题并启动redis-server.service?
答案 0 :(得分:1)
找到解决方案解决方案:
我以root身份使用/lib/systemd/system/redis-server.service
编辑服务文件,注释掉了尝试查找失败位置的不同字段并重新启动systemd(通过systemctl daemon-reload
,systemctl stop redis-server
,{ {1}})
对我来说,问题是redis-server.service文件中的以下行:
systemctl start redis-server
我已经注释掉了,并且允许redis-server成功启动。
所以我当前的ReadOnlyDirectories=/
是:
/lib/systemd/system/redis-server.service
答案 1 :(得分:0)
我在运行sudo apt -y dist-upgrade
后刚遇到此问题,并且在/var/log/syslog
中遇到了这个略有不同的错误
redis-server.service: Failed at step NAMESPACE spawning /usr/bin/redis-server: Invalid argument
解决方案Launchpad Bug 1638410是:
sudo systemctl edit redis-server
[Service]
ProtectHome=no
保存并退出编辑器并完成升级:
sudo apt install -f
cat /etc/os-release
NAME="Ubuntu"
VERSION="16.04.5 LTS (Xenial Xerus)"
ID=ubuntu
ID_LIKE=debian
PRETTY_NAME="Ubuntu 16.04.5 LTS"
VERSION_ID="16.04"
HOME_URL="http://www.ubuntu.com/"
SUPPORT_URL="http://help.ubuntu.com/"
BUG_REPORT_URL="http://bugs.launchpad.net/ubuntu/"
VERSION_CODENAME=xenial
UBUNTU_CODENAME=xenial
$ apt policy redis-server
redis-server:
Installed: 5:5.0.0-3chl1~xenial1
Candidate: 5:5.0.0-3chl1~xenial1
Version table:
*** 5:5.0.0-3chl1~xenial1 500
500 http://ppa.launchpad.net/chris-lea/redis-server/ubuntu xenial/main amd64 Packages
100 /var/lib/dpkg/status
2:3.0.6-1 500
500 http://archive.ubuntu.com/ubuntu xenial/universe amd64 Packages
答案 2 :(得分:0)
如果您使用的是Ubunut,则
/etc/redis/redis.conf
您应该有:
supervised systemd