chore(vpn): do not restart VPN if startup check fails and HEALTH_RESTART_VPN=off
- Note you still should not set HEALTH_RESTART_VPN=off this is for debugging only
This commit is contained in:
@@ -41,11 +41,15 @@ func (l *Loop) onTunnelUp(ctx, loopCtx context.Context, data tunnelUpData) {
|
|||||||
healthErrCh, err := l.healthChecker.Start(ctx)
|
healthErrCh, err := l.healthChecker.Start(ctx)
|
||||||
l.healthServer.SetError(err)
|
l.healthServer.SetError(err)
|
||||||
if err != nil {
|
if err != nil {
|
||||||
|
if *l.healthSettings.RestartVPN {
|
||||||
// Note this restart call must be done in a separate goroutine
|
// Note this restart call must be done in a separate goroutine
|
||||||
// from the VPN loop goroutine.
|
// from the VPN loop goroutine.
|
||||||
l.restartVPN(loopCtx, err)
|
l.restartVPN(loopCtx, err)
|
||||||
return
|
return
|
||||||
}
|
}
|
||||||
|
l.logger.Warnf("(ignored) healthchecker start failed: %s", err)
|
||||||
|
l.logger.Info("👉 See https://github.com/qdm12/gluetun-wiki/blob/main/faq/healthcheck.md")
|
||||||
|
}
|
||||||
|
|
||||||
if *l.dnsLooper.GetSettings().ServerEnabled {
|
if *l.dnsLooper.GetSettings().ServerEnabled {
|
||||||
_, _ = l.dnsLooper.ApplyStatus(ctx, constants.Running)
|
_, _ = l.dnsLooper.ApplyStatus(ctx, constants.Running)
|
||||||
@@ -96,7 +100,7 @@ func (l *Loop) collectHealthErrors(ctx, loopCtx context.Context, healthErrCh <-c
|
|||||||
l.restartVPN(loopCtx, healthErr)
|
l.restartVPN(loopCtx, healthErr)
|
||||||
return
|
return
|
||||||
}
|
}
|
||||||
l.logger.Warnf("healthcheck failed: %s", healthErr)
|
l.logger.Warnf("(ignored) healthcheck failed: %s", healthErr)
|
||||||
l.logger.Info("👉 See https://github.com/qdm12/gluetun-wiki/blob/main/faq/healthcheck.md")
|
l.logger.Info("👉 See https://github.com/qdm12/gluetun-wiki/blob/main/faq/healthcheck.md")
|
||||||
} else if previousHealthErr != nil {
|
} else if previousHealthErr != nil {
|
||||||
l.logger.Info("healthcheck passed successfully after previous failure(s)")
|
l.logger.Info("healthcheck passed successfully after previous failure(s)")
|
||||||
|
|||||||
Reference in New Issue
Block a user