Name the workload, not the candidate, in the restart-policy refusal

is_permanently_stopped is called on the incumbent as well as the
candidate since 8448f83, so a message naming only the candidate would
misdirect the first person who hits it. Unreachable today -- observe_unit
guarantees every recorded workload is Restart=no -- which is exactly why
the wording would be read cold.

Co-Authored-By: Claude Opus 5 <noreply@anthropic.com>
This commit is contained in:
Meta Vens 2026-09-10 01:05:42 +02:00
commit da927ea30e

View file

@ -2969,7 +2969,7 @@ impl WorkloadPort for SystemdTransientWorkloadDriver {
fn is_permanently_stopped(&self, observation: &WorkloadObservation) -> Result<bool> {
ensure!(
observation.restart_policy == "no",
"candidate unit does not carry the admitted Restart=no policy"
"workload unit does not carry the admitted Restart=no policy"
);
let Some(unit) = self.show_unit(&observation.unit)? else {
// systemd has forgotten the unit entirely, so nothing will start it.