Inform user about failed fsck (create unhealthy status/repair)
Description
When fsck fails, the user might not learn about it as the error is only printed to the logs and the system might still boot (especially if using data disk). Make sure there is a way of informing user about that so they can take action immediately.
As a further extension of this idea, maybe it might be good to somehow propagate status of all failed Systemd units?
Additional context
Discovered through https://github.com/home-assistant/operating-system/issues/4182#issuecomment-3112946404
fsck are units, ideally we check the fsck units and notify the user about it.
Maybe there should be a generic check for failed systemd units, and raise those. A generic repair is probably not really user friendly as it won't be actionable for most people. But we could start with logging those to Supervisor logs. This check should be done before loading mounts (to avoid false positive from failing mount units).
Let's start with the fsck units explicitly.
There should be two different repairs, one for the OS partitions (unhealthy os_filesystem_check_error):
systemd-fsck@dev-disk-by\x2dlabel-hassos\x2dboot.service
systemd-fsck@dev-disk-by\x2dlabel-hassos\x2doverlay.service
And one for the data partition (unhealthy data_filesystem_check_error):
systemd-fsck@dev-disk-by\x2dlabel-hassos\x2ddata.service
As a further extension of this idea, maybe it might be good to somehow propagate status of all failed Systemd units?
We could use org.freedesktop.systemd1.Manager.ListUnitsFiltered DBus method for that. If it lists any units of those above, raise unhealthy flags, otherwise just log them for now.
Example call through gdbus:
gdbus call \
--system \
--dest org.freedesktop.systemd1 \
--object-path /org/freedesktop/systemd1 \
--method org.freedesktop.systemd1.Manager.ListUnitsFiltered \
"[\"failed\"]"
There hasn't been any activity on this issue recently. Due to the high number of incoming GitHub notifications, we have to clean some of the old issues, as many of them have already been resolved with the latest updates. Please make sure to update to the latest version and check if that solves the issue. Let us know if that works for you by adding a comment 👍 This issue has now been marked as stale and will be closed if no further activity occurs. Thank you for your contributions.
Oh no ... stale ...
There hasn't been any activity on this issue recently. Due to the high number of incoming GitHub notifications, we have to clean some of the old issues, as many of them have already been resolved with the latest updates. Please make sure to update to the latest version and check if that solves the issue. Let us know if that works for you by adding a comment 👍 This issue has now been marked as stale and will be closed if no further activity occurs. Thank you for your contributions.
Again.....