ntpd issue

classic Classic list List threaded Threaded
5 messages Options
Reply | Threaded
Open this post in threaded view
|

ntpd issue

mufurcz
Greetings,

I set up this mail server (postfix/dovecot/mysql) some years back.
There is an issue with ntpd (read below).  Any idea why I am not
geting the right time?

-bash-3.2$ uname -prs
OpenBSD 4.2 SUNW,UltraSPARC-IIIi (rev 3.4) @ 1002 MHz, version 0 FPU

-bash-3.2$ cat /etc/ntpd.conf | grep listen
# Addresses to listen on (ntpd does not listen by default)
#listen on *
listen on 192.168.1.177

-bash-3.2$ cat /etc/ntpd.conf | grep servers
# use a random selection of 8 public stratum 2 servers
servers 0.au.pool.ntp.org
servers 1.au.pool.ntp.org
servers 2.au.pool.ntp.org
servers 3.au.pool.ntp.org

-bash-3.2$ cat /etc/rc.conf.local | grep ntpd
# ntpd
ntpd_flags="-s"   # enabled

bash-3.2# ls -l /etc/localtime
lrwxr-xr-x  1 root  wheel  36 Dec  1  2007 /etc/localtime ->
/usr/share/zoneinfo/Australia/Sydney

bash-3.2# pkill ntpd

bash-3.2# date
Sun Oct 13 23:27:28 EST 2013

bash-3.2# ntpd -s

bash-3.2# date
Sun Oct 13 22:27:55 EST 2013

-bash-3.2$ netstat -an | grep 123
udp        0      0  192.168.1.177.27073    203.171.85.237.123
udp        0      0  192.168.1.177.21427    128.184.218.53.123
udp        0      0  192.168.1.177.36082    130.102.2.123.123
udp        0      0  192.168.1.177.18557    118.88.20.194.123
udp        0      0  192.168.1.177.22082    202.60.94.15.123
udp        0      0  192.168.1.177.30471    27.116.36.36.123
udp        0      0  192.168.1.177.22947    192.189.54.33.123
udp        0      0  192.168.1.177.32058    128.184.34.53.123
udp        0      0  192.168.1.177.17872    202.127.210.36.123
udp        0      0  192.168.1.177.36601    27.50.90.253.123
udp        0      0  192.168.1.177.31999    203.161.12.165.123
udp        0      0  192.168.1.177.36993    27.54.95.12.123
udp        0      0  192.168.1.177.32221    203.31.7.2.123
udp        0      0  192.168.1.177.13351    192.189.54.17.123
udp        0      0  192.168.1.177.37409    202.125.45.77.123
udp        0      0  192.168.1.177.41749    202.127.210.37.123
udp        0      0  192.168.1.177.123      *.*
      0x4000ad41230 stream      0      0                0x0
0x4000137df80                0x0                0x0
/var/dovecot/login/default

-bash-3.2$ nslookup 0.au.pool.ntp.org
Server:         203.134.64.66
Address:        203.134.64.66#53

Non-authoritative answer:
Name:   0.au.pool.ntp.org
Address: 128.184.218.53
Name:   0.au.pool.ntp.org
Address: 223.252.23.219
Name:   0.au.pool.ntp.org
Address: 121.0.0.41
Name:   0.au.pool.ntp.org
Address: 121.0.0.42

-bash-3.2$ nslookup 1.au.pool.ntp.org
Server:         203.134.64.66
Address:        203.134.64.66#53

Non-authoritative answer:
Name:   1.au.pool.ntp.org
Address: 130.102.2.123
Name:   1.au.pool.ntp.org
Address: 202.6.248.7
Name:   1.au.pool.ntp.org
Address: 130.102.128.23
Name:   1.au.pool.ntp.org
Address: 192.189.54.33

-bash-3.2$ nslookup 2.au.pool.ntp.org
Server:         203.134.64.66
Address:        203.134.64.66#53

