all: cleaning up router before waiting ntp synchronization

On some Merlin routers reported by users, ctrld some how is not stopped
properly. So the router does not have a working DNS at boot time to do
ntp synchronization.

To fix it, just clean up the router before start waiting for ntp ready.
This commit is contained in:
Cuong Manh Le
2023-06-27 09:19:05 +07:00
committed by Cuong Manh Le
parent f3a3227f21
commit 1aa991298a
2 changed files with 6 additions and 3 deletions
+1 -1
View File
@@ -168,7 +168,7 @@ func initCLI() {
// Processing --cd flag require connecting to ControlD API, which needs valid
// time for validating server certificate. Some routers need NTP synchronization
// to set the current time, so this check must happen before processCDFlags.
if err := router.PreRun(); err != nil {
if err := router.PreRun(svcConfig); err != nil {
mainLog.Fatal().Err(err).Msg("failed to perform router pre-run check")
}