Gentoo Websites Logo
Go to: Gentoo Home Documentation Forums Lists Bugs Planet Store Wiki Get Gentoo!
Bug 69956 - clock init script does not use settings in /etc/conf.d/clock on bootup
Summary: clock init script does not use settings in /etc/conf.d/clock on bootup
Status: RESOLVED FIXED
Alias: None
Product: Gentoo Linux
Classification: Unclassified
Component: [OLD] baselayout (show other bugs)
Hardware: All Linux
: High normal (vote)
Assignee: Gentoo's Team for Core System packages
URL:
Whiteboard:
Keywords:
: 69987 70107 (view as bug list)
Depends on:
Blocks:
 
Reported: 2004-11-03 10:35 UTC by Georg Müller
Modified: 2004-11-17 10:02 UTC (History)
3 users (show)

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


Attachments

Note You need to log in before you can comment on or make changes to this bug.
Description Georg Müller 2004-11-03 10:35:07 UTC
I have a setting CLOCK="UTC" in /etc/conf.d/clock
It formerly has been in /etc/rc.conf as well, but this isn't there anymore.

While boot /etc/conf.d/clock is not loaded - it uses local (because of the if-statements in init script it prefers local when it is not UTC), but when I restart clock after system boot, it sets it to UTC (so it uses the right file).
To resolve this, I added a " . /etc/conf.d/clock " to the setupopts() function in the init script.


Reproducible: Always
Steps to Reproduce:
1. Delete CLOCK var from /etc/rc.conf (as in latest baselayout)
2. boot with UTC in /etc/conf.d/clock - it shows [Local Time] when setting hwclock

Actual Results:  
no UTC time with CLOCK="UTC" on bootup

Expected Results:  
UTC time
Comment 1 SpanKY gentoo-dev 2004-11-03 13:02:42 UTC
you neglected to provide `emerge info` like you were supposed to so i'm going to assume you're using baselayout-1.11.5 ...

looks like the issue is that start_critical_service() in /sbin/rc doesnt source /etc/conf.d/${x} after it sources /etc/init.d/${x}

simple fix, i'll test it before adding to cvs
Comment 2 Georg Müller 2004-11-03 13:07:38 UTC
Sorry about missing info. Yes, it is sys-apps/baselayout-1.11.5

Here is the info:
Portage 2.0.51-r2 (gcc34-amd64-2004.1, gcc-3.4.2, glibc-2.3.4.20041021-r0, 2.6.9-gentoo-r1 x86_64)
=================================================================
System uname: 2.6.9-gentoo-r1 x86_64 AMD Athlon(tm) 64 Processor 3200+
Gentoo Base System version 1.6.5
Autoconf: sys-devel/autoconf-2.59-r5
Automake: sys-devel/automake-1.8.5-r1
Binutils: sys-devel/binutils-2.15.92.0.2-r1
Headers:  sys-kernel/linux26-headers-2.6.8.1-r1
Libtools: sys-devel/libtool-1.5.2-r5
ACCEPT_KEYWORDS="amd64 ~amd64"
AUTOCLEAN="yes"
CFLAGS="-O2 -pipe"
CHOST="x86_64-pc-linux-gnu"
COMPILER=""
CONFIG_PROTECT="/etc /usr/X11R6/lib/X11/xkb /usr/kde/2/share/config /usr/kde/3.2/share/config /usr/kde/3.3/env /usr/kde/3.3/share/config /usr/kde/3.3/shutdown /usr/kde/3/share/config /usr/share/config /usr/share/texmf/dvipdfm/config/ /usr/share/texmf/dvips/config/ /usr/share/texmf/tex/generic/config/ /usr/share/texmf/tex/platex/config/ /usr/share/texmf/xdvi/ /var/qmail/control"
CONFIG_PROTECT_MASK="/etc/gconf /etc/terminfo /etc/env.d"
CXXFLAGS="-O2 -pipe"
DISTDIR="/usr/portage/distfiles"
FEATURES="autoaddcvs ccache distlocks"
GENTOO_MIRRORS="http://mirrors.sec.informatik.tu-darmstadt.de/gentoo/ http://mir.zyrianes.net/gentoo/ ftp://mirror.switch.ch/mirror/gentoo/"
MAKEOPTS="-j2"
PKGDIR="/usr/portage/packages"
PORTAGE_TMPDIR="/var/tmp"
PORTDIR="/usr/portage"
PORTDIR_OVERLAY="/usr/local/portage"
SYNC="rsync://rsync.gentoo.org/gentoo-portage"
USE="X X509 aalib acpi alsa amd64 apache2 arts avi berkdb bitmap-fonts chroot crypt cups dvd encode ethereal f77 foomaticdb gdbm gif gphoto2 gstreamer gtk gtk2 imlib ipv6 java jce jpeg junit kde kerberos libg++ libwww mikmod mpeg nas ncurses nls nptl nptlonly oggvorbis opengl pam pdflib perl pic plotutils png postgres pwdb python qt quicktime readline ruby samba scanner sdl slang spell ssl tcltk tcpdtetex theora truetype unicode usagi usb xml xml2 xmms xprint xv zlib linguas_de"
Comment 3 SpanKY gentoo-dev 2004-11-03 15:46:42 UTC
*** Bug 69987 has been marked as a duplicate of this bug. ***
Comment 4 SpanKY gentoo-dev 2004-11-03 16:26:12 UTC
fixed in cvs ... here's a local patch you can apply on your machine until the next baselayout comes out:

