LinuxQuestions.org
Help answer threads with 0 replies.
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 06-09-2014, 12:39 PM   #16
Richard Cranium
Senior Member
 
Registered: Apr 2009
Location: McKinney, Texas
Distribution: Slackware64 15.0
Posts: 3,858

Rep: Reputation: 2225Reputation: 2225Reputation: 2225Reputation: 2225Reputation: 2225Reputation: 2225Reputation: 2225Reputation: 2225Reputation: 2225Reputation: 2225Reputation: 2225

Quote:
Originally Posted by hpfeil View Post
My clock keeps getting set to UTC by the Posix Police. /etc/rc.d/rc.ntpd won't fix it no matter how many '-g's I add, but ntpdate does work. When the Posix Police delete that, I'll compile my own.
/etc/ntp.conf:
# Use the pool, Luke!
pool 3.us.pool.ntp.org
pool 2.us.pool.ntp.org
pool 1.us.pool.ntp.org
pool 0.us.pool.ntp.org
driftfile /etc/ntp/drift

rshepard, while the computer is in the shop, ask the tech to replace the CMOS battery.
What does
Code:
cat /etc/hardwareclock
print out on your system?
 
Old 06-24-2014, 03:45 PM   #17
rshepard
Member
 
Registered: Oct 2007
Location: Troutdale, Oregon
Distribution: Slackware
Posts: 435

Original Poster
Rep: Reputation: 28
Quick update.

I've still not confirmed just how to restore the missing package on the Sony hard drive so that's still hanging. In the meantime, I replaced an older xubuntu with Slackware-14.1 on the old Toshiba Satellite, and the user reports that it, too, keeps gaining time. This morning it was about 60 hours ahead.

On my Dell laptop, and on the servers and workstations, /usr/sbin/ntpd is run at the end of the boot process from within /etc/rc.d/rc.local; I had not modified rc.local on either the Sony or Toshiba portables. That might be the problem. I added it to the Toshiba and will learn in a day or so if that fixes the problem. If not, I'll add 'ntpd -q' as a cron job every couple of hours or so. Since ntpdate has been deprecated this cron job should set the time and keep it more-or-less correct (which is good enough for a single user laptop).

Rich
 
Old 06-24-2014, 08:42 PM   #18
Richard Cranium
Senior Member
 
Registered: Apr 2009
Location: McKinney, Texas
Distribution: Slackware64 15.0
Posts: 3,858

Rep: Reputation: 2225Reputation: 2225Reputation: 2225Reputation: 2225Reputation: 2225Reputation: 2225Reputation: 2225Reputation: 2225Reputation: 2225Reputation: 2225Reputation: 2225
Why aren't you simply running it out of rc.M by making /etc/rc.d/rc.ntpd executable?
 
Old 06-25-2014, 08:51 AM   #19
rshepard
Member
 
Registered: Oct 2007
Location: Troutdale, Oregon
Distribution: Slackware
Posts: 435

Original Poster
Rep: Reputation: 28
Quote:
Originally Posted by Richard Cranium View Post
Why aren't you simply running it out of rc.M by making /etc/rc.d/rc.ntpd executable?
I am. That's the way all hosts are configured. But, these two portables are not keeping time; they gain for some reason. If re-running ntpd from within rc.local does not do the trick I'll set a cron job to do so every 2-3 hours. No one who's looked at this issue has been able to identify a reason so if running the equivalent of ntpdate now and then keeps the time currnt that is good enough.

Thanks, Richard,

Rich
 
Old 06-25-2014, 11:29 AM   #20
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
Fact: they should not do this.

Question: What software have you added to the standard Slackware 14.1 (other than the patches from, say, OSU or by some other method)?

The hardware clock, if set to UTC, will set the system (software) clock on boot by /etc/rc.d/rc.S; on shutdown, the system time is written to the hardware clock by /etc/rc.d/rc.6 when rebooting or the system time is written to the hardware clock by /etc/rc.d/rc.0 on shut down (as in power off). Read that again, the hardware clock is set on shut down or reboot. Keep that in mind: the system time is set from the hardware clock on boot, the hardware clock is set from the system time on shut down or reboot.

