LinuxQuestions.org
Download your favorite Linux distribution at LQ ISO.
Home Forums Tutorials Articles Register
Go Back   LinuxQuestions.org > Forums > Linux Forums > Linux - Distributions > Slackware
User Name
Password
Slackware This Forum is for the discussion of Slackware Linux.

Notices


Reply
  Search this Thread
Old 01-14-2013, 10:57 AM   #1
mutexe
Member
 
Registered: May 2009
Location: Malvern, UK
Distribution: Slackware 14.1
Posts: 240

Rep: Reputation: 32
Time woes


Morning,
I booted up my slack box for the first time in nearly 12 months today. Turns out the system time was completely screwed (thought it was 2005 for some reason).
I followed instructions on this website: http://pc-freak.net/blog/how-to-fix-...time-troubles/ which seemed to do the trick.
My question is: is this time discrepancy an artifact of me not switching on the machine enough or is there something I need to be doing like binding it to some sort of ntp server when the box boots up?
Many thanks in advance.
Tom
 
Old 01-14-2013, 11:36 AM   #2
tronayne
Senior Member
 
Registered: Oct 2003
Location: Northeastern Michigan, where Carhartt is a Designer Label
Distribution: Slackware 32- & 64-bit Stable
Posts: 3,541

Rep: Reputation: 1065Reputation: 1065Reputation: 1065Reputation: 1065Reputation: 1065Reputation: 1065Reputation: 1065Reputation: 1065
Couple of things.

First one, you've most likely got a dead battery on the mother board, good idea to change it.

Second one, include a call to ntpdate in /etc/rc.d/rc.M before the call to start ntpd (that's after the network starts and additional filesystems are mounted).

You'd want to do something like
Code:
# Mount any additional filesystem types that haven't already been mounted:
mount -a -v 2> /dev/null | grep -v "already mounted"

# Start the Control Script for automounter:
if [ -x /etc/rc.d/rc.autofs ]; then
  sh /etc/rc.d/rc.autofs start
fi

# Set the time and date
/usr/sbin/ntpdate pool.ntp.org
sleep 1

# Start the Network Time Protocol daemon:
if [ -x /etc/rc.d/rc.ntpd ]; then
  sh /etc/rc.d/rc.ntpd start
fi
Given that the network is started, you can probably use pool.ntp.org, but it might be a good idea to try using an actual address (right now, pool.ntp.org is 108.61.56.35). Go to the NTP web site (http://www.ntp.org) and look through the addresses of stratum 2 servers and ping a few of them to pick one electrically close to you (you're looking for a low time value); use the actual address, not the name (like nnn.nn.nn.n).

Third option -- when you start the box, get into the bios and check and possibly set the time (especially with a dead battery).

Hope this helps some.

Last edited by tronayne; 01-14-2013 at 12:09 PM.
 
1 members found this post helpful.
Old 01-14-2013, 11:45 AM   #3
michaelk
Moderator
 
Registered: Aug 2002
Posts: 25,700

Rep: Reputation: 5895Reputation: 5895Reputation: 5895Reputation: 5895Reputation: 5895Reputation: 5895Reputation: 5895Reputation: 5895Reputation: 5895Reputation: 5895Reputation: 5895
Yes it is due to not being turned on and/or that you need to replace the BIOS battery. Hardware clocks are not very accurate and would expect it to drift if the computer has not been powered on for awhile. NTP will try to compensate for hardware clock drift but may not be enough if you are not going to power on the computer regularly.
 
Old 01-15-2013, 02:15 AM   #4
mutexe
Member
 
Registered: May 2009
Location: Malvern, UK
Distribution: Slackware 14.1
Posts: 240

Original Poster
Rep: Reputation: 32
Cheers guys.
I'll pick up a new battery.
 
  


Reply



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
how to understand user time, sys time, wait time, idle time of CPU guixingyi Linux - Server 1 08-24-2010 10:10 AM
PAM time restrictions - changing Time.conf so it gets time from sql table noodlesoffire Linux - Newbie 1 04-04-2010 04:41 PM
Linux real-time file replication woes bretticus Linux - Enterprise 5 01-17-2006 09:44 PM
First-time kernel compile woes... redkazan Slackware 6 01-09-2004 01:13 PM

LinuxQuestions.org > Forums > Linux Forums > Linux - Distributions > Slackware

All times are GMT -5. The time now is 04:40 AM.

Main Menu
Advertisement
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
Open Source Consulting | Domain Registration