mirror of
https://github.com/rcourtman/Pulse.git
synced 2026-11-29 09:10:58 +01:00
The disposable host reached multi-user.target in a degraded state because distro Podman housekeeping used overlay storage inside the outer container. Mask unused units, force VFS for explicit daemons, and fail closed on systemd unit failures so retained rootful evidence remains trustworthy.
22 lines
850 B
Bash
22 lines
850 B
Bash
#!/usr/bin/env bash
|
|
|
|
# This file is sourced by run-secure-runtime-rootful-qualification.sh and kept
|
|
# separately so the fail-closed systemd readiness predicate can be exercised
|
|
# without entering the destructive qualification wrapper.
|
|
|
|
rootful_qualification_systemd_readiness() {
|
|
local container_id="$1"
|
|
local target_state failed_units
|
|
|
|
target_state="$(docker exec "${container_id}" systemctl show \
|
|
--property=ActiveState --value multi-user.target 2>/dev/null)" || return 1
|
|
[[ "${target_state}" == "active" ]] || return 1
|
|
|
|
failed_units="$(docker exec "${container_id}" systemctl list-units \
|
|
--state=failed --no-legend --no-pager --plain 2>/dev/null)" || return 1
|
|
if [[ -n "${failed_units//[[:space:]]/}" ]]; then
|
|
printf 'ERROR: disposable systemd container has failed units:\n%s\n' "${failed_units}" >&2
|
|
return 2
|
|
fi
|
|
}
|