Mailinglist Archive: opensuse (878 mails)

< Previous Next >
Re: [opensuse] Extrange change in "/etc/sysconfig/clock"
-----BEGIN PGP SIGNED MESSAGE-----
Hash: SHA1

В Sun, 1 Sep 2013 14:00:18 +0200 (CEST)
"Carlos E. R." <carlos.e.r@xxxxxxxxxxxx> пишет:

-----BEGIN PGP SIGNED MESSAGE-----
Hash: SHA1

Content-ID: <alpine.LNX.2.00.1309011359110.7832@Telcontar.valinor>


On Sunday, 2013-09-01 at 09:14 +0400, Andrey Borzenkov wrote:

В Sat, 31 Aug 2013 20:46:35 +0200 "Carlos E. R." <> пишет:


People that double boot, specially when the other system is Windows,
who insists on the CMOS clock being localtime, often trash the adjtime
file contents. As a result, the clock shifts several hours on every
boot (maybe not an integer number of hours).


I do not understand what is to trash there. The first two lines are
legacy that nobody relies upon anyway. What this thread is about is the
third line which is never changed by hwclock itself unless you
explicitly instruct it to do so.

The first two lines are used by hwclock. The exact method varies between
openSUSE releases.

Basically, cpu time is set from cmos clock on boot. On halt system time is
copied to cmos, but first it is compared to see the difference: a value
for clock shift per time unit is stored in those first lines of the
adjtime file.

On next boot, hwclock obtains the time from cmos, and shifts it with the
difference value multiplied by the time since last cmos time set.


Please show me which script on openSUSE 12.3 and above calls hwclock
during boot and shutdown. The only one I am aware of is /etc/init.d/ntp
and only once on boot to set CMOS after time was synced and only if
explicitly enabled.

This procedure compensates for the inacuracies (drift) in the cmos clock.

Remember that not everybody can use ntp.


If you do not use NTP, you do not have correct time anyway. How exactly
is one incorrect time better than another incorrect time?

Hwclock has always stored the utc/local word there.


Not always - only if you explicitly call it with --local or --utc.

This is documented.


The cure on those cases was to set the system clock manually, transfer
contents to cmos clock, and then erase the adjtime file, in the
knowledge that rebooting would set it up correctly.


I do not understand why you need to remove /etc/adjtime helps here.
Either LOCAL/UTC was set correctly or not. If it was no correctly set
then most likely because /etc/sysconfig/clock was not set correctly and
it will be recreated with wrong value again.

When the adjustment shift in /etc/adjtime is incorrect, the file has to be
deleted and recreated correctly. UTC/LOCAL is irrelevant, but the correct
word has to be written.

If you adjust manually the clock by hours up or down, when the sihift per
unit time is calculated, it is wrong by hours. When the time is set on
next boot, it is set VERY incorrectly.

Once more - there is NO place in openSUSE where /etc/adjtime is used to
set system time from CMOS on boot - this is done by kernel. Nor is
there any place where CMOS is set from system time on shutdown - this is
normally done automatically by kernel.


The right procedure to fix dual boot with Windows is to go to YaST and
set local time instead of UTC. Which will store the correct value
in /etc/adjtime. Where is the problem?


People do not remember what they did at install time. If on doubt, they
hit [ENTER]. The contents of the /etc/sysconfig/clock file allowed us
helpers to know what to do, even if the user did not know.

Now it is impossible, we have to guess for them.


By your own word ("if in doubt, they hit [ENTER}") this file cannot be
trusted, at which point you are free to decide whether to use local or
utc.


And no, the correct procedure for Windows, since Vista, is to use UTC and
tell Windows to also use UTC.

Good. Now you finally give decision criteria whether to use UTC or
LOCAL which does not depend on /etc/sysconfig/hwclock in any way :)
-----BEGIN PGP SIGNATURE-----
Version: GnuPG v2.0.19 (GNU/Linux)

iEYEARECAAYFAlIjO4sACgkQR6LMutpd94xWdwCfW+KM3zfwfR0qxkTTT9F5fNLX
yY4AoLfd/+D6KjiWOWV6uois2szETHUf
=vdov
-----END PGP SIGNATURE-----
< Previous Next >