Assume hardware clock is set to local time on live CD?

Bug #14241 reported by Mikel Ward
6
Affects Status Importance Assigned to Milestone
casper (Ubuntu)
Fix Released
Wishlist
Matt Zimmerman

Bug Description

The live CD apparently still performs an NTP time synchronisation as part of the
initialisation process. Unfortunately, it sets the system's BIOS clock to the
current UTC time, which is very annoying for people running another operating
system on the same system.

Please either disable the time synchronisation or ask the user for the local
time zone and whether to set the BIOS clock to local or universal time.

Revision history for this message
Matt Zimmerman (mdz) wrote :

The hardware clock is only updated at shutdown, and this is explicitly disabled
on the live CD in order to avoid exactly this problem. Please explain the
behavior you saw.

Revision history for this message
Mikel Ward (mikelward) wrote :

Before entering the graphical user interface, there was some mention of
synchronising the time with ntp.ubuntulinux.org or similar.

Once in the GUI, the time was displayed in UTC, which was incorrect, so I
changed the time zone using the KDE preferences. I think I needed to change it
in two places, beginning in the context menu on the clock applet in the panel.

I don't recall any shutdown rc message stating that my system clock was being
set, but upon rebooting to Windows XP, my system clock was 11 hours behind my
local time zone, indicating that it had been reset to UTC.

It is pointless for the clock to be synchronised if it doesn't properly allow
for local time zones.

I saw this most recently on the Kubuntu Hoary Preview Live CD, but I also
experienced the same problem on the Ubuntu Hoary Array 5.04 Live CD, which
suggests the problem is in the live CD infrastructure rather than anything
pecular to either GNOME or KDE.

Revision history for this message
Matt Zimmerman (mdz) wrote :

I wonder if the time applet updates the hardware clock...it probably shouldn't,
at least on the live CD

Revision history for this message
Sebastien Bacher (seb128) wrote :

I don't know for the KDE parts but the clock applet for GNOME run as an user and
doesn't change that.

Revision history for this message
Mikel Ward (mikelward) wrote :

Trying Ubuntu with GNOME again:

Before correcting the clock:
ubuntu@pepper:~$ date
Sun Mar 20 00:47:15 UTC 2005
ubuntu@pepper:~$ hwclock -r
Sun 20 Mar 2005 11:47:56 UTC -0.894950 seconds

After correcting the clock:
ubuntu@pepper:~$ date
Sun Mar 20 11:49:39 EST 2005
ubuntu@pepper:~$ hwclock -r
Sun 20 Mar 2005 11:48:43 EST -0.665632 seconds

The fact that hwclock performs translation for the time zone is concerning. It
probably assumes that the BIOS clock is in UTC. It seems that setting the clock
in GNOME *does* set the hardware clock.

I maintain that it's pointless to unconditionally synchronise the time to UTC on
the live CD. This will only be correct for a small portion of your user base.

I also notice that the GNOME clock applet does not update when the time zone is
changed (despite it having been done via a context menu on the clock!). I had
to remove it and re-add it for it to display in local time.

The only usual purpose I can think of for accurately synchronising time is to
ensure that all systems (especially on the LAN) maintain the same time so that
file's timestamps are consistent and so on. In this case, it would be far
better to synchronise against the local network's NTP server (advertised using
DHCP) in preference to a global time server. It's also not very useful, since
NFS doesn't work well, and I doubt other distributed file systems (AFS, DFS,
Coda, etc.) are supported by default on the live CD.

If it is necessary to synchronise the time, the user must be asked for the
correct time zone (for both time display and hardware clock storage) or maybe
the hardware clock offset could be guessed based on its previous and updated values.

Revision history for this message
Matt Zimmerman (mdz) wrote :

Sebastien, is there a way to disable this behaviour for the live CD?

Revision history for this message
Matt Zimmerman (mdz) wrote :

