diff --git a/internal/remote/output_interceptor_unix.go b/internal/remote/output_interceptor_unix.go index 774967db66..cfe5e9db64 100644 --- a/internal/remote/output_interceptor_unix.go +++ b/internal/remote/output_interceptor_unix.go @@ -38,8 +38,14 @@ func (interceptor *outputInterceptor) StartInterceptingOutput() error { // This might call Dup3 if the dup2 syscall is not available, e.g. on // linux/arm64 or linux/riscv64 - unix.Dup2(int(interceptor.redirectFile.Fd()), 1) - unix.Dup2(int(interceptor.redirectFile.Fd()), 2) + switch { + case runtime.GOOS == "linux" && runtime.GOARCH == "amd64": + unix.Dup2(int(interceptor.redirectFile.Fd()), 1) + unix.Dup2(int(interceptor.redirectFile.Fd()), 2) + default: + unix.Dup3(int(interceptor.redirectFile.Fd()), 1, 0) + unix.Dup3(int(interceptor.redirectFile.Fd()), 2, 0) + } if interceptor.streamTarget != nil { interceptor.tailer, _ = tail.TailFile(interceptor.redirectFile.Name(), tail.Config{Follow: true})