由于新安装的 Fedora 32 上出现奇怪的 selinux Permission Denied,无法启动一些服务。
UNIT LOAD ACTIVE SUB DESCRIPTION
● fprintd.service loaded failed failed Fingerprint Authentication Dae
● systemd-hostnamed.service loaded failed failed Hostname Service
● systemd-localed.service loaded failed failed Locale Service
● systemd-timedated.service loaded failed failed Time & Date Service
尝试启动 systemd-hostnamed 时的日志示例:
Sep 02 21:25:26 uragan systemd[1]: Starting Hostname Service...
-- Subject: A start job for unit systemd-hostnamed.service has begun execution
-- Defined-By: systemd
-- Support: https://lists.freedesktop.org/mailman/listinfo/systemd-devel
--
-- A start job for unit systemd-hostnamed.service has begun execution.
--
-- The job identifier is 2907.
Sep 02 21:25:26 uragan audit[4860]: AVC avc: denied { remount } for pid=4860 comm="(ostnamed)" scontext=system_u:system_r:init_t:s0 tcontext=system_u:object_r:unlabeled_t:s0 tclass=filesystem permissive=0
Sep 02 21:25:26 uragan systemd[4860]: systemd-hostnamed.service: Failed to set up mount namespacing: /run/systemd/unit-root/: Permission denied
Sep 02 21:25:26 uragan systemd[4860]: systemd-hostnamed.service: Failed at step NAMESPACE spawning /usr/lib/systemd/systemd-hostnamed: Permission denied
-- Subject: Process /usr/lib/systemd/systemd-hostnamed could not be executed
-- Defined-By: systemd
-- Support: https://lists.freedesktop.org/mailman/listinfo/systemd-devel
--
-- The process /usr/lib/systemd/systemd-hostnamed could not be executed and failed.
--
-- The error number returned by this process is ERRNO.
Sep 02 21:25:26 uragan systemd[1]: systemd-hostnamed.service: Main process exited, code=exited, status=226/NAMESPACE
-- Subject: Unit process exited
-- Defined-By: systemd
-- Support: https://lists.freedesktop.org/mailman/listinfo/systemd-devel
--
-- An ExecStart= process belonging to unit systemd-hostnamed.service has exited.
--
-- The process' exit code is 'exited' and its exit status is 226.
Sep 02 21:25:26 uragan systemd[1]: systemd-hostnamed.service: Failed with result 'exit-code'.
-- Subject: Unit failed
-- Defined-By: systemd
-- Support: https://lists.freedesktop.org/mailman/listinfo/systemd-devel
--
-- The unit systemd-hostnamed.service has entered the 'failed' state with result 'exit-code'.
Sep 02 21:25:26 uragan systemd[1]: Failed to start Hostname Service.
-- Subject: A start job for unit systemd-hostnamed.service has failed
更新:
看起来这是由 USB microsd 读卡器安装的 exfat 引起的。我手动卸载这个 exfat 的速度与我启动 systemd-hostnamed 服务的速度一样快,而无需从 USB 端口移除读取器。重新插入读卡器时,自动挂载 exfat 和 systemd-hostnamed 的挂载会失败并停止。有人遇到过吗?
答案1
终于我找到了原因。看起来像是 Fedora 或内核中 exfat 挂载区域的错误。当 exfat 自动安装时,服务将失败并且无法再启动。卸载 exfat 后,即使没有从 USB 端口移除驱动器,我也可以立即启动这些服务。值得一提的是,如果安装了 rpmfusion 软件包“fuse-exfat”和“exfat-utils”,则不会出现此问题。唯一的区别是,如果在挂载过程中没有安装这两个软件包,则可以在journalctl中找到以下消息:
exfat: Deprecated parameter 'namecase'
该问题已报告给 redhat bugzilla:错误 1875064