Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

wpdev.sh: sync_time_ntp() should use chronyc makestep (maybe not) #37

Open
joshschmelzle opened this issue Feb 6, 2024 · 2 comments
Open
Labels
enhancement New feature or request

Comments

@joshschmelzle
Copy link
Member

So that this comment doesn't get burried.

sync_time_ntp(){
    echo "Time before sync: $(date)"
    sudo systemctl restart chronyd
    sleep 8
    echo "Time after sync: $(date)"
}

This should use sudo chronyc makestep or sudo chronyc -a makestep to step the system clock immediately rather than restarting chronyd and adding an arbitary sleep period.

@joshschmelzle joshschmelzle added the enhancement New feature or request label Feb 6, 2024
@joshschmelzle
Copy link
Member Author

joshschmelzle commented Feb 16, 2024

I was just testing sudo chronyc makestep on the latest image from an R4 powered via OTG.

I flashed the microSD. Booted the R4 without Ethernet. Connected the USB NIC to the Wi-Fi via wpa_supplicant.

chronyc makestep wasn't stepping the time to the current time correctly, but restarting chronyd did.

@joshschmelzle joshschmelzle changed the title wpdev.sh: sync_time_ntp() should use chronyc makestep wpdev.sh: sync_time_ntp() should use chronyc makestep (maybe not) Feb 16, 2024
@jiribrejcha
Copy link
Member

I got the exact same behaviour on M4 as you @joshschmelzle. Decided to restart the chronyd service instead, which worked just fine.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
enhancement New feature or request
Projects
None yet
Development

No branches or pull requests

2 participants