diff --git a/provisioner/shell/unix_reader.go b/provisioner/shell/unix_reader.go index 1e4ea76a1..837ecdeae 100644 --- a/provisioner/shell/unix_reader.go +++ b/provisioner/shell/unix_reader.go @@ -55,7 +55,11 @@ func (r *UnixReader) Read(p []byte) (n int, err error) { func scanUnixLine(data []byte, atEOF bool) (advance int, token []byte, err error) { advance, token, err = bufio.ScanLines(data, atEOF) if advance == 0 { + // If we reached the end of a line without a newline, then + // just return as it is. Otherwise the Scanner will keep trying + // to scan, blocking forever. return } + return advance, append(token, '\n'), err }