Your message dated Wed, 30 Jul 2014 23:19:29 +0000
with message-id <[email protected]>
and subject line Bug#263116: fixed in util-linux 2.25-5
has caused the Debian Bug report #263116,
regarding util-linux: hwclock documentation misleading
to be marked as done.

This means that you claim that the problem has been dealt with.
If this is not the case it is now your responsibility to reopen the
Bug report if necessary, and/or fix the problem forthwith.

(NB: If you are a system administrator and have no idea what this
message is talking about, this may indicate a serious mail system
misconfiguration somewhere. Please contact [email protected]
immediately.)


-- 
263116: http://bugs.debian.org/cgi-bin/bugreport.cgi?bug=263116
Debian Bug Tracking System
Contact [email protected] with problems
--- Begin Message ---
Package: util-linux
Version: 2.12-3_i386.

The manual page explains it OK but the Debian initialization file will
interfere with following what's in the man page.  The documentation in
/usr/share/doc/util-linux/README.Debian.hwclock.gz is erroneous (as are
the comments in /etc/init.d/hwclock.sh).  Sorry to be so blunt but my
previous report (either as a bug or directly to the maintainer) on this
topic was not satisfactorily dealt with.

README.Debian.hwclock.gz says:
> 
> A Debian installation will, by default, call hwclock --hctosys during system
> startup and hwclock --systohc during system shutdown.
> 
> To set the date/time of the system, just use the standard UNIX date facilities
> (such as date) or any of the advanced timekeeping utilities (ntp, ntpdate,
> chrony). Other methods of setting the clock (such as hwclock) are likely to 
> cause trouble, do not use them. 

What about someone that just reads the man page?  It's bad to have
a contradiction between the man page and the README doc.

> Please note that because the shutdown scripts call hwclock --systohc, you
> cannot set the clock using hwclock only, as your adjustment will be lost on
> the next reboot. THIS MEANS YOU MUST *NOT* FOLLOW THE PROCEDURES IN THE
> hwclock(8) MAN PAGE TO SET THE CLOCK DATE/TIME USING A REBOOT UNLESS YOU
> EDIT THE SHUTDOWN SCRIPTS.
> 
> 
> The full story:
It's by no means the full story.
> 
> A Linux system actually has two clocks:
> 
>  - The System Clock, kept by the kernel. This is the clock that Linux
>  uses for day-to-day activities, and this is also the clock you set
>  using date.
> 
>  - The Hardware Clock, also called RTC, which is used as a backup to
>  keep time while the computer is turned off, or in APM suspended
>  state. This is the clock you set using hwclock --set.
> 
> (you can get more information about these two clocks in the hwclock(8)
> man page).
> 
> hwclock is used to copy time between these two clocks. For the Debian
> standard install, the system clock is initialized with the value of
> the hardware clock during startup, and the value of the system clock
> is copied back to the hardware clock during system shutdown/reboot.
> 
> So, in a Debian default install, you can keep the illusion that
> there's a single clock. Unless you use a program that modifies the
> hardware clock directly and does not set the system clock as well,
> that is.
> 
> 
> Issues with hwclock --adjust:
> 
> hwclock has a facility to try to correct for systematic drift in the
> hardware clock, accessed by hwclock --adjust. This facility is
> *dangerous* because it has a severe drawback: it assumes that no
> program other than hwclock --systohc will ever be used to change the
> hardware clock.

No.  Even if all you ever use is --systohc, the hwclock --adjust will
create huge errors in your system (and hw) time.  Here's why.  At each
shutdown a calibration is done since --systohc is run.  If it's been over
a day since --systohc was last run, /etc/adjtime is modified.  This
modification assumes that the systime is correct but it isn't.