--- /sbin/rc.orig       2004-11-03 18:58:39.000000000 -0500
+++ /sbin/rc    2004-11-03 19:26:35.291447048 -0500
@@ -402,7 +402,8 @@
                        source "/etc/init.d/${x}" || eerror "Failed to source /etc/init.d/${x}"
                        retval=$?
                        [ "${retval}" -ne 0 ] && return "${retval}"
-                       
+                       [ -e "/etc/conf.d/${x}" ] && source "/etc/conf.d/${x}"
+
                        start || eerror "Failed to start /etc/init.d/${x}"
                        retval=$?
 
Comment 5 Jeff 2004-11-03 16:31:50 UTC
Thanks!
Comment 6 Jeff 2004-11-03 16:59:52 UTC
Sorry but that still doesn't solve the problem of clock starting up before localmount. clocks depend --> need localmount still ignored.
Comment 7 SpanKY gentoo-dev 2004-11-03 17:20:08 UTC
you're describing an unrelated bug ... that is Bug 68133
Comment 8 Jeff 2004-11-03 18:48:03 UTC
I'm describing bug# 69987 that you marked as a dup of this bug without reading it.
Comment 9 SpanKY gentoo-dev 2004-11-03 18:51:45 UTC
i did read Bug 69987

the problem was that you described two different bugs there ... i cant mark it a dupe of two bugs so i chose this one since it was the first bug you described :P
Comment 10 Jeff 2004-11-03 19:26:58 UTC
Sorry to be annoying but I checked out the bug, fix has been applied already:

CRITICAL_SERVICES="checkroot clock hostname modules checkfs localmount"

I'll check out the next version when it comes out as I have a fix for my problem, thanks.
Comment 11 Jeff 2004-11-04 12:21:31 UTC
vapier,

Full understanding has finally dawned on me, I really need to start getting more sleep. I was playing around the the order of the critical services and got it to work as I originally wanted but after looking at the other critical services scripts realize why they should be started in that order. So I guess removing the /etc/localtime symlink and just copying over the actual zoneinfo file is the best fix.

My only concern would be all the other people with /usr on a separate partition will be having the same problem when using localtime without copying over the file. What to do about that? Should definitely at least consider changing the gentoo install docs... Thanks.
Comment 12 SpanKY gentoo-dev 2004-11-04 17:04:38 UTC
*** Bug 70107 has been marked as a duplicate of this bug. ***
Comment 13 Stuart Bouyer 2004-11-06 05:07:18 UTC
I don't think that copying the /usr/share/zoneinfo/{file} to /etc/localtime is the correct way to fix this. /etc/init.rd/clock should honour the "need localtime" 

I don't think that this bug has been fixed!

I have /usr as a seperate partition and I still get the clock problem even with the patch.
Comment 14 SpanKY gentoo-dev 2004-11-09 21:51:09 UTC
use baselayout-1.11.6+
Comment 15 Matteo Settenvini 2004-11-10 02:26:43 UTC
I'm using latest baselayout, 1.11.6-r1. Now everytime I reboot my clock drifts of about one hour and twenty minutes back. 
Unless I don't have just invented a time machine, I think it's a bug.
As a time riference, up until clock was "UTC" in /etc/rc.conf everything went ok. Then it has moved to /etc/conf.d/clock  and it's a disaster.
In both location it is still set to "UTC".

The problem is, is it related to this bug, or is it a new one and I have to file it?
Comment 16 SpanKY gentoo-dev 2004-11-10 14:16:06 UTC
what does it say at boot ?
setting to UTC or Local Time ?
Comment 17 Matteo Settenvini 2004-11-10 17:54:04 UTC
it says to UTC
Comment 18 SpanKY gentoo-dev 2004-11-10 18:10:39 UTC
ok, so is this perhaps because of CLOCK_SYSTOHC being set to no by default ? (the default was yes before)
Comment 19 Matteo Settenvini 2004-11-11 02:04:02 UTC
yes, i noticed that already ~ a week ago, so I set it on "yes" here. i guess there is something in /etc/init.d/clock that has changed from before.
Comment 20 solar (RETIRED) gentoo-dev 2004-11-12 05:22:38 UTC
(odd) something in this bug makes it hit my spam filters
Comment 21 Jérémie Delente 2004-11-13 03:26:24 UTC
Actually, i've resolved this by putting CLOCK="localtime" instead of CLOCK="loacl" in my /etc/rc.conf.
And now it works.