Non-authoritative answer:
Name:   2.au.pool.ntp.org
Address: 203.26.72.7
Name:   2.au.pool.ntp.org
Address: 202.127.210.37
Name:   2.au.pool.ntp.org
Address: 128.184.34.53
Name:   2.au.pool.ntp.org
Address: 192.189.54.17

-bash-3.2$ nslookup 3.au.pool.ntp.org
Server:         203.134.64.66
Address:        203.134.64.66#53

Non-authoritative answer:
Name:   3.au.pool.ntp.org
Address: 27.54.95.11
Name:   3.au.pool.ntp.org
Address: 202.191.108.72
Name:   3.au.pool.ntp.org
Address: 202.191.108.71
Name:   3.au.pool.ntp.org
Address: 202.191.108.73


Regards,

Ioan

Reply | Threaded
Open this post in threaded view
|

Re: ntpd issue

mufurcz
I know, I know!  I proposed several times to upgrade, to no avail!  Some
200 active e-mail boxes on this server, average 50 e-mails/user/day.  I
took me a week or so to convince them to change the windblown domain
controller's time synchronization to an external ntp server!  Ne jamais
discuter avec un idiot .....


On 13/10/2013 11:35 PM, Theo de Raadt wrote:

> That's damn old code.
>
> Newer ntpd also has a ntpctl command, so you can see the progress it is
> making.
>
>
> -----
> No virus found in this message.
> Checked by AVG - www.avg.com
> Version: 2014.0.4158 / Virus Database: 3614/6745 - Release Date: 10/12/13

Reply | Threaded
Open this post in threaded view
|

Re: ntpd issue

Otto Moerbeek
In reply to this post by mufurcz
On Sun, Oct 13, 2013 at 11:23:22PM +1000, mufurcz wrote:

