VectorLinux

Vectorbie Station => Vectorbie Questions => Topic started by: Locator on March 11, 2013, 05:03:46 pm

Title: Daylight Savings Time???
Post by: Locator on March 11, 2013, 05:03:46 pm
Is there any way to compensate for Daylight Savings Time in Vector Linux 7.0?
Title: Re: Daylight Savings Time???
Post by: roarde on March 11, 2013, 07:25:25 pm
It should be automatic, but I'm wondering if the US timezones aren't out of date and have the old, later dates for the switchover. I'm having the same problem.
Title: Re: Daylight Savings Time???
Post by: MarkGrieveson on March 11, 2013, 08:34:06 pm
Mine worked fine.
Title: Re: Daylight Savings Time???
Post by: retired1af on March 12, 2013, 03:59:59 am
I'll have to dig into my BIOS settings to see if there's a DST switch. Mine didn't change over, either, but my installations are set to get the time from the system.
Title: Re: Daylight Savings Time???
Post by: Locator on March 12, 2013, 01:10:04 pm
Mine worked fine.

How do I get my Vector Linux 7.0 to work fine as well? My clock didn't change over automatically.
Title: Re: Daylight Savings Time???
Post by: M0E-lnx on March 12, 2013, 01:37:47 pm
Mine worked fine.

How do I get my Vector Linux 7.0 to work fine as well? My clock didn't change over automatically.

Try runing vzoneset and set your correct time zones.  Mine worked just fine.
Title: Re: Daylight Savings Time???
Post by: Locator on March 12, 2013, 04:06:02 pm
Where do I find it?
Title: Re: Daylight Savings Time???
Post by: roarde on March 12, 2013, 07:17:48 pm
vzoneset:  open a terminal, su, then vzoneset

Can also access this through VASM or VasmCC.

But I'm thinking it may be the ones where hardware clock is set to localtime that are having the problem, and not those set to GMT.

Mine didn't change over, date still returns "EDT", hw clock is on local time.
Title: Re: Daylight Savings Time???
Post by: MarkGrieveson on March 15, 2013, 07:54:38 pm
I'm not sure why mine worked.  It is set to local time.  It relies on the computer's time.  So, I think it would not have worked if the time within the computer did not change.  If I wish to alter the time (IE, adjust it by a few minutes if I've noticed that it's a little off) I do it via the BIOS, and not via Vector.
Title: Re: Daylight Savings Time???
Post by: nightflier on March 16, 2013, 08:22:30 am
I usually run ntp on my machines. If you don't want a daemon running, you can add a command like "ntpdate -b pool.ntp.org" to rc.local, and it will set the clock on boot.
Title: Re: Daylight Savings Time???
Post by: retired1af on March 16, 2013, 08:27:35 am
I've always had terrible luck with getting NTP to run properly. I finally gave up years ago and just set it manually if I have to.
Title: Re: Daylight Savings Time???
Post by: MarkGrieveson on March 16, 2013, 12:40:54 pm
I don't have ntp installed on my machine.
Title: Re: Daylight Savings Time???
Post by: sledgehammer on March 16, 2013, 02:47:24 pm
My time switched just fine. Perhaps its because I had followed hata_ph's suggestion on this forum some time back:
   
Quote
Re: automatically starting ntp.conf
« Reply #3 on: June 29, 2012, 06:02:25 am »
   Reply with quoteQuote
1. copy this file https://projects.archlinux.org/svntogit/packages.git/tree/trunk/ntpd?h=packages/ntp to your /etc/rc.d/init.d
2. chmod 755 /etc/rc.d/init.d/ntpd
3. chown root:root /etc/rc.d/init.d/ntpd
4. after that you should be able to configure it under vasm>services

I don't know how to "configure it under vasm>services" as hata_ph suggested, but it seems to work fine without any configuration.  NTPD does show in run level 4.

I wholeheartedly agree with retired1af's comments about ntp.  However helpful NTP may be, the NTP site is one of those sites maintained by people who seem more interested in impressing the reader with their expertise than in, as hata_ph did, just showing us what to do.
Title: Re: Daylight Savings Time???
Post by: roarde on March 16, 2013, 06:34:48 pm
Scrounged around and found references to rc.S (naturally).

