ntpq stopped working

Bob Goodwin bobgoodwin at att.net
Mon Mar 21 14:55:38 UTC 2005


Paul Howarth wrote:

> Bob Goodwin wrote:
>
>> I never had this problem until a few days ago when ntpq quit working.:
>>
>>            # ntpq -p
>>            Name or service not known
>>
>>
>> What service does it mean, "ntpq?"
>>
>> I don't know what I did, if anything, to cause this?
>> I made no changes intended for ntp.
>>
>> Any help appreciated.
>
>
> Does your /etc/hosts file include an entry for "localhost", and does 
> your /etc/services file include these entries?:
>
> ntp             123/tcp
> ntp             123/udp                         # Network Time Protocol
>
> Paul.
>
Bingo, that was the problem!

# cat /etc/hosts
# Do not remove the following line, or various programs
# that require network functionality will fail.
10.1.1.1        box1    box1
10.1.1.2        box2    box2

Changed to:

# cat /etc/hosts
# Do not remove the following line, or various programs
# that require network functionality will fail.

127.0.0.1       box1    localhost.localdomain   localhost
10.1.1.1        box1    box1
10.1.1.2        box2    box2

And now when I run my script to correct the time:
# ./tsync
Shutting down ntpd:                                        [  OK  ]
ntpd: Synchronizing with time server:                      [  OK  ]
Starting ntpd:                                             [  OK  ]
 
Mon Mar 21 09:34:41 EST 2005
        ntpq -p
     remote           refid      st t when poll reach   delay   offset  
jitter
==============================================================================
 ntp-1.cns.vt.ed 198.82.247.40    2 u    4   64    1  137.031    2.686   
0.002
 ntp-4.cns.vt.ed 198.82.247.40    2 u    3   64    1  137.576    1.375   
0.002
 clock2.redhat.c .CDMA.           1 u    2   64    1  157.490    0.625   
0.002

This is not the first time I've had a problem with /etc/hosts, both FC2 
and FC3 on two different computers here. I connect to ATT dial up using 
"network device control," [I'm in a rural area and there's no high speed 
service available yet] if I click on configure [usually by accident] and 
mess with settings it re-creates /etc/hosts/ without the required first 
line! Something wrong there it seems?

Usually it causes the boot process to stop for a minute or so on 
"sendmail" and I know what to fix, not so this time? I shut the computer 
off the last few nights and rebooed in the morning without any 
indication of that problem. Just when I think I know something it turns 
out to be wrong!

/etc/services looks good ...
nntp            119/tcp         readnews untp   # USENET News Transfer 
Protocol
nntp            119/udp         readnews untp   # USENET News Transfer 
Protocol

Thanks for the help.

Bob Goodwin




More information about the fedora-list mailing list