LinuxQuestions.org
Visit the LQ Articles and Editorials section
Go Back   LinuxQuestions.org > Forums > Linux Forums > Linux - Distributions > Debian
User Name
Password
Debian This forum is for the discussion of Debian Linux.

Notices

Reply
 
Search this Thread
Old 09-01-2003, 03:13 PM   #1
pe2338
Member
 
Registered: Dec 2002
Location: Bucharest,RO
Distribution: debian etch, sarge and sid
Posts: 407

Rep: Reputation: 30
Question RTC time on a locally set clock


I have my hardware clock set to local time not to UTC time.
Imade an upgrade from 2.4.16 to 2.4.21 recentlly and I saw that the time is displayed as if I had the time stored to UTC. The time was correctlly displayed with the older kernel.

How could I counfigure it to show the local time?
I mean, what should change?
 
Old 09-01-2003, 04:07 PM   #2
beolach
LQ Newbie
 
Registered: Jul 2003
Distribution: Gentoo
Posts: 29

Rep: Reputation: 15
My guess is the new kernel was compiled with
CONFIG_APM_RTC_IS_GMT set. In make menuconfig you can
change this under General Setup -> Power Managment ->
Advanced Power Management BIOS support -> RTC stores time in
GMT.
 
Old 09-02-2003, 12:36 PM   #3
pe2338
Member
 
Registered: Dec 2002
Location: Bucharest,RO
Distribution: debian etch, sarge and sid
Posts: 407

Original Poster
Rep: Reputation: 30
Question standard behaviour

The kernel I have installed is a standard kernel that came through apt-get , so my question is: Is this the standard way to compile the kernel?

Anyway, at the installation of the system I was asked if my time was GMT or if it was local. Is this a matter of the 2.2.20 kernel? (yes, 2.2.20-woody).
 
Old 09-02-2003, 03:38 PM   #4
beolach
LQ Newbie
 
Registered: Jul 2003
Distribution: Gentoo
Posts: 29

Rep: Reputation: 15
I don't have any experience with Debian, so this is based on my
experience with Slackware. In it's setup process it also asks if the
RTC is local or GMT/UTC, which it stores in /etc/hardwareclock.
Then the startup scripts poll this file, and set the system time
based on it: using either "hwclock --utc --hctosys" or else
"hwclock --localtime --hctosys".

So now that I've looked into it further, I'm actually not sure what
the kernel option does. Wild guess is it sets the default for if
"hwclock --hctosys" (set system time from the RTC) is called
without specifying --utc or --localtime.

So my suggestion to resolve this would be to look through your
startup scripts & find where the system time is set, and make sure
it is using --localtime.

Here are the /etc/hardwareclock file and the relevant part of my
startup scripts.
Code:
# /etc/hardwareclock
#
# Tells how the hardware clock time is stored.
# You should run timeconfig to edit this file.

localtime
Code:
# Set the system time from the hardware clock using hwclock --hctosys.
# Detect SGI Visual Workstation, since hwclock will make those freeze up:
if fgrep -l Cobalt-APIC /proc/interrupts 1> /dev/null 2> /dev/null ; then
  echo "SGI Visual Workstation detected.  Not running hwclock."
elif [ -x /sbin/hwclock ]; then
  if grep "^UTC" /etc/hardwareclock 1> /dev/null 2> /dev/null ; then
    echo "Setting system time from the hardware clock (UTC)."
    /sbin/hwclock --utc --hctosys
  else
    echo "Setting system time from the hardware clock (localtime)."
    /sbin/hwclock --localtime --hctosys
  fi
fi
 
Old 09-04-2003, 01:31 AM   #5
pe2338
Member
 
Registered: Dec 2002
Location: Bucharest,RO
Distribution: debian etch, sarge and sid
Posts: 407

Original Poster
Rep: Reputation: 30
I don't have any /etc/hwdclock or something alike, but I found two scripts in /etc/init.d that are ran at boot time (rc.S) and they depend on a variable UTC that should be yes or no. Is not specified in the hwdclock.sh scripts but as I found out from the man pages there should be in rc.S

I've set the UTC var in rc.S script, but for the moment I haven't restarted the box. I hope this will do the trick. I will tell you how it worked when I get back from work.
 
Old 09-04-2003, 09:41 AM   #6
_kossak_
Member
 
Registered: Apr 2003
Location: Minde. Portugal
Distribution: DEBIAN
Posts: 87

Rep: Reputation: 15
/etc/default/rcS

that's where the UTC variable is set
 
Old 09-04-2003, 09:41 AM   #7
_kossak_
Member
 
Registered: Apr 2003
Location: Minde. Portugal
Distribution: DEBIAN
Posts: 87

Rep: Reputation: 15
/etc/default/rcS

that's where the UTC variable is set
 
Old 09-06-2003, 04:29 AM   #8
pe2338
Member
 
Registered: Dec 2002
Location: Bucharest,RO
Distribution: debian etch, sarge and sid
Posts: 407

Original Poster
Rep: Reputation: 30
Talking problem unknown

I found that in rcS the UTC variable was set to no but I must have had at one time an application that changed the hour in BIOS directly and not through the kernel clock.

So the BIOS time was set incorectlly.

Changed in BIOS then no more problems...

the question remains: who was the offender ?
 
Old 09-06-2003, 04:30 AM   #9
pe2338
Member
 
Registered: Dec 2002
Location: Bucharest,RO
Distribution: debian etch, sarge and sid
Posts: 407

Original Poster
Rep: Reputation: 30
Talking forgot to thank people ...

Thanks to everybody for the posts...
 
  


Reply


Thread Tools Search this Thread
Search this Thread:

Advanced Search

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is Off
HTML code is Off


Similar Threads
Thread Thread Starter Forum Replies Last Post
Various clock issues: Clock shows wrong time only in Knoppmyth, & CMOS time change ? davidbix General 1 04-05-2006 09:58 PM
How to set the clock 357mag Mandriva 4 03-07-2005 03:08 AM
Real Time Clock(RTC) problem gongcon Linux - Software 6 01-06-2005 09:36 PM
My clock won't set! johnnyLongside Linux - General 1 03-19-2004 03:00 AM
time clock jimval7 Linux - Distributions 2 03-21-2002 03:04 PM


All times are GMT -5. The time now is 05:13 AM.

Main Menu
My LQ
Write for LQ
LinuxQuestions.org is looking for people interested in writing Editorials, Articles, Reviews, and more. If you'd like to contribute content, let us know.
Main Menu
Syndicate
RSS1  Latest Threads
RSS1  LQ News
Twitter: @linuxquestions
identi.ca: @linuxquestions
Facebook: linuxquestions Google+: linuxquestions
Open Source Consulting | Domain Registration