Community discussions

MikroTik App
 
lnc1995
just joined
Topic Author
Posts: 7
Joined: Sat Dec 10, 2022 1:48 am

Container can not start due to UTC time!

Sat Dec 10, 2022 2:32 am

Here's my situation:I installed an Adguardhome as local DNS server,and set a domain NTP server,when ROS boot,it will read BIOS time and handle the time to UTC 00:00 time ,So Adguardhome can not start because of the wrong time,then NTP client can not work because Adguardhome not start,then time can not be change right forever...
I changed an IP NTP server , it does work.But the system still log the wrong time until the NTP worked.
Many Linux OS do this too,but they can change some settings or edit system files to use localtime .Can ROS add an option to solve this?
Last edited by lnc1995 on Mon Nov 20, 2023 5:46 pm, edited 1 time in total.
 
User avatar
mkx
Forum Guru
Forum Guru
Posts: 11629
Joined: Thu Mar 03, 2016 10:23 pm

Re: Container can not start due to UTC time!

Sat Dec 10, 2022 12:02 pm

Most ROS devices (unlike PCs) don't have real time clock. So when ROS boots it can't get (a good approximation of) correct local time from very start. It reverts to timestamp of certain files (which get updated frequently) meaning that after normal reboot time will be some 10s of seconds in the past. After netinstall this is not the case, so device will start with Unix time 0 (1st of January 1970 0:00:00 UTC). If actual time matters, external time source needs to be used (e.g. NTP time servers). It is important to understand that it takes some time (up to a few minutes) for NTP to do final adjustments of time and this is perfectly normal.
Linux keeps time in UTC internally, so do ROS devices, and formatting with local time is purely cosmetics of displaying time stamps.

As to the problems of adguard container starting: containers don't keep their time separately from host OS. If particular service is sensitive to clearly erroneous time stamps, then you have to delay start of such service until host system (router) has time issues solved. You can check if NTP server is content with own status by querying NTP server status.

BTW UTC 00:00 time is not the result of timezone problems, it's result of router not having slightest idea about actual time (as explained earlier). Some services (in general) sometimes play smart and complain if local time is behind timestamps of certain files. So it is important to have correct time every time (also while installing a container for example). I'm not saying adguard is one of these services, just mentioning that such problems exist.

Who is online

Users browsing this forum: alixviral, Bing [Bot], holla29, sjdurand and 221 guests