tmpfiles: improve error message for missing user/group

From a boot with a dracut initrd:
systemd-tmpfiles[242]: /usr/lib/tmpfiles.d/tpm2-tss-fapi.conf:2: Failed to resolve user 'tss': No such process
systemd-tmpfiles[242]: Failed to parse ACL "default:group:tss:rwx", ignoring: Invalid argument
systemd-tmpfiles[242]: /usr/lib/tmpfiles.d/tpm2-tss-fapi.conf:4: Failed to resolve user 'tss': No such process
systemd-tmpfiles[242]: Failed to parse ACL "default:group:tss:rwx", ignoring: Invalid argument
systemd-tmpfiles[242]: /usr/lib/tmpfiles.d/tpm2-tss-fapi.conf:6: Failed to resolve group 'tss': No such process
systemd-tmpfiles[242]: /usr/lib/tmpfiles.d/tpm2-tss-fapi.conf:7: Failed to resolve group 'tss': No such process
This commit is contained in:
Zbigniew Jędrzejewski-Szmek
2025-11-18 09:21:02 +01:00
parent 6e6e96f628
commit f436664881

View File

@@ -3992,7 +3992,8 @@ static int parse_line(
missing_user_or_group = true;
} else if (r < 0) {
*invalid_config = true;
return log_syntax(NULL, LOG_ERR, fname, line, r, "Failed to resolve user '%s': %m", u);
return log_syntax(NULL, LOG_ERR, fname, line, r,
"Failed to resolve user '%s': %s", u, STRERROR_USER(r));
} else
i.uid_set = true;
}
@@ -4013,7 +4014,8 @@ static int parse_line(
missing_user_or_group = true;
} else if (r < 0) {
*invalid_config = true;
return log_syntax(NULL, LOG_ERR, fname, line, r, "Failed to resolve group '%s': %m", g);
return log_syntax(NULL, LOG_ERR, fname, line, r,
"Failed to resolve group '%s': %s", g, STRERROR_GROUP(r));
} else
i.gid_set = true;
}