There is no mention of anything about hardware or software clocks in /etc/rc.d/rc.M; it is what starts the NTP daemon.

The daemon will not synchronize with anything if the Internet is not available when it starts -- it may -- may -- start after some time when the internet becomes available (as in wireless getting connected manually after boot); however, if wireless is connected with WICD, your /etc/resolv.conf file will have been wiped clean and you'll probably want to do the following:

On my laptop (a Dell 1750 running Slackware 14.1 64-bit), which is normally connected with an Ethernet cable to an always-on router, works just fine until I lug it somewhere and connect it with WICD to a wireless point. I keep a file, /etc/resolv.bak that I simply copy to /etc/resolv.conf in that case; it looks like this:
Code:
cat resolv.bak
search com
# AT&T DNS Servers
#nameserver 68.94.156.1
#nameserver 68.94.157.1
# Google Free DNS Servers
#nameserver 8.8.8.8
#nameserver 8.8.4.4
# HughesNet DNS Servers
nameserver 66.82.4.8
nameserver 66.82.4.12
The active DNS server addresses are the HughesNet ones (I have satellite service). The others may or may not be activated (un-commented) depending upon where I am at any given time using the laptop.

Likewise, if you don't have a connection to the Internet and you execute either ntpdate <server> or ntpd -g with no Internet connection, you don't get anything set. ntpd -g will use the server(s) you have set in /etc/ntp.conf (and that won't do any good if you don't have a connection the Internet and entries in /etc/resolv.conf so 0.us.pool.ntp.org can be resolved to a numeric address by a DNS server.

By the way, you really can't count on a router's DNS all the time; they tend to stop working after X amount of time has passed and you don't get no DNS from 'em (not always, but it's been my experience).

You can check what the time is in any system by simply booting the thing into the BIOS (or equivalent) and look at the clock; that's the hardware clock. It can be set to either local time or to UTC (you're in Oregon, that's local time plus seven hours during daylight time). Whatever it is set to, your system must "know" that, which is done with the timeconfig utility. Pick one, pick the other and stick with it. Note that if your hardware clock is at UTC and you tell timeconfig to use local time, that ain't gonna work too good if your system is configured as UTC:
Code:
cd /etc
grep UTC * 2>/dev/null
adjtime:UTC
hardwareclock:UTC
means that your system is expecting the hardware clock to be UTC and you want to set timeconif appropriately (it's not going to hurt anything if the hardware clock is UTC, it also won't hurt anything if the hardware clock is local time but you've got to get that set correctly). You may need to shut down and boot back into BIOS and fiddle with the hardware clock time for local or UTC which will set the system clock to the "right" time on reboot. The system time (not the hardware time) will be set on boot from the hardware clock.

Bottom line: NTPD works if you let it.

Hope this helps some.

Last edited by tronayne; 06-26-2014 at 10:44 AM. Reason: Speling stuf right.
 
Old 06-26-2014, 09:10 AM   #21
rshepard
Member
 
Registered: Oct 2007
Location: Troutdale, Oregon
Distribution: Slackware
Posts: 435

Original Poster
Rep: Reputation: 28
Thank you.
 
  


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
ntpdate/ntpd time is in UTC instead of local time? m4rtin Linux - Software 7 05-06-2011 07:57 AM
ntpd gives me non-local time, how can I fix it? inbayarea2010 Linux - Server 2 02-10-2011 03:57 AM
ntpd not keeping time accurate humbletech99 Linux - Networking 2 05-22-2007 09:41 AM
hwclock on a laptop is not keeping time okmyx SUSE / openSUSE 1 12-01-2004 08:42 PM
ntpd not correcting local time plythgam Linux - Software 1 08-16-2004 04:12 PM

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

All times are GMT -5. The time now is 07:17 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