ntpd

Place to discuss Fedora and/or Red Hat

ntpd

Postby worker201 » Mon Jan 03, 2005 1:55 pm

Returning to the office after break, I noticed that my clock is about six hours off. I went into the date/time adjuster to see if I could find out why ntp wasn't being updated. Got this nice little error:

system-config-date wrote:Couldn't connect to one of these time servers:

mx2.gs.washington.edu
mx2.gs.washington.edu
neate.neateroller.com
clock1.redhat.com
clock2.redhat.com

Either none of them are available or the firewall settings on your computer are blocking NTP connections.


I'm fairly certain that my firewall is not blocking ntp. But I'm also fairly certain that not all of these servers are down at the same time.

Any help?
worker201
guru
guru
 
Posts: 668
Joined: Sun Jun 13, 2004 6:38 pm
Location: Hawaii

Postby Void Main » Mon Jan 03, 2005 5:12 pm

Apparently you never sync your hardware clock if you were 6 hours off. To initially set my clock I usually do the "service ntpd restart" thing and verify that ntpdate has done the initial clock sync and then I do a "hwclock --systohc" so it saves it to the hardware clock. At that point NTP should be syncing (except both of these sound broken in your case at the moment). I also always add two lines to root's cron to make sure the daemon is running and to sync the system clock to hardware every night:

10 0 * * * /sbin/service ntpd restart > /dev/null 2>&1
17 0 * * * /sbin/hwclock --systohc > /dev/null 2>&1

Sometimes ntpd dies so this ensures your clock is always up to date, unless you have some sort of communication problem of course. You can always run a network trace with Ethereal and watch your NTP traffic. You can also run diagnostic commands like "ntptrace servername", "ntpstat", "ntpq", "ntpdq", etc. They all have man pages.

Also more info here:
http://www.ntp.org/ntpfaq/NTP-s-trouble.htm

Don't know if that helps or told you what you already knew or not. Hopefully it will help.
User avatar
Void Main
Site Admin
Site Admin
 
Posts: 5705
Joined: Wed Jan 08, 2003 5:24 am
Location: Tuxville, USA

Postby worker201 » Tue Jan 04, 2005 12:00 am

Thanks for the tips, I'll mess with those when I get to the office.

Usually, when I switch from Fedora to Windows, my Windows clock is 6 hours ahead (GMT), and I have to force it to contact the ntp server, since Windows only checks the time every 12 hours or so.

This time, Windows had the right time, but Fedora was 6 hours behind. So maybe Windows reset the hardware clock, for the first time ever. It hasn't done this before... Then, Fedora would think that hardware time (set to local time) was GMT, and then subtract 6 hours for system time. Why it wouldn't update, though, is another story altogether.
worker201
guru
guru
 
Posts: 668
Joined: Sun Jun 13, 2004 6:38 pm
Location: Hawaii

Postby Void Main » Tue Jan 04, 2005 12:06 am

Oh, you have a virus on your machine. :) Do you have your time zones set properly in both OSs and your RH box set to not use UTC?

Here's what your /etc/sysconfig/clock file should look like if your are central time:

ZONE="America/Chicago"
UTC=false
ARC=false

or just run system-config-date, and of course you should have the same TZ set on the dark side of your hard drive.
User avatar
Void Main
Site Admin
Site Admin
 
Posts: 5705
Joined: Wed Jan 08, 2003 5:24 am
Location: Tuxville, USA

Postby worker201 » Tue Jan 04, 2005 2:26 pm

My UTC is not set to false - according to Fedora graphical install, setting UTC to true will make your computer able to adjust to daylight savings time.
worker201
guru
guru
 
Posts: 668
Joined: Sun Jun 13, 2004 6:38 pm
Location: Hawaii

Postby Void Main » Tue Jan 04, 2005 2:52 pm

My machines adjust just fine. If you are happy with it being 6 hours off you can leave it on.
User avatar
Void Main
Site Admin
Site Admin
 
Posts: 5705
Joined: Wed Jan 08, 2003 5:24 am
Location: Tuxville, USA

Postby worker201 » Tue Jan 04, 2005 4:04 pm

:D
worker201
guru
guru
 
Posts: 668
Joined: Sun Jun 13, 2004 6:38 pm
Location: Hawaii

Postby worker201 » Tue Jan 04, 2005 5:40 pm

Aha!

[lholcombe@holcombe2 sbin]$ service ntpd restart
Shutting down ntpd: [FAILED]
ntpd: Synchronizing with time server: [FAILED]
Starting ntpd: ntpd: error while loading shared libraries: libm.so.6: failed to map segment from shared object: Permission denied
[FAILED]


libm.so.6 appears in 3 locations (/lib, /lib/tls, /lib/i686) on my computer, and each time, it is a symbolic link to libm-2.3.4.so

So there really is a genuine problem of some sort here. (I went ahead and set UTC to false, btw)
worker201
guru
guru
 
Posts: 668
Joined: Sun Jun 13, 2004 6:38 pm
Location: Hawaii

Postby Void Main » Tue Jan 04, 2005 6:25 pm

You have to be root to start/stop/restart the ntpd service (like almost all services):

$ su -
# service ntpd restart
User avatar
Void Main
Site Admin
Site Admin
 
Posts: 5705
Joined: Wed Jan 08, 2003 5:24 am
Location: Tuxville, USA

Postby worker201 » Tue Jan 04, 2005 7:26 pm

