Skip to content

Commit

Permalink
Fixes intelsdi-x#1104: skips non-executable plugins in auto_discover …
Browse files Browse the repository at this point in the history
…path
  • Loading branch information
Tom McSweeney committed Jul 28, 2016
1 parent 8f40854 commit cbda3d9
Showing 1 changed file with 7 additions and 1 deletion.
8 changes: 7 additions & 1 deletion control/plugin/execution.go
Original file line number Diff line number Diff line change
Expand Up @@ -55,7 +55,13 @@ type commandWrapper struct {
func (cw *commandWrapper) Path() string { return cw.cmd.Path }
func (cw *commandWrapper) Kill() error {
// first, kill the process wrapped up in the commandWrapper
if err := cw.cmd.Process.Kill(); err != nil {
if cw.cmd.Process == nil {
err := fmt.Errorf("process for plugin '%s' not started; cannot kill", path.Base(cw.Path()))
log.WithFields(log.Fields{
"_block": "Kill",
}).Warn(err)
return err
} else if err := cw.cmd.Process.Kill(); err != nil {
log.WithFields(log.Fields{
"_block": "Kill",
}).Error(err)
Expand Down

0 comments on commit cbda3d9

Please sign in to comment.