diff --git a/src/switchroot/ostree-remount.c b/src/switchroot/ostree-remount.c index 497603e9d9..21c311d6dc 100644 --- a/src/switchroot/ostree-remount.c +++ b/src/switchroot/ostree-remount.c @@ -90,7 +90,12 @@ static void relabel_dir_for_upper (const char *upper_path, const char *real_path, gboolean is_dir) { #ifdef HAVE_SELINUX - if (selinux_restorecon (real_path, 0)) + /* Ignore ENOENT, because if there is no file to relabel we can continue, + * systemd-sysusers runs in parallel and can create temporary files in /etc + * causing failures like: + * "Failed to relabel /etc/.g#shadowJzu4Rx: No such file or directory" + */ + if (selinux_restorecon (real_path, 0) && errno != ENOENT) err (EXIT_FAILURE, "Failed to relabel %s", real_path); if (!is_dir)