(In reply to comment #5)
> The fact that hwclock performs translation for the time zone is concerning. It
> probably assumes that the BIOS clock is in UTC. It seems that setting the clock
> in GNOME *does* set the hardware clock.

It does not assume that the BIOS clock is in UTC; see the man page (--utc and
--localtime).

> I maintain that it's pointless to unconditionally synchronise the time to UTC on
> the live CD. This will only be correct for a small portion of your user base.

It is not pointless; it is important to have the correct time set in the system
clock.
This ensures that when you write files to a disk, they have the correct
timestamp, when you use a web browser, it can interpret Expires headers
correctly, and a variety of other things which assume that the system time is
correct.

UTC is used because to do otherwise would require asking the user which time
zone to use, which is undesirable for a live CD (where it usually doesn't matter).

> I also notice that the GNOME clock applet does not update when the time zone is
> changed (despite it having been done via a context menu on the clock!). I had
> to remove it and re-add it for it to display in local time.

bug #11629

> If it is necessary to synchronise the time, the user must be asked for the
> correct time zone (for both time display and hardware clock storage) or maybe
> the hardware clock offset could be guessed based on its previous and updated
values.

If there is a bug here, it is that the time setting tool makes it easy for the
user to inadvertently clobber their hardware clock with the wrong time. There
is no reason not to set the correct time in the system clock, and good reasons
to do so.

Revision history for this message
Sebastien Bacher (seb128) wrote :

(In reply to comment #6)
> Sebastien, is there a way to disable this behaviour for the live CD?

What do you want to change ? I'm pretty sure than GNOME doesn't change anything.
An user can set the clock ?

Revision history for this message
Matt Zimmerman (mdz) wrote :

(In reply to comment #8)
> (In reply to comment #6)
> > Sebastien, is there a way to disable this behaviour for the live CD?
>
> What do you want to change ? I'm pretty sure than GNOME doesn't change anything.
> An user can set the clock ?
>

if you right-click on the clock and select "adjust date & time" a program is
launched as root which can set the clock

Revision history for this message
Mikel Ward (mikelward) wrote :

I'm happy for you to synchronise my system time, but until:
- you correctly show my local time in the GNOME clock applet
- do not clobber my hardware clock with an erroneous time
you can leave my time alone.

It is such an obvious problem that novice users will notice.

Revision history for this message
Mikel Ward (mikelward) wrote :

hwclock with no options defaults to whichever of --utc or --localtime was most
recently used to set the hardware clock.

Since "hwclock" and "hwclock --utc" both show the same result, it is Ubuntu that
assumes the hardware clock is in UTC when (presumably) using hwclock to
synchronise the hardware clock to the software clock when the clock is changed.

For a permanent desktop installation, this is tolerable as it can be corrected
once and it will remain so. On a live CD, it is not desireable. In either
scenario, blindly assuming UTC is inappropriate when it can be set at install time.

Revision history for this message
Mikel Ward (mikelward) wrote :

Matt:
You would unconditionally set the clock to a known incorrect (UTC) time rather
than use a possibly correct (hardware clock) time?!

Perhaps it's because many of the developers are using British Standard Time and
coincidentally receive the correct time that you're not aware of the
pervasiveness of this bug.

The core problem remains:
When I get my new shiny Ubuntu desktop, the current local time is 12:41, yet the
GNOME clock says 01:41.

Revision history for this message
Matt Zimmerman (mdz) wrote :

(In reply to comment #11)
> For a permanent desktop installation, this is tolerable as it can be corrected
> once and it will remain so. On a live CD, it is not desireable. In either
> scenario, blindly assuming UTC is inappropriate when it can be set at install
time.

It is too much of a burden to demand that the user set their time zone in order
to use the live CD; no other live CD I have seen does this. UTC is as good a
default as any (indeed, better than most).

Feel free to raise this for discussion on the ubuntu-devel mailing list; this
bug is not the right place to discuss it.

Revision history for this message
Matt Zimmerman (mdz) wrote :

(In reply to comment #12)
> Matt:
> You would unconditionally set the clock to a known incorrect (UTC) time rather
> than use a possibly correct (hardware clock) time?!

No. The system clock (which is always UTC) is set to the correct time based on
a network source, and the system time zone is assumed to be UTC.

> The core problem remains:
> When I get my new shiny Ubuntu desktop, the current local time is 12:41, yet the
> GNOME clock says 01:41.

That is impossible to "fix" without asking the user what time zone they are in.
 All live CDs share this problem.

Again, the place for discussion is ubuntu-devel.

Revision history for this message
Sebastien Bacher (seb128) wrote :

(In reply to comment #9)

> if you right-click on the clock and select "adjust date & time" a program is
> launched as root which can set the clock

I've misunderstood the bug. GNOME is not changing the clock, the user do that.
What do you want to do ? Change the tools to not set the computer clock ?

Revision history for this message
Mikel Ward (mikelward) wrote :

There is nothing to discuss: The system time is incorrect.

No other live CD I have encountered has this problem.

You may wish to discuss the correct implementation of time synchronisation on
ubuntu-devel but please don't change my time until this is implemented properly.

Revision history for this message
Matt Zimmerman (mdz) wrote :

(In reply to comment #15)
> (In reply to comment #9)
>
> > if you right-click on the clock and select "adjust date & time" a program is
> > launched as root which can set the clock
>
> I've misunderstood the bug. GNOME is not changing the clock, the user do that.
> What do you want to do ? Change the tools to not set the computer clock ?

I'm asking if there is a way to have it change the system clock *only*, and not
update the hardware clock (this is done normally at shutdown anyway)

Revision history for this message
Mikel Ward (mikelward) wrote :

Sebastian:
Yes. If the live CD does not ask the user for local time conventions, it is
unsafe to perform any operation modifying the local clock, including:
- synchronising the software clock when the UTC offset is not know (results in
obviously incorrect display of time)
- synchronising the hardware clock

Revision history for this message
Mikel Ward (mikelward) wrote :

I'm glad you agree the live CD should not modify my hardware clock, but I'm a
little disappointed you can't see my point that the user expects to see the
system time match the current local time.

Hopefully you will reconsider this position at a later date.

Revision history for this message
Matt Zimmerman (mdz) wrote :

(In reply to comment #19)
> I'm glad you agree the live CD should not modify my hardware clock, but I'm a
> little disappointed you can't see my point that the user expects to see the
> system time match the current local time.

I do see your point, and I do wish that you would discuss this with us in the
appropriate forum.

To post a comment you must log in.
This report contains Public information  
Everyone can see this information.

Other bug subscribers

Remote bug watches

Bug watches keep track of this bug in other bug trackers.