cmd/cli: fix wrong generated config for nextdns resolver

Generating nextdns config must happen after stopping current ctrld
process. Otherwise, config processing may pick wrong IP+Port.

While at it, also making logging better when updating listener config:

 - Change warn to info, prevent confusing that "something is wrong".
 - Do not emit info when generating working default config, which may
   cause duplicated messages printed.
This commit is contained in:
Cuong Manh Le
2023-11-09 18:20:39 +07:00
committed by Cuong Manh Le
parent 4614b98e94
commit 09188bedf7
3 changed files with 31 additions and 19 deletions
+1 -1
View File
@@ -135,7 +135,7 @@ func (p *prog) runWait() {
waitOldRunDone()
_, ok := tryUpdateListenerConfig(newCfg, false)
_, ok := tryUpdateListenerConfig(newCfg, nil, false)
if !ok {
logger.Error().Msg("could not update listener config")
continue