> Greetings,
>
> I set up this mail server (postfix/dovecot/mysql) some years back.
> There is an issue with ntpd (read below).  Any idea why I am not
> geting the right time?
>
> -bash-3.2$ uname -prs
> OpenBSD 4.2 SUNW,UltraSPARC-IIIi (rev 3.4) @ 1002 MHz, version 0 FPU
>
> -bash-3.2$ cat /etc/ntpd.conf | grep listen
> # Addresses to listen on (ntpd does not listen by default)
> #listen on *
> listen on 192.168.1.177
>
> -bash-3.2$ cat /etc/ntpd.conf | grep servers
> # use a random selection of 8 public stratum 2 servers
> servers 0.au.pool.ntp.org
> servers 1.au.pool.ntp.org
> servers 2.au.pool.ntp.org
> servers 3.au.pool.ntp.org
>
> -bash-3.2$ cat /etc/rc.conf.local | grep ntpd
> # ntpd
> ntpd_flags="-s"   # enabled
>
> bash-3.2# ls -l /etc/localtime
> lrwxr-xr-x  1 root  wheel  36 Dec  1  2007 /etc/localtime ->
> /usr/share/zoneinfo/Australia/Sydney
>
> bash-3.2# pkill ntpd
>
> bash-3.2# date
> Sun Oct 13 23:27:28 EST 2013
>
> bash-3.2# ntpd -s
>
> bash-3.2# date
> Sun Oct 13 22:27:55 EST 2013
>
> -bash-3.2$ netstat -an | grep 123
> udp        0      0  192.168.1.177.27073    203.171.85.237.123
> udp        0      0  192.168.1.177.21427    128.184.218.53.123
> udp        0      0  192.168.1.177.36082    130.102.2.123.123
> udp        0      0  192.168.1.177.18557    118.88.20.194.123
> udp        0      0  192.168.1.177.22082    202.60.94.15.123
> udp        0      0  192.168.1.177.30471    27.116.36.36.123
> udp        0      0  192.168.1.177.22947    192.189.54.33.123
> udp        0      0  192.168.1.177.32058    128.184.34.53.123
> udp        0      0  192.168.1.177.17872    202.127.210.36.123
> udp        0      0  192.168.1.177.36601    27.50.90.253.123
> udp        0      0  192.168.1.177.31999    203.161.12.165.123
> udp        0      0  192.168.1.177.36993    27.54.95.12.123
> udp        0      0  192.168.1.177.32221    203.31.7.2.123
> udp        0      0  192.168.1.177.13351    192.189.54.17.123
> udp        0      0  192.168.1.177.37409    202.125.45.77.123
> udp        0      0  192.168.1.177.41749    202.127.210.37.123
> udp        0      0  192.168.1.177.123      *.*
>      0x4000ad41230 stream      0      0                0x0
> 0x4000137df80                0x0                0x0
> /var/dovecot/login/default
>
> -bash-3.2$ nslookup 0.au.pool.ntp.org
> Server:         203.134.64.66
> Address:        203.134.64.66#53
>
> Non-authoritative answer:
> Name:   0.au.pool.ntp.org
> Address: 128.184.218.53
> Name:   0.au.pool.ntp.org
> Address: 223.252.23.219
> Name:   0.au.pool.ntp.org
> Address: 121.0.0.41
> Name:   0.au.pool.ntp.org
> Address: 121.0.0.42
>
> -bash-3.2$ nslookup 1.au.pool.ntp.org
> Server:         203.134.64.66
> Address:        203.134.64.66#53
>
> Non-authoritative answer:
> Name:   1.au.pool.ntp.org
> Address: 130.102.2.123
> Name:   1.au.pool.ntp.org
> Address: 202.6.248.7
> Name:   1.au.pool.ntp.org
> Address: 130.102.128.23
> Name:   1.au.pool.ntp.org
> Address: 192.189.54.33
>
> -bash-3.2$ nslookup 2.au.pool.ntp.org
> Server:         203.134.64.66
> Address:        203.134.64.66#53
>
> Non-authoritative answer:
> Name:   2.au.pool.ntp.org
> Address: 203.26.72.7
> Name:   2.au.pool.ntp.org
> Address: 202.127.210.37
> Name:   2.au.pool.ntp.org
> Address: 128.184.34.53
> Name:   2.au.pool.ntp.org
> Address: 192.189.54.17
>
> -bash-3.2$ nslookup 3.au.pool.ntp.org
> Server:         203.134.64.66
> Address:        203.134.64.66#53
>
> Non-authoritative answer:
> Name:   3.au.pool.ntp.org
> Address: 27.54.95.11
> Name:   3.au.pool.ntp.org
> Address: 202.191.108.72
> Name:   3.au.pool.ntp.org
> Address: 202.191.108.71
> Name:   3.au.pool.ntp.org
> Address: 202.191.108.73
>
>
> Regards,
>
> Ioan

Let it run for a while and check /var/log/daemon

        -Otto

Reply | Threaded
Open this post in threaded view
|

Re: ntpd issue

Stuart Henderson
In reply to this post by mufurcz
On 2013-10-13, mufurcz <[hidden email]> wrote:
> I set up this mail server (postfix/dovecot/mysql) some years back.
> There is an issue with ntpd (read below).  Any idea why I am not
> geting the right time?

Check /var/log/daemon, and check that there are no firewall rules etc
preventing you getting time (does "rdate -nvp 0.au.pool.ntp.org" work?)

> -bash-3.2$ uname -prs
> OpenBSD 4.2 SUNW,UltraSPARC-IIIi (rev 3.4) @ 1002 MHz, version 0 FPU

ouch!

Reply | Threaded
Open this post in threaded view
|

Re: ntpd issue

Brett Mahar-2
In reply to this post by mufurcz
On Sun, 13 Oct 2013 23:23:22 +1000
mufurcz <[hidden email]> wrote:
|There is an issue with ntpd (read below).  Any idea why I am not
|geting the right time?

| au.pool.ntp.org

Some of the NTP servers that au.pool.ntp.org returns are very slow to respond, I found it better to use it just to find the IP addresses that are snappy and close to you geographically, then put those directly into your ntpd.conf

Brett.