diff options
author | Eelco Dolstra <edolstra@gmail.com> | 2019-12-13 12:51:36 +0100 |
---|---|---|
committer | Eelco Dolstra <edolstra@gmail.com> | 2019-12-13 12:51:36 +0100 |
commit | 2da4c61049aef9e318a35ea500d6351e0ab10907 (patch) | |
tree | b7b60b29d185e2e3cb6309e681d5017e02ec3dcb /src | |
parent | c6295a3afd87a605f30f1de8b09d7885eb08fedb (diff) | |
parent | 38b29fb72ca4a07afbec1fd5067f59ca7d7f0fab (diff) |
Merge branch 'libstore-ssh-better-exec-error-message' of https://github.com/Profpatsch/nix
Diffstat (limited to 'src')
-rw-r--r-- | src/libstore/ssh.cc | 8 |
1 files changed, 6 insertions, 2 deletions
diff --git a/src/libstore/ssh.cc b/src/libstore/ssh.cc index ac3ccd63d..ddc99a6cd 100644 --- a/src/libstore/ssh.cc +++ b/src/libstore/ssh.cc @@ -47,10 +47,13 @@ std::unique_ptr<SSHMaster::Connection> SSHMaster::startCommand(const std::string throw SysError("duping over stderr"); Strings args; + const char * execInto; if (fakeSSH) { + execInto = "bash"; args = { "bash", "-c" }; } else { + execInto = "ssh"; args = { "ssh", host.c_str(), "-x", "-a" }; addCommonSSHOpts(args); if (socketPath != "") @@ -62,7 +65,8 @@ std::unique_ptr<SSHMaster::Connection> SSHMaster::startCommand(const std::string args.push_back(command); execvp(args.begin()->c_str(), stringsToCharPtrs(args).data()); - throw SysError("executing '%s' on '%s'", command, host); + // could not exec ssh/bash + throw SysError("Failed to exec into %s. Is it in PATH?", execInto); }); @@ -108,7 +112,7 @@ Path SSHMaster::startMaster() addCommonSSHOpts(args); execvp(args.begin()->c_str(), stringsToCharPtrs(args).data()); - throw SysError("starting SSH master"); + throw SysError("Failed to exec into ssh. Is it in PATH?"); }); out.writeSide = -1; |