aboutsummaryrefslogtreecommitdiffstats
path: root/src/main.rs
diff options
context:
space:
mode:
authortv <tv@krebsco.de>2026-11-30 13:13:44 +0000
committertv <tv@krebsco.de>2026-11-30 14:59:15 +0000
commitac214a023e3d823a8231c365656cfa27703f27d5 (patch)
tree551ca7e87e2dce128b23732d28100edd84861ffc /src/main.rs
parenta0f22c88d54d351b060c2d0d9f0a8cbf5f412ba2 (diff)
enstate: reactions after applying, and after a switch
After applying, units are restarted or reloaded, and started if they aren't running: they may have failed for want of their views. That happens with the store's lock released: a unit restarted may want the one that runs --migrate, which waits for the lock. After a switch, --migrate runs from the unit that units using views are ordered after, so only running units react, without waiting for them (--no-block try-restart, try-reload-or-restart).
Diffstat (limited to 'src/main.rs')
-rw-r--r--src/main.rs4
1 files changed, 2 insertions, 2 deletions
diff --git a/src/main.rs b/src/main.rs
index 3539d76..49b8558 100644
--- a/src/main.rs
+++ b/src/main.rs
@@ -230,13 +230,13 @@ fn run() -> Result<ExitCode> {
let systemctl = settings
.systemctl
.unwrap_or_else(|| PathBuf::from("systemctl"));
- let _lock = store.lock()?;
+ let lock = store.lock()?;
match command {
"plan" | "apply" => {
let submission = Submission::load(path.as_deref().unwrap())?;
let planned = plan::plan(&schema, &store, &submission)?;
let plan = if command == "apply" {
- planned.apply(&store, &schema_bytes, &systemctl)?
+ planned.apply(&store, &schema_bytes, &systemctl, lock)?
} else {
planned.plan
};