* Force allocation of a pseudo-terminal to clean up the remote

nix-store process when the connection is interrupted.
This commit is contained in:
Eelco Dolstra 2008-12-04 13:36:52 +00:00
parent 9ccdb80de3
commit 5dfba0b4db
1 changed files with 6 additions and 1 deletions

View File

@ -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";