Commit ae28778c authored by Mitchell Hashimoto's avatar Mitchell Hashimoto

packer/plugin: flush os.Stderr whenever a plugin ends

parent 69a5e83f
......@@ -244,9 +244,18 @@ func (c *Client) Start() (address string, err error) {
// Start goroutine to wait for process to exit
go func() {
// Make sure we close the write end of our stderr listener so
// that the log goroutine ends properly.
defer stderr_w.Close()
// Wait for the command to end.
cmd.Wait()
// Log and make sure to flush the logs write away
log.Printf("%s: plugin process exited\n", cmd.Path)
os.Stderr.Sync()
// Mark that we exited
c.exited = true
}()
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment