From 5dfba0b4db24f4943c5b529eb3b092a64bcd6b18 Mon Sep 17 00:00:00 2001 From: Eelco Dolstra Date: Thu, 4 Dec 2008 13:36:52 +0000 Subject: [PATCH] * Force allocation of a pseudo-terminal to clean up the remote nix-store process when the connection is interrupted. --- scripts/build-remote.pl.in | 7 ++++++- 1 file changed, 6 insertions(+), 1 deletion(-) diff --git a/scripts/build-remote.pl.in b/scripts/build-remote.pl.in index 93bb6c32c..a7023cb4d 100755 --- a/scripts/build-remote.pl.in +++ b/scripts/build-remote.pl.in @@ -183,7 +183,12 @@ system("NIX_SSHOPTS=\"$sshOpts\" nix-copy-closure $hostName $maybeSign $drvPath print "BUILDING...\n"; -system("ssh $sshOpts $hostName 'nix-store -rvvK $drvPath'") == 0 +# `-tt' forces allocation of a pseudo-terminal. This is required to +# make the remote nix-store process receive a signal when the +# connection dies. Without it, the remote process might continue to +# run indefinitely (that is, until it next tries to write to +# stdout/stderr). +system("ssh -tt $sshOpts $hostName 'nix-store -rvvK $drvPath'") == 0 or die "remote build on $hostName failed: $?"; print "REMOTE BUILD DONE: $drvPath on $hostName\n";