UTC vs Localtime Again! What am I missing? [Solved]

Discussion in general that pertains to Sabayon Linux - Must Pertain to Sabayon Linux

Moderator: Moderators

UTC vs Localtime Again! What am I missing? [Solved]

Postby joe3 » Wed Aug 19, 2009 19:18

I thought I learned how to do this while I was running Sabayon 3.5... It doesn't matter why I need my hardware clock (cmos) to have localtime in it. It is my long established policy that I will maintain even if I should uninstall the seldom booted windows installation.

In any case however, I thought I'd learned how to get Sabayon to expect that the time in the cmos is in local time and adjust any software time process that MUST be in UTC accordingly... However it's come to my attention that this is not happening as the following will demonstrate... (Note, The following was done immediately after booting and opening a root shell...) on my current 64 bit Sabayon 4.2 installation.

UnderTree =->
UnderTree =-> grep "clock=" /etc/conf.d/hwclock
clock="local"
UnderTree =-> cat /etc/timezone
America/New_York
UnderTree =-> ls -l /etc/localtime
lrwxrwxrwx 1 root root 36 2009-08-14 07:49 /etc/localtime -> /usr/share/zoneinfo/America/New_York
UnderTree =-> cat /root/bin/fixtime
#! /bin/bash
# fixtime a root script to force sabayon to realize hwclock is localtime
# Note: 1 echo & 3 date commands were temporarily inserted so that
# stdout can be used to help debug the process.
echo "running fixtime"
date
hwclock --noadjfile --localtime
date
hwclock --hctosys
date
UnderTree =-> /root/bin/fixtime
running fixtime
Wed Aug 19 00:23:07 EDT 2009
Wed 19 Aug 2009 04:23:09 AM EDT -1.017006 seconds
Wed Aug 19 00:23:08 EDT 2009
Wed Aug 19 04:23:10 EDT 2009
UnderTree =->

The fixtime script only provides a temporary fix. I have to run it every time I boot. For now, I can solve the problem by sourcing my script in /etc/conf.d/local. But I thought the settings in /etc/conf.d/hwclock, /etc/timezone, & /etc/localtime along with a one time application of "hwclock --noadjfile --localtime" & hwclock --hctosys should have been enough to stop Sabayon from expecting to find UTC in cmos on the next boot up. And it bothers me that I apparently still don't know how to do this...

What am I missing???????????????

--
joe3
Last edited by joe3 on Mon Aug 24, 2009 6:05, edited 1 time in total.
joe3
Advanced Hen
 
Posts: 200
Joined: Sun May 06, 2007 21:28

Re: UTC vs Localtime Again! What am I missing?

Postby Fitzcarraldo » Wed Aug 19, 2009 22:56

I have clock_systohc="YES" in /etc/conf.d/hwclock.

I don't know if it's relevant, but when I cat /etc/timezone there is no <CR><LF> at the end of it:

Code: Select all
acertm8215 zoneinfo # cat /etc/timezone
Europe/Londonacertm8215 zoneinfo #

Also, I don't use a symlink for the zoneinfo, to configure it I do the following:

Code: Select all
cp /usr/share/zoneinfo/Europe/London /etc/localtime


HOWTO: Clock, Time, UTC, Dual boot with Windows
User avatar
Fitzcarraldo
Sagely Hen
 
Posts: 7998
Joined: Sat Mar 10, 2007 5:40
Location: United Kingdom

Re: UTC vs Localtime Again! What am I missing?

Postby joe3 » Fri Aug 21, 2009 22:15

It would appear that on 19 Aug 2009, Fitzcarraldo did say:

> I have clock_systohc="YES" in /etc/conf.d/hwclock.

I used ' grep "clock=" ' The "=" limited the output to what I thought was the relevant line... Here's the result of grep "clock"

UnderTree =->
UnderTree =-> grep "clock" /etc/conf.d/hwclock
# Set CLOCK to "UTC" if your system clock is set to UTC (also known as
# Greenwich Mean Time). If your clock is set to the local time, then
clock="local"
clock_systohc="NO"
# If you wish to pass any other arguments to hwclock during bootup,
clock_args=""
UnderTree =->

I use ' clock_systohc="NO" ' because I do NOT want Sabayon adjusting the cmos clock for me.

> I don't know if it's relevant, but when I cat /etc/timezone there is
> no <CR><LF> at the end of it:
>
> Code: Select all
> acertm8215 zoneinfo # cat /etc/timezone
> Europe/Londonacertm8215 zoneinfo #

YOU have a sharp eye...I hadn't noticed that while I was copying that to the clipboard. I remember first seeing something like that while editing the text file I use to compose my forum messages with vim, I thought I must have gotten klutzy with a "J" while in command mode and I fixed it... {{ Spank! Spank! BAD keyboarder! Spankity spank spank! }} ;-)

