Skip to content

Commit

Permalink
cmds/cpu: do not try to start cpunfs if *srvnfs is false
Browse files Browse the repository at this point in the history
Sometimes we just have a plain ssh connection.
We do not always want to start cpuns.

Do not prepend 'cpuns' to the shell command if *srvnfs is not set.

Signed-off-by: Ronald G. Minnich <[email protected]>
  • Loading branch information
rminnich committed Aug 10, 2024
1 parent 35a8e78 commit 1dbb28f
Showing 1 changed file with 2 additions and 2 deletions.
4 changes: 2 additions & 2 deletions cmds/cpu/cpu.go
Original file line number Diff line number Diff line change
Expand Up @@ -137,7 +137,7 @@ func newCPU(host string, args ...string) (retErr error) {
// Also, because of how sshd works, we need to pass in
// a PWD that is correct; otherwise it gets lost, since
// since ssh wants to simulate a login..
if *ssh {
if *ssh && *srvnfs {
env := append(os.Environ(), "CPU_PWD="+os.Getenv("PWD"))
envargs := "-env=" + strings.Join(env, "\n")
args = append([]string{"cpuns", envargs}, args...)
Expand Down Expand Up @@ -284,7 +284,7 @@ func main() {
verbose("turning ninep off for ssh usage")
*ninep = false
}
if *port == "22" && !*srvnfs {
if *port == "22" && !*srvnfs && len(*namespace) > 0 {
verbose("turning srvnfs on for ssh usage")
*srvnfs = true
}
Expand Down

0 comments on commit 1dbb28f

Please sign in to comment.