Announcement

Collapse
No announcement yet.

Setting time on Docker LMS

Collapse
X
 
  • Filter
  • Time
  • Show
Clear All
new posts

    Setting time on Docker LMS

    With the clocks going forward last night I woke up this morning and my players were displaying as an hour behind. Is there a recommended/proper way to fix this? I can add an environment variable "TZ" and set the value as "Europe/London" which seems to work, but is that all that is needed?

    #2
    Similar but different here

    Similar here - using Docker and a late March build of 8.2.0. Time is correct on 2 x Touch units (so they have gone on to British Summer Time) but my Boom is still on GMT, so an hour behind. That has got me confused.

    If I connect the Boom to mySqueezebox.com, the time is correct but through LMS (running on a Synology DS218+), the time reverts to GMT.

    Any clues folks? TIA

    Comment


      #3
      Well.. I tried it based on post on other thread and it seems to work for Gui docker in synology . Is it correct best way? I don't know.

      DOCKER > details > terminal >create > click on bash>when command prompt type: /usr/bin/tzselect >press enter

      Select correct time zone..
      (take note of what docker TZ variable is (like Europe/London)) ..

      Stop container > edit >environment >+ >in variable colum type TZ > in value column type Europe/London >apply

      Start container
      Set alarm clock in next 2min to verify if it works


      PS I don't know if all terminal part of above steps is only to find out what to put into TZ.. Perhaps that's the case and just adding eviroment variable TZ is enough... [emoji848]
      Last edited by Jaca; 2021-03-28, 14:24.
      3x Squeezebox Touch, 4x Squeezebox Radio, Squeezelite (RPi 3B with HiFiBerry DAC+Pro on OSMC), Material Skin Apk, Squeeze Commander, Logitech Media Server Version: 8.2.0 with Material Skin (Docker in DS218+)

      Comment


        #4
        Fairly sure setting TZ as an environment variable will work well.

        That said, as a habit, if I have containers that I want to track the underlaying *NIX hosts timezone I do the following. It's also what I do with my LMS container and it seems to have worked so far .

        Setup 2 read only bind volumes for the containers pointing at the hosts /etc/localtime and /etc/timezone as below (if using the command line, adapt as needed if using a Docker GUI of some sort).

        Code:
        -v /etc/localtime:/etc/localtime:ro
        -v /etc/timezone:/etc/timezone:ro
        What this does is setup the LMS Docker container to track whatever the host is configured for regarding timezones and calculation rules. You can verify this by running up a shell on the running container and checking.

        Before:

        Code:
        [email protected]:/config# date
        Mon Mar 29 13:24:30 UTC 2021
        After:

        Code:
        [email protected]:/config# date
        Mon Mar 29 14:26:58 BST 2021
        You can see that without the tweak, it is setup to UTC in my case, after it is tracking BST as I would expect.

        For anyone that cares, /etc/timezone is a text representation of the timezone configured, and /etc/localtime is the binary rules used to calculate the time from said timezone.

        Comment


          #5
          Probably worth noting that GMT and UTC are not the same, even though in winter they do map to the same time value. To enable local time in *nix you need to copy `/usr/share/zoneinfo/<timezonestring>` to /etc/localtime. Depending on the application it may also perform its own timezone management, referencing either /etc/timezone for the system wide setting of timezonestring or a private config file (e.g. php does that).

          Comment


            #6
            Originally posted by gordonb3 View Post
            Probably worth noting that GMT and UTC are not the same, even though in winter they do map to the same time value. To enable local time in *nix you need to copy `/usr/share/zoneinfo/<timezonestring>` to /etc/localtime. Depending on the application it may also perform its own timezone management, referencing either /etc/timezone for the system wide setting of timezonestring or a private config file (e.g. php does that).
            Hmm, GMT and UTC always map to the same time value as far as I know.

            Sent from my Pixel 3a using Tapatalk
            Living Room: Touch or Squeezelite (Pi3B) > Topping E30 > Audiolab 8000A > Monitor Audio S5 + BK200-XLS DF
            Bedroom: Radio
            Bathroom: Radio

            Comment


              #7
              Originally posted by slartibartfast View Post
              Hmm, GMT and UTC always map to the same time value as far as I know.
              Semantics. GMT displays as BST when daylight saving is active. UTC is always UTC (i.e. there is no daylight saving).

              Comment


                #8
                Originally posted by Jaca View Post
                Well.. I tried it based on post on other thread and it seems to work for Gui docker in synology . Is it correct best way? I don't know.

                DOCKER &gt; details &gt; terminal &gt;create &gt; click on bash&gt;when command prompt type: /usr/bin/tzselect &gt;press enter

                Select correct time zone..
                (take note of what docker TZ variable is (like Europe/London)) ..

                Stop container &gt; edit &gt;environment &gt;+ &gt;in variable colum type TZ &gt; in value column type Europe/London &gt;apply

                Start container
                Set alarm clock in next 2min to verify if it works


                PS I don't know if all terminal part of above steps is only to find out what to put into TZ.. Perhaps that's the case and just adding eviroment variable TZ is enough... [emoji848]
                Thanks Jaca -this resolved my issue. I don't quite understand why my Touch's correctly adjusted to BST with no intervention, but the Boom needed this update to change to BST.

                Comment


                  #9
                  Originally posted by DJWillis View Post
                  Fairly sure setting TZ as an environment variable will work well.

                  That said, as a habit, if I have containers that I want to track the underlaying *NIX hosts timezone I do the following. It's also what I do with my LMS container and it seems to have worked so far .

                  Setup 2 read only bind volumes for the containers pointing at the hosts /etc/localtime and /etc/timezone as below (if using the command line, adapt as needed if using a Docker GUI of some sort).

                  Code:
                  -v /etc/localtime:/etc/localtime:ro
                  -v /etc/timezone:/etc/timezone:ro
                  What this does is setup the LMS Docker container to track whatever the host is configured for regarding timezones and calculation rules. You can verify this by running up a shell on the running container and checking.

                  Before:

                  Code:
                  [email protected]:/config# date
                  Mon Mar 29 13:24:30 UTC 2021
                  After:

                  Code:
                  [email protected]:/config# date
                  Mon Mar 29 14:26:58 BST 2021
                  You can see that without the tweak, it is setup to UTC in my case, after it is tracking BST as I would expect.

                  For anyone that cares, /etc/timezone is a text representation of the timezone configured, and /etc/localtime is the binary rules used to calculate the time from said timezone.
                  How are you setting those etc directories in Synology unless you are using command line? Those are protected directories.

                  Comment


                    #10
                    a good way would be to set a symbolic link to the /etc files in a location which is seen by synology eg /volume1/docker.....

                    then you have to still create the docker in command line, but after this you can admin via GUI and didn't loose the timezone mappings if you recreate the docker container

                    or of course you look into portainer....

                    Comment


                      #11
                      Originally posted by mamema View Post
                      a good way would be to set a symbolic link to the /etc files in a location which is seen by synology eg /volume1/docker.....

                      then you have to still create the docker in command line, but after this you can admin via GUI and didn't loose the timezone mappings if you recreate the docker container

                      or of course you look into portainer....
                      Hey that is a really good idea! Right now I am using the TZ variable and I think it is working but not 100% sure .

                      I may just very well go to portainer as I have used it before on another system....Thanks.

                      Comment


                        #12
                        Originally posted by sharkfist View Post
                        With the clocks going forward last night I woke up this morning and my players were displaying as an hour behind. Is there a recommended/proper way to fix this? I can add an environment variable "TZ" and set the value as "Europe/London" which seems to work, but is that all that is needed?
                        I think it works like this. Also the LMS container updated the change to summertime correct.

                        Comment


                          #13
                          Originally posted by Edward Lowy View Post
                          Thanks Jaca -this resolved my issue. I don't quite understand why my Touch's correctly adjusted to BST with no intervention, but the Boom needed this update to change to BST.
                          I also noticed that my Squeezebox 2 was exactly 2 hrs behind (I'm in Holland) but my SB Touch displayed the right time. I have searched everywhere, all time settings were OK on the NAS. Suspected that the problem was in Docker but had no idea where to look. So'm I'm happy with this thread and will try to set the TZ variable too.

                          Comment


                            #14
                            Thanks for this, this is what I have been looking for!
                            I would be lost without this forum!!


                            Originally posted by Jaca View Post
                            Well.. I tried it based on post on other thread and it seems to work for Gui docker in synology . Is it correct best way? I don't know.

                            Comment


                              #15
                              Brilliant.

                              thanks Jaca and the rest of you, saved me from pulling out the few strands of hair I still have. Well done.

                              Comment

                              Working...
                              X