You would think so, but that appears not to be the case:
[lholcombe@holcombe2 ~]$ su
Password:
[root@holcombe2 lholcombe]# service ntpd start
ntpd: Synchronizing with time server: [FAILED]
Starting ntpd: ntpd: error while loading shared libraries: libm.so.6: failed to map segment from shared object: Permission denied
[FAILED]


Any other ideas?
worker201
guru
guru
 
Posts: 668
Joined: Sun Jun 13, 2004 6:38 pm
Location: Hawaii

Postby Void Main » Tue Jan 04, 2005 7:39 pm

Looks like you have problems. I have never seen that. What distro and version are you running? Is it up to date? Are you using the ntp package that comes with the distro? Check to make sure the two items in the error message pass verification:

# rpm -V ntp
# rpm -V glibc
Last edited by Void Main on Tue Jan 04, 2005 7:50 pm, edited 1 time in total.
User avatar
Void Main
Site Admin
Site Admin
 
Posts: 5705
Joined: Wed Jan 08, 2003 5:24 am
Location: Tuxville, USA

Postby worker201 » Tue Jan 04, 2005 7:49 pm

I ran synaptic today, so the machine is up to date.
Fedora Core 3
kernel 2.6.9-1.715
ntp 4.2.0.a.20040617-4

Anything other version numbers you might be interested in, let me know.
worker201
guru
guru
 
Posts: 668
Joined: Sun Jun 13, 2004 6:38 pm
Location: Hawaii

Postby Void Main » Tue Jan 04, 2005 7:53 pm

Ooops, you probably didn't get the last part of my last post since I added it while you were posting that last message. That's the same ntp I'm running but I haven't yet upgraded anything to that version of the kernel (will upgrade my laptop right now and check it). That should not be the problem though. What glibc and glibc-common version are you running? Also, verify them with the rpm -V as mentioned in the previous message.

EDIT: Where did you find that kernel version? It doesn't appear to be an official release. The latest one I see is:

2.6.9-1.724_FC3

EDIT2: ntpd works just fine for me after upgrading to the above kernel. Now, it just occurred to me that this sounds a lot like the problems other people have been complaining about here that I believe are related to the SELinux kernel. I have not yet installed or upgraded a system to use SELinux and I have never had any of the problems people are complaining about. I suppose I should set a system up so I can learn about SELinux and help those that are having problems. Until then about all I can recommend is to not use SELinux.

EDIT3: You can see if that is the problem by turning off SELinux (at least temporarily) by unchecking it in the SELinux tab in system-config-securitylevel.
User avatar
Void Main
Site Admin
Site Admin
 
Posts: 5705
Joined: Wed Jan 08, 2003 5:24 am
Location: Tuxville, USA

Postby worker201 » Tue Jan 04, 2005 8:39 pm

[lholcombe@holcombe2 ~]$ rpm -V ntp
S.5....T. c /etc/ntp.conf
..?...... c /etc/ntp/keys
........C /usr/sbin/ntpdate
........C c /var/lib/ntp/drift


the rpm command with glibc was too long to post politely.:wink:

Synaptic has 681, 715, and 724 kernels available. I connect to freshrpms and dag repos.

glibc and glibc-common are 2.3.4-2

I very much do have SELinux installed. :(
Is there a way to determine when different versions of a package were installed? I wonder if downgrading my selinux-targeted will help? If I installed that one right before Christmas, it might have caused ntp to stop when I returned, but would not have affected the clock, which was right when I left on the 23rd. Troubleshooting is fun!


EDIT:
Dammit, clock works fine with SELinux disabled. I need to read up on this thing, find out what's up. Going home now!!!!! :evil:
worker201
guru
guru
 
Posts: 668
Joined: Sun Jun 13, 2004 6:38 pm
Location: Hawaii

Postby Void Main » Tue Jan 04, 2005 8:54 pm

worker201 wrote:
[lholcombe@holcombe2 ~]$ rpm -V ntp
S.5....T. c /etc/ntp.conf
..?...... c /etc/ntp/keys
........C /usr/sbin/ntpdate
........C c /var/lib/ntp/drift


the rpm command with glibc was too long to post politely.:wink:

Synaptic has 681, 715, and 724 kernels available. I connect to freshrpms and dag repos.

glibc and glibc-common are 2.3.4-2


That is not good, there should be *no* output from rpm -V glibc and glibc-common. My glibc versions are:
glibc-2.3.4-2.fc3
glibc-common-2.3.4-2.fc3

I don't know where you and Jim are getting these glibc packages that seem to be so screwed up, unless it's all SELinux related (turn it off, reboot and see if it makes a difference). Also, there is no kernel version 715 in the official updates and I don't have it in my "apt-get install kernel" list. Which one of your repositories has this kernel? Here's the official updates directory where you'll notice that kernel does not exist:

http://download.fedora.redhat.com/pub/f ... es/3/i386/

I very much do have SELinux installed. :(
Is there a way to determine when different versions of a package were installed? I wonder if downgrading my selinux-targeted will help? If I installed that one right before Christmas, it might have caused ntp to stop when I returned, but would not have affected the clock, which was right when I left on the 23rd. Troubleshooting is fun!


Turning off SELinux and rerunning all the checks (rpm -V stuff) might reveal something and I am concerned about where the 715 kernel came from. Guess I have more research to do on SELinux.

EDIT: It seems to all be answered here:
http://fedora.redhat.com/docs/selinux-faq-fc3/
User avatar
Void Main
Site Admin
Site Admin
 
Posts: 5705
Joined: Wed Jan 08, 2003 5:24 am
Location: Tuxville, USA

Next

Return to Fedora/Red Hat

Who is online

Users browsing this forum: No registered users and 1 guest

cron