From 71e06d080476ed3e6e9aed0495fb3b2fe38a97e4 Mon Sep 17 00:00:00 2001 From: Dustin Frisch Date: Tue, 27 Jun 2023 11:40:45 +0200 Subject: [PATCH 1/2] Prevent usage of SSH persistent connections Deployment sometimes get stuck on "Pushed system closure" if SSH control master already exists for the connection to make. This is more like a bug in the nix SSH implementation which is usually mitigated by setting these options in `NIX_SSHOPTS`. --- src/nix/host/ssh.rs | 2 ++ 1 file changed, 2 insertions(+) diff --git a/src/nix/host/ssh.rs b/src/nix/host/ssh.rs index 1622007..387a5c1 100644 --- a/src/nix/host/ssh.rs +++ b/src/nix/host/ssh.rs @@ -345,6 +345,8 @@ impl Ssh { "-o", "BatchMode=yes", "-T", + "-o", "ControlMaster=no", + "-o", "ControlPath=/dev/null", ] .iter() .map(|s| s.to_string()) From 5021e013f6830b0e7f5ad4ab8a46d4f4e1c77d0a Mon Sep 17 00:00:00 2001 From: Dustin Frisch Date: Tue, 27 Jun 2023 12:10:08 +0200 Subject: [PATCH 2/2] Use non-existent file for control path --- src/nix/host/ssh.rs | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/nix/host/ssh.rs b/src/nix/host/ssh.rs index 387a5c1..b308329 100644 --- a/src/nix/host/ssh.rs +++ b/src/nix/host/ssh.rs @@ -346,7 +346,7 @@ impl Ssh { "BatchMode=yes", "-T", "-o", "ControlMaster=no", - "-o", "ControlPath=/dev/null", + "-o", "ControlPath=/var/empty/non-existant", ] .iter() .map(|s| s.to_string())