git.delta.rocks / fleet / refs/commits / 16f8cd14577e

difftreelog

fix online activation with systemd-run

ppowpsmyYaroslav Bolyukin2026-04-22parent: #b8e16d6.patch.diff

2 files changed

modifiedCargo.lockdiffbeforeafterboth
before · Cargo.lock
469 packageslockfile v4
modifiedcrates/fleet-base/src/deploy.rsdiffbeforeafterboth
--- a/crates/fleet-base/src/deploy.rs
+++ b/crates/fleet-base/src/deploy.rs
@@ -190,17 +190,17 @@
 			};
 			let switch_script = specialised.join("bin/switch-to-configuration");
 			let mut cmd = host.cmd("systemd-run").in_current_span().await?;
-			cmd.arg("--collect")
+			if deploy_kind == DeployKind::NixosLustrate {
+				cmd.arg("--setenv=NIXOS_INSTALL_BOOTLOADER=1");
+			}
+			cmd.arg("--setenv=FLEET_ONLINE_ACTIVATION=1")
+				.arg("--collect")
 				.arg("--no-ask-password")
 				.arg("--pipe")
 				.arg("--quiet")
 				.arg("--service-type=exec")
 				.arg("--unit=fleet-switch-to-configuration")
-				.arg(switch_script);
-			if deploy_kind == DeployKind::NixosLustrate {
-				cmd.env("NIXOS_INSTALL_BOOTLOADER", "1");
-			}
-			cmd.env("FLEET_ONLINE_ACTIVATION", "1")
+				.arg(switch_script)
 				.arg(action.name().expect("upload.should_activate == false"));
 			if let Err(e) = cmd.sudo().run().in_current_span().await {
 				error!("failed to activate: {e}");