mind-body: a partial brake stop names each unit's state

When systemctl stop fails, stop_all asks is-active for each of the two
units and the error names each state (active, inactive, failed, unknown)
beside the exit status; brake hold says the brake is held and the stop
failed, not that the units were not stopped. Exit 2 and the held brake
are unchanged. Follow-up brake-partial-stop-message.

Not yet built; verified at the head of the cut.

Co-Authored-By: Claude Sonnet 5.5 <noreply@anthropic.com>
This commit is contained in:
Meta Vens 2026-10-22 17:37:08 +02:00
commit d427b0e268
3 changed files with 79 additions and 24 deletions

View file

@ -73,8 +73,8 @@ pub fn run(
Ok(())
}
(Err(write), Ok(())) => Err(write.context("the brake was not written; the units were stopped")),
(Ok(()), Err(stop)) => Err(stop.context("the brake is held; the units were not stopped")),
(Err(write), Err(stop)) => Err(anyhow!("the brake was not written ({write:#}) and the units were not stopped ({stop:#})")),
(Ok(()), Err(stop)) => Err(stop.context("the brake is held; the stop failed")),
(Err(write), Err(stop)) => Err(anyhow!("the brake was not written ({write:#}) and the stop failed ({stop:#})")),
}
}
["brake", "release"] => ControlWriter::open(&path)?.set_brake(true, now, set_by),