XCP-ng
    • Categories
    • Recent
    • Tags
    • Popular
    • Users
    • Groups
    • Register
    • Login

    Incorret time in bash-prompt and logs on XOA

    Scheduled Pinned Locked Moved Solved Management
    8 Posts 4 Posters 735 Views 4 Watching
    Loading More Posts
    • Oldest to Newest
    • Newest to Oldest
    • Most Votes
    Reply
    • Reply as topic
    Log in to reply
    This topic has been deleted. Only users with topic management privileges can see it.
    • BytevenidosB Offline
      Bytevenidos
      last edited by Bytevenidos

      Hello, the time looks correct when i run timedatectl. However, you can see that that the time in my bash prompt is not correct. This is in a different timezone. The logs are also an hour off. Is this a bug? I can't find a time setting inside XOA. How does the env variable get updated?

      [14:21 18] xoa@xoa:~$ timedatectl
                     Local time: Sat 2025-10-18 15:24:17 EDT
                 Universal time: Sat 2025-10-18 19:24:17 UTC
                       RTC time: Sat 2025-10-18 19:24:17
                      Time zone: US/Eastern (EDT, -0400)
      System clock synchronized: yes
                    NTP service: active
                RTC in local TZ: no
      [14:24 18] xoa@xoa:~$ 
      
      [14:24 18] xoa@xoa:~$ echo $TZ
      EST
      [14:24 18] xoa@xoa:~$ 
      
      [14:24 18] xoa@xoa:~$ last reboot
      reboot   system boot  6.1.0-40-amd64   Sat Oct 18 14:16   still running
      reboot   system boot  6.1.0-40-amd64   Sat Oct 18 14:14 - 14:15  (00:01)
      reboot   system boot  6.1.0-40-amd64   Fri Oct 17 20:24 - 08:55  (12:30)
      reboot   system boot  6.1.0-40-amd64   Fri Oct 17 20:21 - 20:24  (00:03)
      reboot   system boot  6.1.0-40-amd64   Fri Oct 17 20:12 - 20:20  (00:08)
      
      1 Reply Last reply Reply Quote 0
      • BytevenidosB Offline
        Bytevenidos @Danp
        last edited by

        @Danp Yup, that fixed the time and the logs also. Thanks!

        [12:42 19] xoa@xoa:~$ timedatectl
                       Local time: Sun 2025-10-19 12:42:55 EDT
                   Universal time: Sun 2025-10-19 16:42:55 UTC
                         RTC time: Sun 2025-10-19 16:42:55
                        Time zone: America/New_York (EDT, -0400)
        System clock synchronized: yes
                      NTP service: active
                  RTC in local TZ: no
        [12:42 19] xoa@xoa:~$ last reboot
        reboot   system boot  6.1.0-40-amd64   Sun Oct 19 12:42   still running
        reboot   system boot  6.1.0-40-amd64   Sun Oct 19 08:27 - 12:42  (04:15)
        reboot   system boot  6.1.0-40-amd64   Sun Oct 19 08:18 - 08:26  (00:08)
        reboot   system boot  6.1.0-40-amd64   Sat Oct 18 15:16 - 08:17  (17:01)
        
        1 Reply Last reply Reply Quote 1
        • olivierlambertO Offline
          olivierlambert Vates 🪐 Co-Founder CEO
          last edited by

          Hi,

          Have you checked https://docs.xen-orchestra.com/xoa#timezone ?

          BytevenidosB 1 Reply Last reply Reply Quote 0
          • BytevenidosB Offline
            Bytevenidos @olivierlambert
            last edited by

            @olivierlambert

            I ran that tool and tried both the US/Eastern and America/New_York but I'm still getting a time zone that does not account for daylight savings time. I did reboot inbetween each different sudo dpkg-reconfigure tzdata region selection.

            [07:22 19] xoa@xoa:timesyncd.conf.d$ sudo dpkg-reconfigure tzdata
            
            Current default time zone: 'US/Eastern'
            Local time is now:      Sun Oct 19 08:23:19 EDT 2025.
            Universal Time is now:  Sun Oct 19 12:23:19 UTC 2025.
            
            [07:24 19] xoa@xoa:timesyncd.conf.d$ sudo dpkg-reconfigure tzdata
            
            Current default time zone: 'America/New_York'
            Local time is now:      Sun Oct 19 08:25:59 EDT 2025.
            Universal Time is now:  Sun Oct 19 12:25:59 UTC 2025.
            
            [07:27 19] xoa@xoa:~$ date
            Sun Oct 19 07:27:30 AM EST 2025
            [07:27 19] xoa@xoa:~$ last reboot
            reboot   system boot  6.1.0-40-amd64   Sun Oct 19 07:27   still running
            reboot   system boot  6.1.0-40-amd64   Sun Oct 19 07:18 - 07:26  (00:08)
            
            
            1 Reply Last reply Reply Quote 0
            • olivierlambertO Offline
              olivierlambert Vates 🪐 Co-Founder CEO
              last edited by

              Have you checked timesync? (the paragraph after in the doc)

              1 Reply Last reply Reply Quote 0
              • DanpD Offline
                Danp Pro Support Team
                last edited by

                The bash prompt may be displaying the incorrect time due to these lines in /etc/bash.bashrc --

                # Default user timezone is EST
                if [ -z "$TZ" ]
                then
                  export TZ=EST
                fi
                

                Are you getting the expected result if you comment out this section of code and then reboot?

                ForzaF BytevenidosB 2 Replies Last reply Reply Quote 1
                • ForzaF Offline
                  Forza @Danp
                  last edited by

                  @Danp said in Incorret time in bash-prompt and logs on XOA:

                  The bash prompt may be displaying the incorrect time due to these lines in /etc/bash.bashrc --

                  # Default user timezone is EST
                  if [ -z "$TZ" ]
                  then
                    export TZ=EST
                  fi
                  

                  Are you getting the expected result if you comment out this section of code and then reboot?

                  Had the same issue myself, and removing that helped.

                  1 Reply Last reply Reply Quote 0
                  • olivierlambertO Offline
                    olivierlambert Vates 🪐 Co-Founder CEO
                    last edited by

                    Interesting. Let me add @Team-DevOps so we might improve the bashrc

                    1 Reply Last reply Reply Quote 0
                    • BytevenidosB Offline
                      Bytevenidos @Danp
                      last edited by

                      @Danp Yup, that fixed the time and the logs also. Thanks!

                      [12:42 19] xoa@xoa:~$ timedatectl
                                     Local time: Sun 2025-10-19 12:42:55 EDT
                                 Universal time: Sun 2025-10-19 16:42:55 UTC
                                       RTC time: Sun 2025-10-19 16:42:55
                                      Time zone: America/New_York (EDT, -0400)
                      System clock synchronized: yes
                                    NTP service: active
                                RTC in local TZ: no
                      [12:42 19] xoa@xoa:~$ last reboot
                      reboot   system boot  6.1.0-40-amd64   Sun Oct 19 12:42   still running
                      reboot   system boot  6.1.0-40-amd64   Sun Oct 19 08:27 - 12:42  (04:15)
                      reboot   system boot  6.1.0-40-amd64   Sun Oct 19 08:18 - 08:26  (00:08)
                      reboot   system boot  6.1.0-40-amd64   Sat Oct 18 15:16 - 08:17  (17:01)
                      
                      1 Reply Last reply Reply Quote 1
                      • olivierlambertO olivierlambert marked this topic as a question on
                      • olivierlambertO olivierlambert has marked this topic as solved on

                      Hello! It looks like you're interested in this conversation, but you don't have an account yet.

                      Getting fed up of having to scroll through the same posts each visit? When you register for an account, you'll always come back to exactly where you were before, and choose to be notified of new replies (either via email, or push notification). You'll also be able to save bookmarks and upvote posts to show your appreciation to other community members.

                      With your input, this post could be even better 💗

                      Register Login
                      • First post
                        Last post