Page 1 of 1

Synology NAS Docker - system time is GMT

Posted: Wed 13 Oct 2021 7:16 am
by MarkinNZ
Hi

I installed CMX on my Synology NAS (DSM 7.0) DS218+ following instructions in the post How to run Cumulus MX on Synology NAS using Docker viewtopic.php?p=148956#p148956. I did include the -lang en-NZ parameter to get the imported dates working (first time I forgot and history was trash!!).

I did the install between 13:20 and 13:25

My issue is that the system time is GMT - ie 12 hours behind the local time. See screen shot from the from the Monthly Data log page.
2021-10-13 14_48_02 Monthly data logs - Cumulus MX.png
Also attached are log files from the same time. You can see that log times are also 12 hours behind.

Does this matter to CMX?

Time on the NAS appears to be correct. Looks to be the time on container. Here is the container log. I tested an empty mono container and it has the same issue.
container log.png


Any ideas anyone?

Cheers

Mark

Davis Vantage Vue running Vantage Pro2 with Solar and Daytime Fan IIS
WiFi Logger2
Synology NAS DS218+ running mono in a Docker container

Re: Synology NAS Docker - system time is GMT

Posted: Wed 13 Oct 2021 7:39 am
by freddie
Looks like the timezone is incorrect in your Docker container. SSH into the container and issue the following command:

Code: Select all

timedatectl
That will display the current timezone. If it is incorrect then change it by finding your timezone in the list of available timezones:

Code: Select all

timedatectl list-timezones
Then change timezone by using the following:

Code: Select all

sudo timedatectl set-timezone <your-timezone>
where <your-timezone> will probably be Pacific/Auckland or similar.

Re: Synology NAS Docker - system time is GMT

Posted: Wed 13 Oct 2021 8:27 am
by MarkinNZ
Thanks Freddie

Yes, I can confirm that the timezone is not correct on the container. Unfortunately it it the MS mono container and the timedatecrtl "command not found" :x

"date" does return the date/time and I can see that it is set to UTC.

Does this time impact CMX - otherwise it seems to be working fine. Only the log files appear to be out of sync.

Oh and I can't update the console time from CMX - that sends the UTC time. Unticked that option :D

cheers

Mark

Re: Synology NAS Docker - system time is GMT

Posted: Wed 13 Oct 2021 8:43 am
by freddie
Yes it does impact MX. I'm surprised that command doesn't work - what Linux distro and version are you running?

Re: Synology NAS Docker - system time is GMT

Posted: Thu 14 Oct 2021 12:54 am
by MarkinNZ
Hi

I found the fix. I had to set the environment variable on the mono docker container thus:
Corrected env.png
You can do this after the container is built or you can use the revised script below.

I think that the revised deployment script is now below in include that in the initial setup if you are following the instructions referenced in the first post of this topic.

Code: Select all

sudo docker run --name CumulusMX --restart always -t -v '/volume1/opt/CumulusMX:/opt/CumulusMX' -e TZ='Pacific/Auckland' -dp 8998:8998 mono:latest /bin/sh -c 'cd /opt/CumulusMX; mono CumulusMX.exe -lang en-NZ'
FYI I didn't test this but it looks ok! I've also included the language parameter in the script as I needed this for my data migration.

cheers