I am using Openwrt 18.06-SNAPSHOT with BusyBox v1.28.3
The system is configured to get clock over NTP using "ntpd" package. It has been working fine until today.
Issue 1:
During debugging I found that system is generating the error "sysntpd not found".
What could be the reason for this error? How can I fix this?
Issue 2:
The rc.local file has the following:
# Put your custom commands here that should be executed once
# the system init finished. By default this file does nothing
/etc/init.d/cvScript start
/etc/init.d/sysntpd disable
/etc/init.d/ntpd enable
/etc/init.d/ntpd start
exit 0
When I run the same commands on the command line it works fine with no problem.
Note:
The system connects with the server and updates data to it after reboot.
When I perform "opkg update", I get the following:
* opkg_download: Failed to download http://downloads.openwrt.org/releases/18.06-SNAPSHOT/packages/mipsel_24kc/telephony/Packages.gz, wget returned 4.
* opkg_download: Check your network settings and connectivity.
I am unable to ping the server from the system. I am not sure how it is unable to ping the server it is sending the data to.
"opkg update" and "ntpd" used to work fine before. Is it because of firewall setting?
# Put your custom commands here that should be executed once
# the system init finished. By default this file does nothing
/etc/init.d/cvScript start
/etc/init.d/sysntpd disable
/etc/init.d/ntpd enable
/etc/init.d/ntpd start
exit 0
The system does not obtain time from network after reboot. It gives me error code 5 when I execute "ntptime".
When I run all the commands in the command line with prefix "/etc/init.d", the "ntptime" works fine and the return code is 0.
Resolved the ntp issue by moving the application script startup to the end of rc.local file.
# Put your custom commands here that should be executed once
# the system init finished. By default this file does nothing
#/etc/init.d/cvScript start
/etc/init.d/sysntpd disable
/etc/init.d/ntpd enable
/etc/init.d/ntpd start
/etc/init.d/cvScript start
exit 0
I was able to see the ntp process running using "ps" command before and after the change was made. Cannot understand how this change made it work.
I updated the application to previous stable release to check if something in the application affected it, but that did not help. Only moving the application script to the end of "rc.local" makes the ntp time work.
Looks like something is taking time to initialize and in the meantime the "ntp" times out.
May be some file configuration was changed or corrupted/ kernel was updated. Could someone throw some light on this issue?
Thank you. I tried your suggestion. The unit does not obtain "ntp tine" from the NTP server but the application starts up and works fine. It communicates correctly with the server.
"opkg update" is still not working.
Thanks @tmomas, vgaetera. I tried, still the unit does not get the time from NTP server but the application starts up fine.
Also, I found some subtle difference between the kernel on this unit and the ones that I have used before. In the root folder, there are some userspace folders which were not therebefore.
As the kernel is done by third-party I have referred it to them on the basis that it was working before and the application has not changed.