systemd-tmpfiles 无法启动

Lok*_*oki 9 systemd 16.04

上次更新后出现问题:systemd-tmpfiles 未启动(因此没有临时目录,某些服务无法启动)。

root@myserver:/# journalctl -b 0 -u systemd-tmpfiles-setup.service
-- Logs begin at ?? 2018-11-21 01:00:51 MSK, end at ?? 2018-11-21 11:45:01 MSK. --
??? 21 01:01:04 myserver systemd[1]: Starting Create Volatile Files and Directories...
??? 21 01:01:04 myserver systemd-tmpfiles[1040]: Unsafe symlinks encountered in /var/log, refusing.
??? 21 01:01:04 myserver systemd-tmpfiles[1040]: Unsafe symlinks encountered in /var/lib, refusing.
??? 21 01:01:04 myserver systemd-tmpfiles[1040]: Unsafe symlinks encountered in /run/sendsigs.omit.d, refusing.
??? 21 01:01:04 myserver systemd-tmpfiles[1040]: Unsafe symlinks encountered in /run/lock/subsys, refusing.
??? 21 01:01:04 myserver systemd-tmpfiles[1040]: Unsafe symlinks encountered in /run/lock/lvm, refusing.
??? 21 01:01:04 myserver systemd-tmpfiles[1040]: Unsafe symlinks encountered in /run/lvm, refusing.
??? 21 01:01:04 myserver systemd-tmpfiles[1040]: Unsafe symlinks encountered in /var/cache, refusing.
??? 21 01:01:04 myserver systemd-tmpfiles[1040]: Unsafe symlinks encountered in /var/cache/man, refusing.
??? 21 01:01:04 myserver systemd-tmpfiles[1040]: Unsafe symlinks encountered in /run/php, refusing.
??? 21 01:01:04 myserver systemd-tmpfiles[1040]: Unsafe symlinks encountered in /run/rpcbind, refusing.
??? 21 01:01:04 myserver systemd-tmpfiles[1040]: Unsafe symlinks encountered in /run/rpcbind/rpcbind.xdr, refusing.
??? 21 01:01:04 myserver systemd-tmpfiles[1040]: Unsafe symlinks encountered in /run/rpcbind/portmap.xdr, refusing.
??? 21 01:01:04 myserver systemd-tmpfiles[1040]: Unsafe symlinks encountered in /run/samba, refusing.
??? 21 01:01:04 myserver systemd-tmpfiles[1040]: Unsafe symlinks encountered in /var/run/screen, refusing.
??? 21 01:01:04 myserver systemd-tmpfiles[1040]: Unsafe symlinks encountered in /var/run/sshd, refusing.
??? 21 01:01:04 myserver systemd-tmpfiles[1040]: Unsafe symlinks encountered in /var/run/sudo, refusing.
??? 21 01:01:04 myserver systemd-tmpfiles[1040]: Unsafe symlinks encountered in /var/run/sudo/ts, refusing.
??? 21 01:01:04 myserver systemd-tmpfiles[1040]: Unsafe symlinks encountered in /run/nologin, refusing.
??? 21 01:01:04 myserver systemd-tmpfiles[1040]: Unsafe symlinks encountered in /run/user, refusing.
??? 21 01:01:04 myserver systemd-tmpfiles[1040]: Unsafe symlinks encountered in /run/utmp, refusing.
??? 21 01:01:04 myserver systemd-tmpfiles[1040]: Unsafe symlinks encountered in /run/systemd/ask-password, refusing.
??? 21 01:01:04 myserver systemd-tmpfiles[1040]: Unsafe symlinks encountered in /run/systemd/seats, refusing.
??? 21 01:01:04 myserver systemd-tmpfiles[1040]: Unsafe symlinks encountered in /run/systemd/sessions, refusing.
??? 21 01:01:04 myserver systemd-tmpfiles[1040]: Unsafe symlinks encountered in /run/systemd/users, refusing.
??? 21 01:01:04 myserver systemd-tmpfiles[1040]: Unsafe symlinks encountered in /run/systemd/machines, refusing.
??? 21 01:01:04 myserver systemd-tmpfiles[1040]: Unsafe symlinks encountered in /run/systemd/shutdown, refusing.
??? 21 01:01:04 myserver systemd-tmpfiles[1040]: Unsafe symlinks encountered in /run/systemd/netif, refusing.
??? 21 01:01:04 myserver systemd-tmpfiles[1040]: Unsafe symlinks encountered in /run/systemd/netif/links, refusing.
??? 21 01:01:04 myserver systemd-tmpfiles[1040]: Unsafe symlinks encountered in /run/systemd/netif/leases, refusing.
??? 21 01:01:04 myserver systemd-tmpfiles[1040]: Unsafe symlinks encountered in /run/log, refusing.
??? 21 01:01:04 myserver systemd-tmpfiles[1040]: Unsafe symlinks encountered in /var/lib/systemd, refusing.
??? 21 01:01:04 myserver systemd-tmpfiles[1040]: Unsafe symlinks encountered in /var/lib/systemd/coredump, refusing.
??? 21 01:01:04 myserver systemd-tmpfiles[1040]: Unsafe symlinks encountered in /var/log/wtmp, refusing.
??? 21 01:01:04 myserver systemd-tmpfiles[1040]: Unsafe symlinks encountered in /var/log/btmp, refusing.
??? 21 01:01:04 myserver systemd[1]: systemd-tmpfiles-setup.service: Main process exited, code=exited, status=1/FAILURE
??? 21 01:01:04 myserver systemd[1]: Failed to start Create Volatile Files and Directories.
??? 21 01:01:04 myserver systemd[1]: systemd-tmpfiles-setup.service: Unit entered failed state.
??? 21 01:01:04 myserver systemd[1]: systemd-tmpfiles-setup.service: Failed with result 'exit-code'.
Run Code Online (Sandbox Code Playgroud)

我试图运行单独的配置文件

root@myserver:/# systemd-tmpfiles --create /usr/lib/tmpfiles.d/sshd.conf
Unsafe symlinks encountered in /var/run/sshd, refusing.
Run Code Online (Sandbox Code Playgroud)

/var/run/sshd 是空的。根本没有符号链接。

我不知道它是什么意思以及如何解决它。欢迎任何建议。

root@myserver:/# uname -a
Linux myserver 4.4.0-139-generic #165-Ubuntu SMP Wed Oct 24 10:58:50 UTC 2018 x86_64 x86_64 x86_64 GNU/Linux
Run Code Online (Sandbox Code Playgroud)

小智 21

我今天在我的工作站上遇到了完全相同的问题 - ubuntu 18.04.1。最后(搜索 systemd 源代码)我想,不知何故我的根文件夹 = / 所有权已更改为我 - 唯一的用户。简单chown root.root /解决了这个问题:) ...经过大约 2 个小时的搜索。

  • 哇!惊人的!我什至没想到朝这个方向挖掘。 (2认同)