Commit c9400d2e authored by Martin Steinwender's avatar Martin Steinwender
Browse files

fix cmd run handling

parent 25517559
No preview for this file type
......@@ -48,14 +48,17 @@ func (bh *BosndHandler) run(command []string, notify bool) bool {
stdoutPipe, err := cmd.StdoutPipe()
if err != nil {
channelError <- err
return
}
stderrPipe, err := cmd.StderrPipe()
if err != nil {
channelError <- err
return
}
err = cmd.Start()
if err != nil {
channelError <- err
return
}
go io.Copy(os.Stdout, stdoutPipe)
go io.Copy(os.Stderr, stderrPipe)
......@@ -65,7 +68,11 @@ func (bh *BosndHandler) run(command []string, notify bool) bool {
log.Info(aurora.Green(fmt.Sprintf("Process %s %d started", bh.Config.Cmd.Processname, id)))
}
cmd.Wait()
err = cmd.Wait()
if err != nil {
channelError <- err
return
}
channelMsg <- fmt.Sprintf("Process %s %d exited", bh.Config.Cmd.Processname, id)
}()
......
Supports Markdown
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