Minor fixes

- Not logging program name twice for wait errors
- Wait for tinyproxy to exit
This commit is contained in:
Quentin McGaw
2020-07-08 23:29:22 +00:00
parent 7d36993450
commit a39d885e34
3 changed files with 3 additions and 4 deletions

View File

@@ -277,6 +277,7 @@ func _main(background context.Context, args []string) int {
<-serverDone <-serverDone
<-unboundDone <-unboundDone
<-openvpnDone <-openvpnDone
<-tinyproxyDone
return exitStatus return exitStatus
} }

View File

@@ -2,7 +2,6 @@ package dns
import ( import (
"context" "context"
"fmt"
"net" "net"
"time" "time"
@@ -112,7 +111,7 @@ func (l *looper) Run(ctx context.Context, restart <-chan struct{}, done chan<- s
go func() { go func() {
err := waitFn() // blocking err := waitFn() // blocking
if unboundCtx.Err() != context.Canceled { if unboundCtx.Err() != context.Canceled {
waitError <- fmt.Errorf("unbound: %w", err) waitError <- err
} }
}() }()

View File

@@ -2,7 +2,6 @@ package openvpn
import ( import (
"context" "context"
"fmt"
"time" "time"
"github.com/qdm12/golibs/command" "github.com/qdm12/golibs/command"
@@ -62,7 +61,7 @@ func (l *looper) Run(ctx context.Context, restart <-chan struct{}, done chan<- s
go func() { go func() {
err := waitFn() // blocking err := waitFn() // blocking
if openvpnCtx.Err() != context.Canceled { if openvpnCtx.Err() != context.Canceled {
waitError <- fmt.Errorf("openvpn: %w", err) waitError <- err
} }
}() }()
select { select {