[已解决]systemd-tmpfiles 相关的服务不能启动

systemd 的 systemd-tmpfiles-clean.service、systemd-tmpfiles-setup-dev.service、systemd-tmpfiles-setup.service 这 3 个服务一直都是 failed,今天只搞定一个。

Service 状态:

$ systemctl status systemd-tmpfiles-clean.service
systemd-tmpfiles-clean.service - Cleanup of Temporary Directories
   Loaded: loaded (/usr/lib/systemd/system/systemd-tmpfiles-clean.service; static)
   Active: failed (Result: exit-code) since Mon 2014-09-29 09:44:15 CST; 5h 20min ago
     Docs: man:tmpfiles.d(5)
           man:systemd-tmpfiles(8)
  Process: 11988 ExecStart=/usr/bin/systemd-tmpfiles --clean (code=exited, status=1/FAILURE)
 Main PID: 11988 (code=exited, status=1/FAILURE)

Sep 29 09:44:15 pc systemd[1]: Starting Cleanup of Temporary Directories...
Sep 29 09:44:15 pc systemd-tmpfiles[11988]: [/usr/lib/tmpfiles.d/xl2tpd.conf:2] Unknown file type 'e'.
Sep 29 09:44:15 pc systemd-tmpfiles[11988]: [/usr/lib/tmpfiles.d/xl2tpd.conf:7] Unknown file type 't'.
Sep 29 09:44:15 pc systemd-tmpfiles[11988]: stat(/run/user/1000/gvfs) failed: Permission denied
Sep 29 09:44:15 pc systemd[1]: systemd-tmpfiles-clean.service: main process exited, code=exited, status=1/FAILURE
Sep 29 09:44:15 pc systemd[1]: Failed to start Cleanup of Temporary Directories.
Sep 29 09:44:15 pc systemd[1]: Unit systemd-tmpfiles-clean.service entered failed state.

挂载信息:

$ mount | grep gvfs
gvfsd-fuse on /run/user/1000/gvfs type fuse.gvfsd-fuse (rw,nosuid,nodev,relatime,user_id=1000,group_id=100)
gvfsd-fuse on /var/run/user/1000/gvfs type fuse.gvfsd-fuse (rw,nosuid,nodev,relatime,user_id=1000,group_id=100)

tmpfiles.d 配置:

$ cat /usr/lib/tmpfiles.d/gvfsd-fuse-tmpfiles.conf
## 省略……
#
# Due to our fuse mount restrictions root can't access nor stat the mountpoint
# resulting in warning spitted out by the systemd-tmpfiles process. Please
# ignore it for the time being until proper solution is found:
# https://bugzilla.gnome.org/show_bug.cgi?id=560658

x /run/user/*/gvfs

/usr/lib/tmpfiles.d/xl2tpd.conf' 这个报错很容易解决,配置文件里注释换行了,新行开头没有加#’ 号,2 行注释合并成一行(Vim 里的操作就是 `Shift-j’)就好了。
gvfs 相关的报错看了 Bug 560658 ,貌似现在还没有解决,这个 Bug 就这样搁置了。

systemd-tmpfiles-setup-dev.service 这个服务看状态和 /dev‘ 有关,肯定和systemd-tmpfiles-clean.service’ 一样纠结,暂时不管了。
systemd-tmpfiles-setup.service 这个报错也是因为 `/usr/lib/tmpfiles.d/xl2tpd.conf’ 这个配置文件,前面的说的注释改掉就好了。

参考:

man systemd-tmpfiles 8


man tmpfiles.d 5

改完 `/usr/lib/tmpfiles.d/xl2tpd.conf’ 这个配置文件,今天重启了一下,发现 3 个服务全都正常了。