pub fn init_runtime() -> Result<()>Expand description
Initialize runtime services that are required before any command runs.
The sequence is intentionally minimal but strict. First the Ctrl+C handler
is installed so command work can be interrupted safely. Then startup-only
cleanup runs so any package rows left in the Installing state from a prior
crash are marked failed and their leftover filesystem artifacts are removed.
This function is called after the database pool has been initialized and after logging has already been set up by the caller, so failures can be reported and the cleanup step can query the current install state.