From /etc/rc.d/rc.S:
# Set the system time from the hardware clock using hwclock --hctosys.
if ! grep -qw nohwclock /proc/cmdline && [ -x /sbin/hwclock ]; then
  if ! grep -q -w rtc /proc/ioports ; then
    CLOCK_OPT="--directisa"
  fi
  if grep "^UTC" /etc/hardwareclock 1> /dev/null 2> /dev/null ; then
    /etc/rc.d/rc.text 9 'Setting system time from the hardware clock (UTC).'
      # bootsplash
      progressbar 18
    echo "Setting system time from the hardware clock (UTC)."
    /sbin/hwclock $CLOCK_OPT --utc --hctosys >> $INITLOG 2>&1
  else
    /etc/rc.d/rc.text 9 'Setting system time from the hardware clock (localtime).'
      # bootsplash
      progressbar 19
    echo "Setting system time from the hardware clock (localtime)."
    /sbin/hwclock $CLOCK_OPT --localtime --hctosys >> $INITLOG 2>&1
  fi
fi


Wasn't familiar with hwclock
HWCLOCK(8)                  System Manager's Manual                 HWCLOCK(8)

NAME
       hwclock - query and set the hardware clock (RTC)

SYNOPSIS
       hwclock [functions] [options]


"hctosys" is a function; "utc" and "localtime" are options. So I moved --hctosys to before --utc and --localtime.

Worked.

I'd like to know how these lines read for those that are working, and for those that aren't.

BTW:    vlconfig2 version is 7.0 3vl70
Title: Re: Daylight Savings Time???
Post by: sledgehammer on March 16, 2013, 06:51:51 pm
Mine (works) looks the same.

Quote
# Set the system time from the hardware clock using hwclock --hctosys.
if ! grep -qw nohwclock /proc/cmdline && [ -x /sbin/hwclock ]; then
  if ! grep -q -w rtc /proc/ioports ; then
    CLOCK_OPT="--directisa"
  fi
  if grep "^UTC" /etc/hardwareclock 1> /dev/null 2> /dev/null ; then
    /etc/rc.d/rc.text 9 'Setting system time from the hardware clock (UTC).'
      # bootsplash
      progressbar 18
    echo "Setting system time from the hardware clock (UTC)."
    /sbin/hwclock $CLOCK_OPT --utc --hctosys >> $INITLOG 2>&1
  else
    /etc/rc.d/rc.text 9 'Setting system time from the hardware clock (localtime).'
      # bootsplash
      progressbar 19
    echo "Setting system time from the hardware clock (localtime)."
    /sbin/hwclock $CLOCK_OPT --localtime --hctosys >> $INITLOG 2>&1
  fi
fi
Title: Re: Daylight Savings Time???
Post by: roarde on March 16, 2013, 06:54:53 pm
Right, sledgehammer. But in the end, your time is being set by ntp. Not sure if what rc.S does has an effect you'll notice in your case.

Thanks very much for the reply.
Title: Re: Daylight Savings Time???
Post by: StrayBit on March 18, 2013, 09:29:23 am
When you shut down, the hardware clock is set to system time in /etc/rc.d/rc.k in both VL6 and VL7.0:
Code: [Select]
# Save the system time to the hardware clock using hwclock --systohc.
if [ -x /sbin/hwclock ]; then
  # Check for a broken motherboard RTC clock (where ioports for rtc are
  # unknown) to prevent hwclock causing a hang:
  if ! grep -q -w rtc /proc/ioports ; then
    CLOCK_OPT="--directisa"
  fi
  if grep -q "^UTC" /etc/hardwareclock 2> /dev/null ; then
    /etc/rc.d/rc.text 5 "Saving system time to the hardware clock (UTC)."
     # bootsplash
     progressbar 25
    echo "Saving system time to the hardware clock (UTC)."
    /sbin/hwclock $CLOCK_OPT --utc --systohc
  else
    /etc/rc.d/rc.text 4 "Saving system time to the hardware clock (localtime)."
     # bootsplash
     progressbar 20
    echo "Saving system time to the hardware clock (localtime)."
    /sbin/hwclock  $CLOCK_OPT --localtime --systohc
  fi
fi
This is working in VL6 but I haven't used VL7.0 enough to verify it is working there.

I was surprised and confused when my system updated to DST after I had manually set it the night before.  I did leave my system running that night.   Perhaps the system must be running at the change time to work.

I've added "ntpdate -b pool.ntp.org" to rc.local and extend my thanks to nightflier.

Bruce