Google Groups no longer supports new Usenet posts or subscriptions. Historical content remains viewable.
Dismiss

[9fans] Attempts to set timezone don't stick?

149 views
Skip to first unread message

Phineas Pett

unread,
Nov 12, 2012, 8:33:15 PM11/12/12
to
Hello List,

I'm attempting to setup a native Plan 9 system for the first time, but
I'm having a bit of trouble getting the timezone to ``stick.''

Putting the following in my /lib/profile seemed the intuitive and
correct thing to do:

bind /adm/timezone/US_Central /adm/timezone/local

But it does not work, and I don't understand why.

The following also failed:

cat /adm/timezone/US_Central > /adm/timezone/local

In desperation I set the clock to sync with a time server. This
works, but the clock only remains set for a few minutes and then it is
drastically off again until it contacts the time.

The hardware is a ThinkPad R-51.

Thanks,
Phineas

John Floren

unread,
Nov 12, 2012, 8:39:19 PM11/12/12
to
On Mon, Nov 12, 2012 at 5:33 PM, Phineas Pett <phinea...@gmail.com> wrote:
> Hello List,
>
> I'm attempting to setup a native Plan 9 system for the first time, but
> I'm having a bit of trouble getting the timezone to ``stick.''
>
> Putting the following in my /lib/profile seemed the intuitive and
> correct thing to do:
>
> bind /adm/timezone/US_Central /adm/timezone/local
>
> But it does not work, and I don't understand why.

I wouldn't expect this to work. According to date(1),
/adm/timezone/local is copied into /env/timezone by init, meaning your
bind comes far too late.

You need to physically copy the file over, and then presumably reboot
to get everything set properly.

>
> The following also failed:
>
> cat /adm/timezone/US_Central > /adm/timezone/local
>

Did you reboot after doing this?


John

Phineas Pett

unread,
Nov 12, 2012, 9:15:44 PM11/12/12
to
On 11/12/12, John Floren <jo...@jfloren.net> wrote:
> On Mon, Nov 12, 2012 at 5:33 PM, Phineas Pett <phinea...@gmail.com>
> wrote:
>> Hello List,
>>
>> I'm attempting to setup a native Plan 9 system for the first time, but
>> I'm having a bit of trouble getting the timezone to ``stick.''
>>
>> Putting the following in my /lib/profile seemed the intuitive and
>> correct thing to do:
>>
>> bind /adm/timezone/US_Central /adm/timezone/local
>>
>> But it does not work, and I don't understand why.
>
> I wouldn't expect this to work. According to date(1),
> /adm/timezone/local is copied into /env/timezone by init, meaning your
> bind comes far too late.

Ah, thanks. The manual has answered a lot of my questions so far, but
apparently I need to read more carefully; but still, if I am logged
into a remote system in a different time zone, shouldn't my client be
able to display client-local time? Is there a mechanism for that? It
seems to me that would be a logical benefit of the client having its
own view of the namespace.

Anthony Sorace

unread,
Nov 12, 2012, 9:29:08 PM11/12/12
to
On Nov 12, 2012, at 21:15 , Phineas Pett <phinea...@gmail.com> wrote:

> Ah, thanks. The manual has answered a lot of my questions so far, but
> apparently I need to read more carefully; but still, if I am logged
> into a remote system in a different time zone, shouldn't my client be
> able to display client-local time? Is there a mechanism for that? It
> seems to me that would be a logical benefit of the client having its
> own view of the namespace.

You can do that, if you really want. Observe the following:

: root; date
Mon Nov 12 21:24:49 EST 2012
: root; bind /adm/timezone/US_Hawaii /adm/timezone/local
: root; date
Mon Nov 12 21:25:21 EST 2012
: root; cp /adm/timezone/local /env/timezone
: root; date
Mon Nov 12 16:25:30 HST 2012

(the bind isn't needed, you can copy directly; it's just there for illustration)

Note, however, that everything started before you do this will have the old
idea about the timezone. Personally, when I've been in that situation, I've
found the cost of getting confused between, say, what a log file says
versus what 'date' says to be more problematic than just remembering that
I'm (virtually) in Japan.

Anthony

Phineas Pett

unread,
Nov 12, 2012, 9:36:15 PM11/12/12
to
Ok thanks to both of you! I may have been too hasty responding
earlier, I apologize for that.

Running a single aux/timesync process from profile now keeps the clock
steadily set.

And a simple

cat /adm/timezone/[timezone] > /env/timezone

in the profile can set an arbitrary timezone locally.

Phineas

0 new messages