Ask user if hardware clock should be on UTC

Bug #8088 reported by Sebastian Breier
26
Affects Status Importance Assigned to Milestone
base-config (Ubuntu)
Fix Released
Low
Colin Watson

Bug Description

I got Ubuntu in dual boot with Windows 2000.

When I ran Ubuntu and then booted to Windows, the time was off by 2 hours. Since
I have several Debian systems I knew that the hardware clock can be run on the
set time zone or on UTC.

Ubuntu uses UTC for the hardware clock, which is okay on a Ubuntu-only or
Linux-only system (file /etc/defaults/rcS: UTC="yes").

My suggestion is that before Ubuntu changes the system clock in this way, it
should ask the user. So either the user should be asked, as it is being done in
Debian installations, or the system clock should always be on the local timezone.

Another possibility would be to stay the way it is, but have an option in one of
the settings programs to change hardware clock behavior.

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

This was discussed recently, and the consensus seemed to be that a smart default
would be to use UTC if there were no Windows operating systems on the computer,
and local time if Windows is present.

Revision history for this message
Colin Watson (cjwatson) wrote :

I think I'd err towards using UTC without asking if Ubuntu is the only operating
system on the disk, and asking otherwise (you might well have another GNU/Linux
installation that you've configured to use local time). This doesn't necessarily
have to conflict with Matt's comments about defaults.

We'll need to make something in d-i figure this out from os-prober (probably in
prebaseconfig, before unmounting the installed system; the various bootloader
installers already run os-prober, but I'd rather not modify each of them one by
one), stash it in debconf, and fish it out again in base-config.

Revision history for this message
Stuart Bishop (stub) wrote :

Setting the clock to UTC is making the assumtion that windows, or other i386
based OS, will never be installed on that hardware in the future.

Is there anything *wrong* with sticking to localtime + is_dst on an i386 system?
(or am I wrong in thinking that the time is stored as epoch + a boolean dst bit?)

Windows XP boxes will generally reset their time to a timeserver. Ubuntu's
default NTP setup will refuse to change this in most timezones because the delta
is too great. The end result looks like Ubuntu is broken.

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

(In reply to comment #3)
> Setting the clock to UTC is making the assumtion that windows, or other i386
> based OS, will never be installed on that hardware in the future.

Windows, or perhaps OS/2. There are actually more i386 operating systems which
use UTC than not (Linux, all of the BSDs, Solaris/x86). It really is the more
sensible approach.

> Is there anything *wrong* with sticking to localtime + is_dst on an i386 system?
> (or am I wrong in thinking that the time is stored as epoch + a boolean dst bit?)

I have never seen an i386 system capable of keeping track of DST in the hardware
clock. The information just isn't there.

> Windows XP boxes will generally reset their time to a timeserver. Ubuntu's
> default NTP setup will refuse to change this in most timezones because the
> delta is too great. The end result looks like Ubuntu is broken.

Perhaps you're confusing ntpdate with ntpd? The default setup in Ubuntu uses
ntpdate, which doesn't care one whit if you want to skew your clock by seconds
or years.

Here's some information on the subject of storing time in the hardware clock:

http://www.linux.org/docs/ldp/howto/Clock-2.html

Revision history for this message
Colin Watson (cjwatson) wrote :

*** Bug 8734 has been marked as a duplicate of this bug. ***

Revision history for this message
Colin Watson (cjwatson) wrote :

Created an attachment (id=335)
set UTC depending on other operating systems installed

This patch implements three cases:

  1) Windows is installed => ask about UTC, default to local time
  2) Windows is not installed, but other operating systems are => ask about
UTC, default to UTC
  3) only Ubuntu is installed => don't ask about UTC, default to UTC

Revision history for this message
Colin Watson (cjwatson) wrote :

prebaseconfig (0.69ubuntu3) warty; urgency=low

  * Set UTC/local-time default for the hardware clock based on whether
    Windows is installed.
  * Record whether we're the only operating system on the disk, for use by
    base-config.

 -- Colin Watson <email address hidden> Mon, 4 Oct 2004 16:53:47 +0100

base-config (2.44ubuntu24) warty; urgency=low

  * Raise the priority of tzconfig/gmt back to high, but don't ask it if
    prebaseconfig reported that we're the only operating system installed.

 -- Colin Watson <email address hidden> Mon, 4 Oct 2004 16:57:56 +0100

Revision history for this message
Colin Watson (cjwatson) wrote :

*** Bug 8860 has been marked as a duplicate of this bug. ***

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

Duplicates of this bug

Other bug subscribers

Remote bug watches

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