Skip to content
This repository has been archived by the owner on Nov 27, 2023. It is now read-only.

Commit

Permalink
return dnsmasq errors
Browse files Browse the repository at this point in the history
While debugging the rootless cni PR in podman I had a problem with the
dnsname plugin because dnsmasq failed to start. The returned error was
just `exit status 5`. This is not helpful. To solve this use CombinedOutput
and wrap the dnsmasq output to the returned error.

Signed-off-by: Paul Holzinger <[email protected]>
  • Loading branch information
Paul Holzinger committed Mar 17, 2021
1 parent a05ec9a commit 13bf4d4
Showing 1 changed file with 4 additions and 1 deletion.
5 changes: 4 additions & 1 deletion plugins/meta/dnsname/service.go
Original file line number Diff line number Diff line change
Expand Up @@ -66,7 +66,10 @@ func (d dnsNameFile) start() error {
fmt.Sprintf("--conf-file=%s", d.ConfigFile),
}
cmd := exec.Command(d.Binary, args...)
return cmd.Run()
if b, err := cmd.CombinedOutput(); err != nil {
return errors.Wrapf(err, "dnsname error: dnsmasq failed with %q", b)
}
return nil
}

// stop stops the dnsmasq instance.
Expand Down

0 comments on commit 13bf4d4

Please sign in to comment.