Gentoo Websites Logo
Go to: Gentoo Home Documentation Forums Lists Bugs Planet Store Wiki Get Gentoo!
Bug 485434 - net-misc/ntp: hwclock gets out of sync
Summary: net-misc/ntp: hwclock gets out of sync
Status: RESOLVED NEEDINFO
Alias: None
Product: Gentoo Linux
Classification: Unclassified
Component: [OLD] Core system (show other bugs)
Hardware: x86 Linux
: Normal normal (vote)
Assignee: Gentoo's Team for Core System packages
URL:
Whiteboard:
Keywords:
Depends on:
Blocks:
 
Reported: 2013-09-19 17:56 UTC by Dmitry Pak
Modified: 2014-01-13 21:31 UTC (History)
1 user (show)

See Also:
Package list:
Runtime testing required: ---


Attachments
hwclock config (hwclock,1.03 KB, text/plain)
2013-09-19 17:58 UTC, Dmitry Pak
Details

Note You need to log in before you can comment on or make changes to this bug.
Description Dmitry Pak 2013-09-19 17:56:43 UTC
Hardware clock sets to wrong time after 1 or some minutes, sometimes hours of work

Reproducible: Sometimes

Steps to Reproduce:
1. I have Moscow TZ (UTC + 4), hardware and system clocks have the local time.
2. So, for example, real time is 10-00, system - 10-00, hardware - 10-00
3. After some minutes or hours, sometimes never, real time is 10-20, system - 10-20, but hardware - 6-20. Why?
4. Reboot. After that real time is 10-30, hardware - 6-30, system - 6-30.
5. System time corrected by ntpd after 2-3 minutes.
Actual Results:  
I have wrong hardware time.

