Improve openvpn run loop logs
This commit is contained in:
@@ -333,6 +333,7 @@ func openvpnRunLoop(ctx context.Context, ovpnConf openvpn.Configurator, streamMe
|
|||||||
if ctx.Err() == context.Canceled {
|
if ctx.Err() == context.Canceled {
|
||||||
break
|
break
|
||||||
}
|
}
|
||||||
|
logger.Info("openvpn: starting")
|
||||||
openvpnCtx, openvpnCancel := context.WithCancel(ctx)
|
openvpnCtx, openvpnCancel := context.WithCancel(ctx)
|
||||||
stream, waitFn, err := ovpnConf.Start(openvpnCtx)
|
stream, waitFn, err := ovpnConf.Start(openvpnCtx)
|
||||||
fatalOnError(err)
|
fatalOnError(err)
|
||||||
@@ -343,6 +344,9 @@ func openvpnRunLoop(ctx context.Context, ovpnConf openvpn.Configurator, streamMe
|
|||||||
})
|
})
|
||||||
err = waitFn()
|
err = waitFn()
|
||||||
waitErrors <- err
|
waitErrors <- err
|
||||||
|
if openvpnCtx.Err() == context.Canceled {
|
||||||
|
logger.Info("openvpn: shutting down")
|
||||||
|
}
|
||||||
logger.Error("openvpn: %s", err)
|
logger.Error("openvpn: %s", err)
|
||||||
openvpnCancel()
|
openvpnCancel()
|
||||||
}
|
}
|
||||||
|
|||||||
Reference in New Issue
Block a user