For example: You set the hw and sys clocks exactly on day 0 and the
drift factor in /etc/adjtime is 0, but it should be 3 since the hwclock
loses 3 sec/day.  Then you shut down your PC and on day 2 use your PC
again for a short time.  The hw clock will then be 6 sec slow and so
will the sys clock.  At shutdown the calibration routine will note that
the sys and hw clocks are about the same and thus establish a very small
drift factor, say 0.1 when it should be 3.  Then you continue like this,
using your PC every day or two without using any commands to set time.
By day 30 (the end of the month) the hwclock time is almost 90 sec slow
so then you set the sys time manually to the correct value.  Now the 90
sec took about a month to accumulate but since a previous calibration
has been made about a day ago, the hwclock program erroneously thinks
that this 90 sec slowness happened in one day and sets the drift factor
to 90 which will overcompensate for the 3 sec/day slowness by 87
sec/day!  If then you repeat this whole process over again, your clock
will eventually be many hours in error.

The drift factor, instead of converging to a correct value, is in fact
rapidly diverging.  Very bad.

> 
> This assumption is often false, as many common utilities such as ntp,
> chrony, as well as your computer's System Setup BIOS program, and any
> other OS you have in your machine will change the clock.

Well, just don't use them then.
 
> 
> Also, if hwclock --adjust is used, one must make sure the drift file
> (/etc/adjtime) is deleted every time the system clock is set to a very
> different value (even if you're using hwclock itself to do it!), or
> the drift computation might become invalid and cause the hardware
> clock to be incorrectly set the next time hwclock --adjust is used.
> 
> hwclock currently does not perform any sort of sanity checks in the
> values it uses to compute the drift file, and will corrupt your clock
> time by potentially very large amounts if anything goes wrong.
> 
> Don't use the hwclock --adjust facility, refer to alternate (and much
> safer) programs such as ntp or chrony if you need precision
> timekeeping.

It is safe if you remove the running of --systohc at shutdown and then
use only --set to change the hc time.  --systohc should only run at
shutdown if you don't use --adjust.  And without using --adjust you will
need to make time corrections much more often.  So --adjust can save a
lot of bother keeping the clock running correctly, provided the
documentation is clear. 

Also, in the script it echoes "Saving the System Clock time to the
Hardware Clock..." when in fact this may not happen due to the
environment variables: HWCLOCKACCESS or HWCLOCKSET



--- End Message ---
--- Begin Message ---
Source: util-linux
Source-Version: 2.25-5

We believe that the bug you reported is fixed in the latest version of
util-linux, which is due to be installed in the Debian FTP archive.

A summary of the changes between this version and the previous one is
attached.

Thank you for reporting the bug, which will now be closed.  If you
have further comments please address them to [email protected],
and the maintainer will reopen the bug report if appropriate.

Debian distribution maintenance software
pp.
Andreas Henriksson <[email protected]> (supplier of updated util-linux package)

(This message was generated automatically at their request; if you
believe that there is a problem with it please contact the archive
administrators by mailing [email protected])


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

Format: 1.8
Date: Thu, 31 Jul 2014 00:55:15 +0200
Source: util-linux
Binary: util-linux util-linux-locales mount bsdutils fdisk-udeb cfdisk-udeb 
libblkid1 libblkid1-udeb libblkid-dev libmount1 libmount-dev libsmartcols1 
libsmartcols1-udeb libsmartcols-dev libuuid1 uuid-runtime libuuid1-udeb 
uuid-dev util-linux-udeb
Architecture: source amd64 all
Version: 2.25-5
Distribution: experimental
Urgency: medium
Maintainer: Debian util-linux Maintainers <[email protected]>
Changed-By: Andreas Henriksson <[email protected]>
Description:
 bsdutils   - basic utilities from 4.4BSD-Lite
 cfdisk-udeb - Manually partition a hard drive (cfdisk) (udeb)
 fdisk-udeb - Manually partition a hard drive (fdisk) (udeb)
 libblkid-dev - block device id library - headers and static libraries
 libblkid1  - block device id library
 libblkid1-udeb - stripped down block device id library, for debian-installer 
(udeb)
 libmount-dev - device mounting library - headers and static libraries
 libmount1  - device mounting library
 libsmartcols-dev - smart column output alignment library - headers and static 
