LinuxQuestions.org

LinuxQuestions.org (/questions/)
-   Debian (https://www.linuxquestions.org/questions/debian-26/)
-   -   RTC time on a locally set clock (https://www.linuxquestions.org/questions/debian-26/rtc-time-on-a-locally-set-clock-88092/)

pe2338 09-01-2003 03:13 PM

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?

beolach 09-01-2003 04:07 PM

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.

pe2338 09-02-2003 12:36 PM

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).

beolach 09-02-2003 03:38 PM

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


pe2338 09-04-2003 01:31 AM

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.

_kossak_ 09-04-2003 09:41 AM

/etc/default/rcS

that's where the UTC variable is set

_kossak_ 09-04-2003 09:41 AM

/etc/default/rcS

that's where the UTC variable is set

pe2338 09-06-2003 04:29 AM

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...

:scratch: the question remains: who was the offender :) ?

pe2338 09-06-2003 04:30 AM

forgot to thank people ...
 
Thanks to everybody for the posts...


All times are GMT -5. The time now is 03:16 AM.