From 1dc0ba39d8103e072d8cc8676f0ac19dbe3f8e1b Mon Sep 17 00:00:00 2001 From: tv Date: Wed, 11 Nov 2026 22:32:04 +0000 Subject: populate: stop the ssh master only if there is one Populate ends by stopping the ssh master, which fails if no source started one, e.g. for local targets, which populate doesn't reach via ssh. Populate then exits with ssh's exit status, though all sources got delivered. Populate now checks for a master first. --- pkgs/populate/default.nix | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) (limited to 'pkgs/populate/default.nix') diff --git a/pkgs/populate/default.nix b/pkgs/populate/default.nix index d58d9ac..5472b5d 100644 --- a/pkgs/populate/default.nix +++ b/pkgs/populate/default.nix @@ -777,5 +777,8 @@ writers.writeDash "populate.${target.host}" '' ${concatStringsSep "\n" (mapAttrsToList (populate target) source)} ${flakes target source} - ${ssh' target} -q -O stop ${quote target.host} + # Stop the ssh master, if any source started one. + if ${ssh' target} -q -O check ${quote target.host} 2>/dev/null; then + ${ssh' target} -q -O stop ${quote target.host} + fi '' -- cgit v1.3.1