diff --git a/pkg/pillar/scripts/device-steps.sh b/pkg/pillar/scripts/device-steps.sh index 318daff492..b917dabc89 100755 --- a/pkg/pillar/scripts/device-steps.sh +++ b/pkg/pillar/scripts/device-steps.sh @@ -155,8 +155,11 @@ populate_ntp_sources() { echo "$args" | xargs /usr/bin/chronyc -m ret_code=$? echo "$(date -Ins -u) chronyc: $ret_code" - # Init global variable - NTPSERVERS="$ns" + if [ "$ret_code" = "0" ]; then + # Init global variable only in case of success. + # In case of failure we should repeat shortly. + NTPSERVERS="$ns" + fi } # Start NTP daemon @@ -508,5 +511,5 @@ while true; do # Reload NTP sources reload_ntp_sources "$ns" fi - sleep 300 + sleep 30 done