about summary refs log tree commit diff
path: root/scripts/build-remote.pl.in
diff options
context:
space:
mode:
authorEelco Dolstra <e.dolstra@tudelft.nl>2008-12-04T13·36+0000
committerEelco Dolstra <e.dolstra@tudelft.nl>2008-12-04T13·36+0000
commit5dfba0b4db24f4943c5b529eb3b092a64bcd6b18 (patch)
treeef38bdf261f6f49a83884c912a5e0846af63c6b0 /scripts/build-remote.pl.in
parent9ccdb80de32cf8ff4e0f84c7011b5fbbfaf73c01 (diff)
* Force allocation of a pseudo-terminal to clean up the remote
  nix-store process when the connection is interrupted.

Diffstat (limited to 'scripts/build-remote.pl.in')
-rwxr-xr-xscripts/build-remote.pl.in7
1 files changed, 6 insertions, 1 deletions
diff --git a/scripts/build-remote.pl.in b/scripts/build-remote.pl.in
index 93bb6c32c136..a7023cb4dff3 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";