Changed RT clock to UTC - but time is wrong on startup

Over the past month I changed our home PC’s to be solely OpenSUSE 11.4 (we hardly use the other OS anymore, I relegated it to a vbox, and we have an old laptop should firmware upgrades for phones etc ever require a real non-Linux PC).

Having made the change, I figured I’d also change the PC clock to use UTC. I used yast2 to change my existing 11.4 desktop clock to UTC and changed the TC clock to the right UTC time. I noticed after rebooting that date was showing the UTC value instead of localtime (TIMEZONE) value.

Looking at /etc/init.d/boot.clock and /etc/sysconfig/clock it seems that yast2 should have run /sbin/refresh_initrd to adjust the kernel so that hwclock --systz on bootup will do the right thing. I ran refresh_initrd and all is now well. Questions…

  1. Were my deductions correct?
  2. Is this a bug with yast2?

On 2011-12-05 02:36, mchnz wrote:
>
> Over the past month I changed our home PC’s to be solely OpenSUSE 11.4
> (we hardly use the other OS anymore, I relegated it to a vbox, and we
> have an old laptop should firmware upgrades for phones etc ever require
> a real non-Linux PC).
>
> Having made the change, I figured I’d also change the PC clock to use
> UTC. I used yast2 to change my existing 11.4 desktop clock to UTC and
> changed the TC clock to the right UTC time. I noticed after rebooting
> that date was showing the UTC value instead of localtime (TIMEZONE)
> value.

At this point, I delete /etc/adjtime, so that the system recreates it.

> Looking at /etc/init.d/boot.clock and /etc/sysconfig/clock it seems
> that yast2 should have run /sbin/refresh_initrd to adjust the kernel so
> that hwclock --systz on bootup will do the right thing. I ran
> refresh_initrd and all is now well. Questions…
>
> 1) Were my deductions correct?
> 2) Is this a bug with yast2?

Good question.

I would report in Bugzilla, and lets them decide.


Cheers / Saludos,

Carlos E. R.
(from 11.4 x86_64 “Celadon” at Telcontar)

12.1 does the same thing.

It is not completely clear what you have done here.

From a terminal, I did:


$ printenv TZ

$ date
Wed Feb  1 21:31:43 CST 2012

$ grep HWCLOCK /etc/sysconfig/clock
HWCLOCK="-u"

The first of those shows that TZ is not defined in my environment (the empty line of output)
The second shows that the date is using CST. Since TZ is not defined, my localtime is properly set to CST (or US/Central).
The third shows that the hardware clock is set to use UTC.

Everything works fine set this way. The desktop clock is showing local time (CST). If I define TZ (in the environment) in my “.profile”, that will change the desktop displayed time – I do that when travelling to a different timezone, so that I don’t have to change the system time definition.

Maybe you could run the same three commands and post the output, so we can see something about how your system is configured.

On 2012-02-02 04:46, nrickert wrote:
> Everything works fine set this way. The desktop clock is showing local
> time (CST). If I define TZ (in the environment) in my “.profile”, that
> will change the desktop displayed time – I do that when travelling to a
> different timezone, so that I don’t have to change the system time
> definition.

In fact, you can have a dozen users each using their own timezone. No problem.


Cheers / Saludos,

Carlos E. R.
(from 11.4 x86_64 “Celadon” at Telcontar)