我发现我的 Debian 服务器上的 systemd 存在问题。我发现某些日志服务不想通过 systemd 启动,但守护进程本身可以正常启动:
❯ systemctl start rsyslog.service
A dependency job for rsyslog.service failed. See 'journalctl -xe' for details.
如果我手动启动 rsyslogd,它就会运行:
❯ /usr/sbin/rsyslogd
❯ ps awx | grep rsyslog
45995 ? Ssl 0:00 /usr/sbin/rsyslogd
因此我尝试了解 systemd 出了什么问题。
首先,journalctl -xe
仅显示 10 月 24 日以来的线路,没有最近的线路。
我尝试timedatectl
确保日期正确,但收到此消息
❯ timedatectl
Failed to connect to bus: No such file or directory
我在互联网上搜索了很多,最终运行systemctl --failed
命令,它显示许多失败的服务:
❯ systemctl --failed
UNIT LOAD ACTIVE SUB DESCRIPTION
● dbus.socket loaded failed failed D-Bus System Message Bus Socket
● syslog.socket loaded failed failed Syslog Socket
● systemd-fsckd.socket loaded failed failed fsck to fsckd communication Socket
● systemd-journald-audit.socket loaded failed failed Journal Audit Socket
● systemd-journald-dev-log.socket loaded failed failed Journal Socket (/dev/log)
● systemd-journald.socket loaded failed failed Journal Socket
● systemd-udevd-control.socket loaded failed failed udev Control Socket
● systemd-udevd-kernel.socket loaded failed failed udev Kernel Socket
● uuidd.socket loaded failed failed UUID daemon activation socket
LOAD = Reflects whether the unit definition was properly loaded.
ACTIVE = The high-level unit activation state, i.e. generalization of SUB.
SUB = The low-level unit activation state, values depend on unit type.
9 loaded units listed.
我已经重新安装了 systemd-sysv 并重新启动,清理了旧的 journalctl 条目,但问题仍然存在。
基本上,我对此一无所知 :/ 如果有人有想法 :D
附言:我知道现在是圣诞节,我不指望现在就能得到答案,因为我的答案也会有一些延迟;)