I think it is because of:
        if is_uml_sys
        then
                TBLURB="UML"
                return 0
        elif grep -q ' cobd$' /proc/devices
        then
                TBLURB="coLinux"
                return 0
        elif [ "${CLOCK}" = "UTC" ]
        then
                myopts="--utc"
                TBLURB="UTC"
        else
                myopts="--localtime"
                TBLURB="Local Time"
        fi
it seems to check for value localtime, and not local.

Portage 2.0.51-r3 (default-linux/x86/2004.3, gcc-3.3.4, glibc-2.3.4.20040808-r1, 2.6.9-cko2 i686)
=================================================================
System uname: 2.6.9-cko2 i686 Intel(R) Pentium(R) M processor 1700MHz
Gentoo Base System version 1.6.6
Autoconf: sys-devel/autoconf-2.59-r5
Automake: sys-devel/automake-1.8.5-r1
Binutils: sys-devel/binutils-2.14.90.0.8-r1
Headers:  sys-kernel/linux26-headers-2.6.8.1
Libtools: sys-devel/libtool-1.5.2-r5
ACCEPT_KEYWORDS="x86"
AUTOCLEAN="yes"
CFLAGS="-O2 -Os -march=pentium3 -msse2 -fomit-frame-pointer -pipe"
CHOST="i686-pc-linux-gnu"
COMPILER=""
CONFIG_PROTECT="/etc /usr/X11R6/lib/X11/xkb /usr/kde/2/share/config /usr/kde/3/share/config /usr/share/config /var/qmail/control"
CONFIG_PROTECT_MASK="/etc/gconf /etc/terminfo /etc/env.d"
CXXFLAGS="-O2 -Os -march=pentium3 -msse2 -fomit-frame-pointer -pipe"
DISTDIR="/usr/portage/distfiles"
FEATURES="autoaddcvs ccache distlocks fixpackages sandbox sfperms"
GENTOO_MIRRORS="http://trumpetti.atm.tut.fi/gentoo/ http://gentoo.mirror.sdv.fr/ http://ds.thn.htu.se/linux/gentoo/ http://www.ibiblio.org/pub/Linux/distributions/gentoo"
MAKEOPTS="-j2"
PKGDIR="/usr/portage/packages"
PORTAGE_TMPDIR="/var/tmp"
PORTDIR="/usr/portage"
PORTDIR_OVERLAY="/usr/local/portage"
SYNC="rsync://rsync8.de.gentoo.org/gentoo-portage"
USE="X acpi alsa atapi avi berkdb bitmap-fonts cdr crypt cups directfb dvd encode esd f77 fam fbcon flash foomaticdb fortran gdbm ggi gif gphoto2 gpm gtk gtk2 imagemagick imlib java jpeg lcms libg++ libwww mad mikmod mmx motif mpeg ncurses nls nvidia oggvorbis opengl oss pam pdflib perl png python quicktime readline reiserfs ruby slang socks5 spell sse ssl svga tcpd tiff x86 xml2 xmms xv zlib video_cards_nvidia"
Comment 22 Paul Taylor 2004-11-14 12:36:50 UTC
I have the opposite problem.  I had CLOCK="local" in /etc/rc.conf (as per the Gentoo installation instructions circa 2003), but recently my clock has been setting itself as UTC.

I've just discovered the /etc/conf.d/clock file, which appears to override the /etc/rc.conf setting; I assume this was added in a recent update to baselayout.  Is rc.conf now deprecated?
Comment 23 SpanKY gentoo-dev 2004-11-14 16:51:59 UTC
the CLOCK is not set in /etc/rc.conf anymore with 1.11.x
Comment 24 Matteo Settenvini 2004-11-16 11:05:49 UTC
I use just UTC (in /etc/conf.d/clock), and before everything went ok, while now it drifts a couple of hours every reboot.

Should I file a new bug, then?
Comment 25 Georg Müller 2004-11-16 12:00:35 UTC
This may have to do with the switch from local to UTC
Try to remove your /etc/adjtime, set your time (with date or ntpdate) and then reboot.
Comment 26 Matteo Settenvini 2004-11-17 10:02:06 UTC
Thanks, Georg! This seems to solve the issue. Shouldn't the ebuild store the actual time, rm /etc/adjtime and create it again? Just a though, anyway.