librar
 libsmartcols1 - smart column output alignment library
 libsmartcols1-udeb - stripped down smart column output aligment library, for 
debian-in (udeb)
 libuuid1   - Universally Unique ID library
 libuuid1-udeb - stripped down universally unique id library, for 
debian-installer (udeb)
 mount      - Tools for mounting and manipulating filesystems
 util-linux - Miscellaneous system utilities
 util-linux-locales - Locales files for util-linux
 util-linux-udeb - stripped down miscellaneous system utilities, for 
debian-installe (udeb)
 uuid-dev   - universally unique id library - headers and static libraries
 uuid-runtime - runtime components for the Universally Unique ID library
Closes: 263116 734544
Changes:
 util-linux (2.25-5) experimental; urgency=medium
 .
   The "big maintainer-script cleanup" release
 .
   * Drop debian/uuid-runtime.prerm (and related lintian override)
     - dh_installinit will automatically start and stop services as needed.
   * Drop debian/libuuid1.postinst (user/group addition)
   * uuid-runtime: improved user/group handling (Closes: #734544)
     - pre-depend on new libuuid1 to make sure no old user handling is present
     - add code to rename existing libuuid user/group to uuidd
       and set nologin shell and new home directory.
     - switch to adduser instead of opencoding it since uuid-runtime
       is Priority: optional (as opposed to libuuid1 which is required)
       and adduser --system should just do the right thing.
     - change user/group addition to add uuidd instead of libuuid.
     - stop making uuidd setuid, not needed and we don't want anyone to
       be able to kill the daemon (via uuidd -k) for example.
   * Drop d/p/Use-libuuid-user-group-in-sysvinit-script-systemd-un.patch
   * util-linux: drop obsolete hwclock handling from maint-scripts
   * util-linux: drop obsolete update-mime calls
   * util-linux: drop obsolete 2.17 upgrade warning
   * util-linux: drop obsolete /etc/default/rcS -> /etc/adjtime migration
   * Reindent/cleanup all maintainer scripts
   * Drop outdated debian/README.Debian.hwclock (Closes: #263116)
   * Drop unused debian/rejected-upstream
   * Drop outdated debian/uuid-dev.README.Debian
   * Drop diffutils build-dependency
   * Drop debian/*.dirs
   * Attempt to avoid dumb term problem in "more: regexp" test
Checksums-Sha1:
 cabfffe66a1b53c89eadf61b8440903cb103e900 2803 util-linux_2.25-5.dsc
 50677d7a9c0f0af8ec2b4242b2c631ed099769d4 68584 util-linux_2.25-5.debian.tar.xz
 69b2c47e5226cdd25c8ddbea770a3647b2186f23 845830 util-linux_2.25-5_amd64.deb
 c9213fe254bb7a4e156554aacddbc75f74b11c9a 804860 
util-linux-locales_2.25-5_all.deb
 a68a2e3ae2e8ec5ba74f1e41a60bdf662a0c69e5 165430 mount_2.25-5_amd64.deb
 53f2bec01a45c129ebf6c940b1c0014837b59cb9 120516 fdisk-udeb_2.25-5_amd64.udeb
 9db11db34214797b0f1212d3baa23a1e9dbeac0c 887534 cfdisk-udeb_2.25-5_amd64.udeb
 e037fadbbb745d1dfd1c12195fda64a8b36a2f76 152694 libblkid1_2.25-5_amd64.deb
 90d36eef6906adf084dc4dd4db71a0205b920e1e 98026 libblkid1-udeb_2.25-5_amd64.udeb
 625560096f28b46766335e31f678ab5b15c0fc0f 176552 libblkid-dev_2.25-5_amd64.deb
 1a0a97197def49f8a99afb8fef054a3d7b5759bf 160154 libmount1_2.25-5_amd64.deb
 3984a7d9e5677f21a5a0e927dd2060d70e0bf3cc 177344 libmount-dev_2.25-5_amd64.deb
 3efa168d0c097f7eeb8a803e173ce065e6793519 107014 libsmartcols1_2.25-5_amd64.deb
 11755da1fd4c754790016a5a67fdb6687b179aaa 52384 
libsmartcols1-udeb_2.25-5_amd64.udeb
 dd7e49cac620b2d3ff2cb370513f3fd1b48b6b9d 116870 
libsmartcols-dev_2.25-5_amd64.deb
 d35d6f5f4d289a4f11021f69a8c6d9a10ee6909e 61266 libuuid1_2.25-5_amd64.deb
 2dd224d6643eb8c67e23578ca4c1a656f6e78fcb 71330 uuid-runtime_2.25-5_amd64.deb
 0fcba956e39021c0d3fdacff433f92242777f255 7108 libuuid1-udeb_2.25-5_amd64.udeb
 818b06221691986b68923e748814c6d8803f9361 75486 uuid-dev_2.25-5_amd64.deb
 796dadf8e617fdf52ed8e55661b2d2192ea0b575 27640 
util-linux-udeb_2.25-5_amd64.udeb
 a83d280ea2217ddf333753fa1eb7a03d48e338e3 91216 bsdutils_2.25-5_amd64.deb
Checksums-Sha256:
 567dc594c652b47df4e0d466e3cb5dd9fc950629bfbe9e57917b30ec791b4916 2803 
util-linux_2.25-5.dsc
 caa3aa54c5682f78441f9adefb366e2858011ceadafd86d2b05a6856f72890ea 68584 
util-linux_2.25-5.debian.tar.xz
 f67dbb93831ccd74b1e253e204b17cae87e676b1c7677722d9fd6e3fba9c1cd2 845830 
util-linux_2.25-5_amd64.deb
 abadd183e7545f0567e79e66b84d8e02f8f1b949012bbd7d40922b7f9bca0cea 804860 
util-linux-locales_2.25-5_all.deb
 c62483b8d562d2978634cecbb60aaa1b8ff6c3d5d2168bc3192d2413b3f32500 165430 
mount_2.25-5_amd64.deb
 8a5ca26fc9f66b8bcc785db7dfdbbe4c6284bbf52e550917274f339d357dcc18 120516 
fdisk-udeb_2.25-5_amd64.udeb
 a1862b15eeac0f26de6800de197d363b673ed2d7c279554f01cfb1c58060f389 887534 
cfdisk-udeb_2.25-5_amd64.udeb
 424e4d2fc2c6fc7f41589b87b606b191234e52e5868359b5289bcbce5de1d093 152694 
libblkid1_2.25-5_amd64.deb
 4508bc7bc0ebfc1c6036ff570a746a1076f8207f04e35a5d8d686cc5b87ec454 98026 
libblkid1-udeb_2.25-5_amd64.udeb
 498e33e1b310b73bec4fe63b04d36ce2226e948209e97880dae1e3adba6e3b75 176552 
libblkid-dev_2.25-5_amd64.deb
 65fa41413a93fda739dbcc94a3e323433eaa4cef3d22c928507789d54dd251b7 160154 
libmount1_2.25-5_amd64.deb
 191637af58431b9b0669cb0d8a7fc480333a046d7f0754e5b1704493e70bccce 177344 
libmount-dev_2.25-5_amd64.deb
 c9492952efe4a9e7b2cb79a0c0d5c3bf7085f479dc4366bc23a84e1299d82816 107014 
libsmartcols1_2.25-5_amd64.deb
 764768da6c11ef8783bb49f3ab19503b7cd01bde0423ee5c3a4832fe8a3f2ce0 52384 
libsmartcols1-udeb_2.25-5_amd64.udeb
 dac54d606c50f093e78a26f113a7d2b7e051287f398ba879ad1c37dfaab3c488 116870 
libsmartcols-dev_2.25-5_amd64.deb
 1ed653d19c824eba9fc2fee698a8fcc01f631d2030f004df8978c67430eb6bca 61266 
libuuid1_2.25-5_amd64.deb
 59b27ed2255f7f6691a88dfce2f5a55d1c47ead52ef01d8ae35cd5fcef4cb333 71330 
uuid-runtime_2.25-5_amd64.deb
 b1ccaa200c472213ebab47a0c6fbc1cf053c381f0d553c9c32dd47216953c4f0 7108 
libuuid1-udeb_2.25-5_amd64.udeb
 fcc723c9f5fbc353c6276fa6a675dba1e10fbffc5c2c98be752c593d3322f19a 75486 
uuid-dev_2.25-5_amd64.deb
 3b4345775c4520fc83dc1e516e375deeeb993cca4ef8aa0742ef8e4b08327d39 27640 
util-linux-udeb_2.25-5_amd64.udeb
 2e8dd2387e0be385b3a670cf00d50257abcbb94ec22343eb341bafac6c1160aa 91216 
bsdutils_2.25-5_amd64.deb
Files:
 163bcaf8a65d9b989dba289c7f2c1879 845830 utils required 
util-linux_2.25-5_amd64.deb
 e0687eb1677d83ba54861a3385fc3025 804860 localization optional 
util-linux-locales_2.25-5_all.deb
 48516bc67fd941707ace83f2ce1ec857 165430 admin required mount_2.25-5_amd64.deb
 d4a637f96709a0bb1bb6bce7f5a96ce6 120516 debian-installer extra 
fdisk-udeb_2.25-5_amd64.udeb
 6318133cf66063b848d0ce9ca8252a99 887534 debian-installer extra 
cfdisk-udeb_2.25-5_amd64.udeb
 c50ae20a3763a0dfbb77f17d57cb00b6 152694 libs required 
libblkid1_2.25-5_amd64.deb
 5833c0e890dab1fb693036f732a2af3c 98026 debian-installer optional 
libblkid1-udeb_2.25-5_amd64.udeb
 2d25daca5f97764608f3e08f404aefe2 176552 libdevel extra 
libblkid-dev_2.25-5_amd64.deb
 d29e3b2c202941516744ec0d6d656a46 160154 libs required 
libmount1_2.25-5_amd64.deb
 cbe70439af194d87833be94a3799e3fb 177344 libdevel extra 
libmount-dev_2.25-5_amd64.deb
 c7933d377a529d53353be7b0b2a77fcc 107014 libs required 
libsmartcols1_2.25-5_amd64.deb
 b85d59072753b4fbf75e00cd6624f38c 52384 debian-installer optional 
libsmartcols1-udeb_2.25-5_amd64.udeb
 946375ba256f61fad7f56fac86d481c1 116870 libdevel extra 
libsmartcols-dev_2.25-5_amd64.deb
 42b61ead128cee8afd01ee194b7581f4 61266 libs required libuuid1_2.25-5_amd64.deb
 351b12a3318b76e2d6efc707a23606b7 71330 libs optional 
uuid-runtime_2.25-5_amd64.deb
 8a1216f0a00b801df3ff290d28faed7a 7108 debian-installer optional 
libuuid1-udeb_2.25-5_amd64.udeb
 9a7fc62ab1bdb7b100773c968dd90a1e 75486 libdevel extra uuid-dev_2.25-5_amd64.deb
 2a6e187e4d767b294b871ab400d9dbc2 27640 debian-installer optional 
util-linux-udeb_2.25-5_amd64.udeb
 c4503013c7d28f86d42ca3205825e059 91216 utils required bsdutils_2.25-5_amd64.deb
 8c89d1d8d6f38fda00532b18eba0959e 2803 base required util-linux_2.25-5.dsc
 ecc0cdd9f7a4eccdfbab6d37d4aaf9bc 68584 base required 
util-linux_2.25-5.debian.tar.xz
Package-Type: udeb

-----BEGIN PGP SIGNATURE-----
Version: GnuPG v1

iEUEARECAAYFAlPZeaEACgkQcgQ2cL3l8e4fIgCgr+a3VxZhm1G0oQ3vfjFGfORi
0N8AmMlUU+UZgt6sd7pMBujFOaZ1oSA=
=fpsQ
-----END PGP SIGNATURE-----

--- End Message ---

Reply via email to