I have write system time to hardware clock befor reboot now for correct wrong time in one.
Comment 1 Dmitry Pak 2013-09-19 17:58:47 UTC
Created attachment 359042 [details]
hwclock config
Comment 2 Dmitry Pak 2013-09-19 17:59:37 UTC
emerge --info
Portage 2.2.1 (default/linux/x86/13.0/desktop/kde, gcc-4.6.3, glibc-2.15-r3, 3.10.7-gentoo i686)
=================================================================
System uname: Linux-3.10.7-gentoo-i686-Intel-R-_Core-TM-2_Duo_CPU_T5550_@_1.83GHz-with-gentoo-2.2
KiB Mem:     1542356 total,    258408 free
KiB Swap:    1572860 total,   1572860 free
Timestamp of tree: Thu, 19 Sep 2013 08:30:01 +0000
ld GNU ld (GNU Binutils) 2.23.1
app-shells/bash:          4.2_p45
dev-java/java-config:     2.1.12-r1
dev-lang/python:          2.7.5-r2, 3.2.5-r2
dev-util/cmake:           2.8.10.2-r2
dev-util/pkgconfig:       0.28
sys-apps/baselayout:      2.2
sys-apps/openrc:          0.11.8
sys-apps/sandbox:         2.6-r1
sys-devel/autoconf:       2.13, 2.69
sys-devel/automake:       1.11.6, 1.12.6, 1.13.4
sys-devel/binutils:       2.23.1
sys-devel/gcc:            4.6.3
sys-devel/gcc-config:     1.7.3
sys-devel/libtool:        2.4.2
sys-devel/make:           3.82-r4
sys-kernel/linux-headers: 3.9 (virtual/os-headers)
sys-libs/glibc:           2.15-r3
Repositories: gentoo
ACCEPT_KEYWORDS="x86"
ACCEPT_LICENSE="* -@EULA"
CBUILD="i686-pc-linux-gnu"
CFLAGS="-O2 -march=native -pipe"
CHOST="i686-pc-linux-gnu"
CONFIG_PROTECT="/etc /usr/share/config /usr/share/gnupg/qualified.txt /var/lib/hsqldb"
CONFIG_PROTECT_MASK="/etc/ca-certificates.conf /etc/env.d /etc/fonts/fonts.conf /etc/gconf /etc/gentoo-release /etc/revdep-rebuild /etc/sandbox.d /etc/terminfo"
CXXFLAGS="-O2 -march=native -pipe"
DISTDIR="/usr/portage/distfiles"
FCFLAGS="-O2 -march=i686 -pipe"
FEATURES="assume-digests binpkg-logs config-protect-if-modified distlocks ebuild-locks fixlafiles merge-sync news parallel-fetch preserve-libs protect-owned sandbox sfperms splitdebug strict unknown-features-warn unmerge-logs unmerge-orphans userfetch userpriv usersandbox usersync"
FFLAGS="-O2 -march=i686 -pipe"
GENTOO_MIRRORS="ftp://mirror.yandex.ru/gentoo-distfiles/"
LANG="ru_RU.UTF-8"
LDFLAGS="-Wl,-O1 -Wl,--as-needed"
MAKEOPTS="-j3"
PKGDIR="/usr/portage/packages"
PORTAGE_CONFIGROOT="/"
PORTAGE_RSYNC_EXTRA_OPTS="--exclude-from=/etc/portage/rsync_excludes"
PORTAGE_RSYNC_OPTS="--recursive --links --safe-links --perms --times --omit-dir-times --compress --force --whole-file --delete --stats --human-readable --timeout=180 --exclude=/distfiles --exclude=/local --exclude=/packages"
PORTAGE_TMPDIR="/var/tmp"
PORTDIR="/usr/portage"
PORTDIR_OVERLAY=""
USE="X a52 aac acl acpi alsa berkdb bluetooth branding bzip2 c++0x cairo cdda cdr cli consolekit cracklib crypt cxx dbus declarative dri dts dvd dvdr emboss encode exif fam firefox flac gdbm gif gpm iconv jpeg kde kipi lcms libnotify mad mmx mng modules mp3 mp4 mpeg mudflap ncurses nls nptl ogg opengl openmp pam pango pcre pdf phonon plasma png policykit ppds qt3support qt4 readline sdl session spell sse sse2 ssl startup-notification svg tcpd threads tiff truetype udev udisks unicode upower usb vorbis webkit wxwidgets x264 x86 xcb xcomposite xinerama xml xorg xscreensaver xv xvid zlib" ABI_X86="32" ALSA_CARDS="hda-intel" APACHE2_MODULES="authn_core authz_core socache_shmcb unixd actions alias auth_basic authn_alias authn_anon authn_dbm authn_default authn_file authz_dbm authz_default authz_groupfile authz_host authz_owner authz_user autoindex cache cgi cgid dav dav_fs dav_lock deflate dir disk_cache env expires ext_filter file_cache filter headers include info log_config logio mem_cache mime mime_magic negotiation rewrite setenvif speling status unique_id userdir usertrack vhost_alias" CALLIGRA_FEATURES="kexi words flow plan sheets stage tables krita karbon braindump author" CAMERAS="ptp2" COLLECTD_PLUGINS="df interface irq load memory rrdtool swap syslog" ELIBC="glibc" GPSD_PROTOCOLS="ashtech aivdm earthmate evermore fv18 garmin garmintxt gpsclock itrax mtk3301 nmea ntrip navcom oceanserver oldstyle oncore rtcm104v2 rtcm104v3 sirf superstar2 timing tsip tripmate tnt ubx" INPUT_DEVICES="keyboard mouse evdev" KERNEL="linux" LCD_DEVICES="bayrad cfontz cfontz633 glk hd44780 lb216 lcdm001 mtxorb ncurses text" LIBREOFFICE_EXTENSIONS="presenter-console presenter-minimizer" LINGUAS="ru" OFFICE_IMPLEMENTATION="libreoffice" PHP_TARGETS="php5-5" PYTHON_SINGLE_TARGET="python2_7" PYTHON_TARGETS="python2_7 python3_2" RUBY_TARGETS="ruby19" USERLAND="GNU" VIDEO_CARDS="intel" XTABLES_ADDONS="quota2 psd pknock lscan length2 ipv4options ipset ipp2p iface geoip fuzzy condition tee tarpit sysrq steal rawnat logmark ipmark dhcpmac delude chaos account"
Unset:  CPPFLAGS, CTARGET, EMERGE_DEFAULT_OPTS, INSTALL_MASK, LC_ALL, PORTAGE_BUNZIP2_COMMAND, PORTAGE_COMPRESS, PORTAGE_COMPRESS_FLAGS, SYNC, USE_PYTHON
Comment 3 Dmitry Pak 2013-09-20 08:26:41 UTC
When I have UTC (not local) in hardware clock there is no so problem.
Comment 4 Jeroen Roovers (RETIRED) gentoo-dev 2013-09-20 14:08:41 UTC
Try lower-case clock="local" instead of CLOCK="local". Same for the other variables in /etc/conf.d/hwclock.
Comment 5 Dmitry Pak 2013-09-21 14:46:27 UTC
not help
Comment 6 Dmitry Pak 2013-10-02 18:24:02 UTC
So I have made some tests:

1. With hwclock and ntpd in RC-services - Oops!!! hardware-clock sometimes (often) sets to UTC during the PC work in spite of the option "local"
2. With hwclock but without ntpd in RC-services - OK, hardware-clock not sets to UTC
3. Only ntpd, without hwclock - OK
3. With hwclock and openntpd (!!!) - it's OK too.

Is the ntpd wherefore of this behavior?
Comment 7 SpanKY gentoo-dev 2013-12-13 07:45:00 UTC
if hwclock is set to utc, and you have CLOCK_SYSTOHC="no", then there isn't a whole lot of point of running the hwclock init script.  configure your kernel with these options enabled:
CONFIG_RTC_HCTOSYS=y
CONFIG_RTC_SYSTOHC=y

(assuming they aren't already)
Comment 8 Dmitry Pak 2014-01-13 16:25:19 UTC
I couldn't test comment 7 now because I have use openntpd (not ntpd), UTC in hwclock (not local time) on other PC and with another kernel. :|