-   Slackware (
-   -   Time woes (

mutexe 01-14-2013 11:57 AM

Time woes
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: 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.

tronayne 01-14-2013 12:36 PM

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

# 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

# Set the time and date
sleep 1

# Start the Network Time Protocol daemon:
if [ -x /etc/rc.d/rc.ntpd ]; then
  sh /etc/rc.d/rc.ntpd start

Given that the network is started, you can probably use, but it might be a good idea to try using an actual address (right now, is Go to the NTP web site ( 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.

michaelk 01-14-2013 12:45 PM

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.

mutexe 01-15-2013 03:15 AM

Cheers guys.
I'll pick up a new battery.

All times are GMT -5. The time now is 09:47 PM.