cmd/cli: ensure DNS goroutines terminated before self-uninstall

Otherwise, these goroutines could mess up with what resetDNS function
do, reverting DHCP DNS settings to ctrld listeners.
This commit is contained in:
Cuong Manh Le
2024-08-15 20:03:05 +07:00
committed by Cuong Manh Le
parent 79476add12
commit 5af3ec4f7b
6 changed files with 88 additions and 75 deletions
+2 -2
View File
@@ -8,8 +8,8 @@ import (
"github.com/rs/zerolog"
)
func selfUninstall(err error, p *prog, logger zerolog.Logger) {
if uninstallIfInvalidCdUID(err, p, logger) {
func selfUninstall(p *prog, logger zerolog.Logger) {
if uninstallInvalidCdUID(p, logger, false) {
logger.Warn().Msgf("service was uninstalled because device %q does not exist", cdUID)
os.Exit(0)
}