> Also, I don't use a symlink for the zoneinfo, to configure it I do the following:
>
> Code: Select all
> cp /usr/share/zoneinfo/Europe/London /etc/localtime

I doubt that's the problem. Though I do recall that the How-to you mentioned does use the cp method. Other linux references say to use a symlink...

http://www.linuxsa.org.au/tips/time.html
http://tldp.org/HOWTO/Clock-2.html

And it does make it ever so much easier to see which timezone is currently selected...

Still, on the off chance that Sabayon actually cares, I'll try the cp method again...

Thanks

--
joe3
joe3
Advanced Hen
 
Posts: 200
Joined: Sun May 06, 2007 21:28

Re: UTC vs Localtime Again! What am I missing?

Postby Fitzcarraldo » Sat Aug 22, 2009 1:59

Although the SL installation does this by default, I'd also check if the hwclock init script is still configured to run when you boot your PC:

Code: Select all
acertm8215 fitzcarraldo # rc-update show | grep hwclock
              hwclock |                            boot
acertm8215 fitzcarraldo #
User avatar
Fitzcarraldo
Sagely Hen
 
Posts: 7998
Joined: Sat Mar 10, 2007 5:40
Location: United Kingdom

Re: UTC vs Localtime Again! What am I missing?

Postby joe3 » Sat Aug 22, 2009 3:46

It would appear that on 22 Aug 2009, Fitzcarraldo did say:

> Although the SL installation does this by default, I'd also check if
> the hwclock init script is still configured to run when you boot your PC:

That sounds worth checking...

UnderTree =-> rc-update show | grep hwclock
hwclock | boot
UnderTree =->

<sigh>

--
Joe3
joe3
Advanced Hen
 
Posts: 200
Joined: Sun May 06, 2007 21:28

Re: UTC vs Localtime Again! What am I missing?

Postby joe3 » Sat Aug 22, 2009 15:07

I don't know if it means much, But it occurred to me that maybe there's some useful info to be had with demesg... So I rebooted Sabayon (nox) logged in as a normal user and did a:
dmesg > ~/com/uplo/dmesg.out

Then after I started e17 via startx, and opened the text file I'm using to compose this message, with vim I used:
:r!grep clock ~/com/uplo/dmesg.out
to include this
[ 5.407093] rtc_cmos 00:04: setting system clock to 2009-08-22 08:00:49 UTC (1250928049)

For at least the next 30 days a copy of the complete ~/com/uplo/dmesg.out
file can be had at:
https://home.comcast.net/~jtwdyp/fileShuttle/dmesg.out

Like I said, I don't know what it means except that it does demonstrate that Sabayon is insisting on reading the cmos clock as UTC time in spite of the 'clock="local"' line in /etc/conf.d/hwclock...

I'm not sure what's causing this or if it could be related to the fact that sometimes Sabayon fails to find the internet via the hard wired router ethernet connection to my cable modem... Or the fact that every now and then if fails to find the alsa settings and so spends a bit of time loading all detected alsa drivers... But I don't think any of these things were happening before I used equo to install e17... And actually I don't remember them starting until about a week afterwards... As it happens I mad a couple of tar -czf {filename.tgz} back up file sets of my sabayon partitions from my (kubuntu or opensuse) installation One before I installed e17, and one set just afterwards... Course I've spent a bit of time working on my shell scripts, and my e17 configuration since then But if I made a separate backup of my ~/bin and ~/.e directories first it shouldn't be two hard to use my kubuntu root account to try restoring one of the back-ups ((using the --numeric-owner option...)) I made before I started noticing these issues. But if I do that I'll never learn what's causing this... If it was just the UTC time issue, I wouldn't think of it as long as sourcing my fixtime script in /etc/conf.d/local works. But if that other behavior that sometimes leaves me stuck in offline mode (a different thread) keeps happening I'm probably going to try it... But not just yet.

--
Joe3
joe3
Advanced Hen
 
Posts: 200
Joined: Sun May 06, 2007 21:28

Re: UTC vs Localtime Again! What am I missing?

Postby joe3 » Mon Aug 24, 2009 6:05

OK I don't understand why Sabayon cares whether /etc/localtime was set to the correct zoneinfo file via "cp" or "ln -s".
But while the symlink works with other distros redoing /etc/localtime but copying the actual zoneinfo file to it instead of just making it a symlink pointing at the zoninfo file solved this problem... A fact that my personal cheat sheets will reflect for future reference...

--
Joe3
joe3
Advanced Hen
 
Posts: 200
Joined: Sun May 06, 2007 21:28


Return to Sabayon Linux General Discussion

Who is online

Users browsing this forum: No registered users and 3 guests