You are not logged in.

#1 2015-11-30 18:49:05

kde35
Member
Registered: 2015-04-13
Posts: 67

How to set timezone from chroot? (tzselect makes no effect). [solved]

Hi, I am new to archlinux.  I have installed Archlinux 2015.11.01 under chroot with host OS Mandriva 2010.
Somehow I have been unable to make it boot with GRUB yet, but this is not the issue I would like to discuss
(and I would be posting in a wrong forum).

My main concern for now is that the timezone is set to UTC, and I can't change.  If I do

 timedatectl

then I get

Failed to create bus connection: No such file or directory

How do I work around this?  Should I mount /var/run/bus of the host under chroot?

Thank you in advance

Last edited by kde35 (2015-12-01 05:50:43)

Offline

#2 2015-11-30 18:51:44

Scimmia
Fellow
Registered: 2012-09-01
Posts: 9,290

Re: How to set timezone from chroot? (tzselect makes no effect). [solved]

Check the Beginner's Guide

Offline

#3 2015-11-30 21:29:50

cafe
Member
Registered: 2014-03-20
Posts: 156

Re: How to set timezone from chroot? (tzselect makes no effect). [solved]

I wouldn't recommend the beginner's guide for a chroot install. If you want more insights on the differences between hardware clock and software clock I suggest you to take a look at the wiki page https://wiki.archlinux.org/Time.

Software clock reads /etc/adjtime to know if your hardware clock is set to local or utc. Maybe you just need to create it with

0.0 0 0
0
LOCAL

Make sure you understand those numbers before..

Cheers

Last edited by cafe (2015-12-01 10:55:46)

Offline

#4 2015-11-30 21:40:28

Scimmia
Fellow
Registered: 2012-09-01
Posts: 9,290

Re: How to set timezone from chroot? (tzselect makes no effect). [solved]

The Beginner's Guide answers this question directly. Of course, if you're just entering the chroot instead of using systemd-nspawn or similar, the symlink probably may not make a difference.

Last edited by Scimmia (2015-11-30 21:44:39)

Offline

#5 2015-12-01 05:28:13

kde35
Member
Registered: 2015-04-13
Posts: 67

Re: How to set timezone from chroot? (tzselect makes no effect). [solved]

Scimmia wrote:

The Beginner's Guide answers this question directly. Of course, if you're just entering the chroot instead of using systemd-nspawn or similar, the symlink probably may not make a difference.

Thank you, somehow googling didn't get me to the right page.

However, I get

[root@localhost etc]# tzselect
Please identify a location so that time zone rules can be set correctly.
Please select a continent, ocean, "coord", or "TZ".
 1) Africa
 2) Americas
 3) Antarctica
 4) Arctic Ocean
 5) Asia
 6) Atlantic Ocean
 7) Australia
 8) Europe
 9) Indian Ocean
10) Pacific Ocean
11) coord - I want to use geographical coordinates.
12) TZ - I want to specify the time zone using the Posix TZ format.
#? 8
Please select a country whose clocks agree with yours.
 1) Åland Islands         18) Greece                35) Norway
 2) Albania               19) Guernsey              36) Poland
 3) Andorra               20) Hungary               37) Portugal
 4) Austria               21) Ireland               38) Romania
 5 Belarus               22) Isle of Man           39) Russia
 6) Belgium               23) Italy                 40) San Marino
 7) Bosnia & Herzegovina  24) Jersey                41) Serbia
 8) Britain (UK)          25) Latvia                42) Slovakia
 9) Bulgaria              26) Liechtenstein         43) Slovenia
10) Croatia               27) Lithuania             44) Spain
11) Czech Republic        28) Luxembourg            45) Sweden
12) Denmark               29) Macedonia             46) Switzerland
13) Estonia               30) Malta                 47) Turkey
14) Finland               31) Moldova               48) Ukraine
15) France                32) Monaco                49) Vatican City
16) Germany               33) Montenegro
17) Gibraltar             34) Netherlands
#? 15

The following information has been given:

        France

Therefore TZ='Europe/Paris' will be used.
Local time is now:      Tue Dec  1 06:22:54 CET 2015.
Universal Time is now:  Tue Dec  1 05:22:54 UTC 2015.
Is the above information OK?
1) Yes
2) No
#? 1

You can make this change permanent for yourself by appending the line
        TZ='Europe/Paris'; export TZ
to the file '.profile' in your home directory; then log out and log in again.

Here is that TZ value again, this time on standard output so that you
can use the /sbin/tzselect command in shell scripts:
Europe/Paris
[root@localhost etc]# date
Tue Dec  1 05:23:04 UTC 2015

Offline

#6 2015-12-01 05:31:30

Scimmia
Fellow
Registered: 2012-09-01
Posts: 9,290

Re: How to set timezone from chroot? (tzselect makes no effect). [solved]

So you didn't create the symlink?

Offline

#7 2015-12-01 05:43:50

kde35
Member
Registered: 2015-04-13
Posts: 67

Re: How to set timezone from chroot? (tzselect makes no effect). [solved]

cafe wrote:

I wouldn't recommend the beginner's guide for a chroot install. If you want more insights on the differences between hardware clock and software clock I suggest you to take a look at the wiki page https://wiki.archlinux.org/Time.

Thank you very much,  I had read the page, and that is why I thought the command I needed was datetimectl

cafe wrote:

Software clock reads /etc/adjtime to know if your hardware clock is set to local or utc. Maybe you just need to create it with

 
0.0 0 0
0
LOCAL

Make sure you understand those numbers before..

Cheers

I copied the /etc/adjtime file from the host to chroot, but I still keep getting the output of

date

in UTC, not in local time.

Offline

#8 2015-12-01 05:49:50

kde35
Member
Registered: 2015-04-13
Posts: 67

Re: How to set timezone from chroot? (tzselect makes no effect). [solved]

Scimmia wrote:

So you didn't create the symlink?

Oops...  Actually the symlink had been created during installation pointing to Zone instead of Subzone.  So I removed it and made it point to the Subzone,
now I get the correct date.  Thank you very much for your patience.

Offline

Board footer

Powered by FluxBB