Minor fixes
- Not logging program name twice for wait errors - Wait for tinyproxy to exit
This commit is contained in:
@@ -277,6 +277,7 @@ func _main(background context.Context, args []string) int {
|
|||||||
<-serverDone
|
<-serverDone
|
||||||
<-unboundDone
|
<-unboundDone
|
||||||
<-openvpnDone
|
<-openvpnDone
|
||||||
|
<-tinyproxyDone
|
||||||
return exitStatus
|
return exitStatus
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|||||||
@@ -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
|
||||||
}
|
}
|
||||||
}()
|
}()
|
||||||
|
|
||||||
|
|||||||
@@ -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 {
|
||||||
|
|||||||
Reference in New Issue
Block a user