Koozali.org: home of the SME Server

Obsolete Releases => SME Server 8.x => Topic started by: Michail Pappas on December 30, 2014, 07:21:03 AM

Title: [SOLVED] SME 8.x: Issue with NTPD or misconfiguration?
Post by: Michail Pappas on December 30, 2014, 07:21:03 AM
Running a stable 8.1 box for some 3 years now. Yesterday I saw there was an update for ntp and after installing I tried to check status with "peers" and "rl" from within the ntpq shell, but I receive only a timeout:
Code: [Select]
ntpq> peers
localhost: timed out, nothing received
***Request timed out

Additionally, checking the logs up to yesterday, I could not locate any log lines of the form "ntpd[xxx]: synchronized" form.

Furthermore, yesterday I got confused and restarted the ntpd service with /etc/init.d/ntpd restart, resulting:
Code: [Select]
# /etc/init.d/ntpd restart
Shutting down ntpd:                                        [  OK  ]
ntpd: Synchronizing with time server:                      [FAILED]
Starting ntpd:                                             [  OK  ]

config show ntpd:
Code: [Select]
# config show ntpd
ntpd=service
    NTPServer=X.Y.Z.W
    SyncToHWClockSupported=yes
    status=enabled

It's not an issue of the actual NTP server I'm getting time from:
Code: [Select]
# sv stop ntpd
ok: down: ntpd: 1s

# ntpdate -q X.Y.Z.W
server X.Y.Z.W, stratum 4, offset -0.000024, delay 0.02608
30 Dec 08:18:29 ntpdate[2461]: adjust time server X.Y.Z.W offset -0.000024 sec

I did find this though, while grep'ing for ntp in /var/log:
Code: [Select]
secure.20141222011202:Dec 29 08:42:24 myserver useradd[14722]: failed adding user `ntp', data deleted

Seems like a script went wrong, or did I do something bad?


Title: Re: SME 8.x: Issue with NTPD or misconfiguration?
Post by: Stefano on December 30, 2014, 10:44:48 AM
Michail: if something isn't working out-of-the-box as expected, bugzilla is right there.. thank you
Title: Re: SME 8.x: Issue with NTPD or misconfiguration?
Post by: guest22 on December 30, 2014, 12:24:37 PM
Seems like a script went wrong, or did I do something bad?

As per Stefano's advise, please add it to the bugtracker, including what you see in /var/log/messages and /var/log/ntpd

Title: Re: SME 8.x: Issue with NTPD or misconfiguration?
Post by: mmccarn on December 30, 2014, 01:15:58 PM
You're running into bug 8517 (http://bugs.contribs.org/show_bug.cgi?id=8517)

ntpd (the service) is running, but is configured by default to not allow *any* client access.

To allow client (ntpq, ntpstat) access to your ntpd from the sme server command line:
Code: [Select]
mkdir -p /etc/e-smith/templates-custom/etc/ntp.conf
cd /etc/e-smith/templates-custom/etc/ntp.conf
echo 'restrict 127.0.0.1' > 41allowLocalhost
expand-template /etc/ntp.conf
sv t ntpd
Title: Re: SME 8.x: Issue with NTPD or misconfiguration?
Post by: guest22 on December 30, 2014, 01:30:43 PM
You're running into bug 8517 (http://bugs.contribs.org/show_bug.cgi?id=8517)
next to that, I believe there is something else going on. Hence the request for the logs. It seems that it is possible there is a race condition for binding to 0.0.0.0 between ntpd and ntpdate, where ntpdate won't release it.
But we can discuss this once a there is evidence for it so we can raise a bug against it.
Title: Re: SME 8.x: Issue with NTPD or misconfiguration?
Post by: Michail Pappas on December 30, 2014, 09:16:58 PM
I believe mmcarn nailed it. Only one question though: if this is a feature and not a bug, why does starting the service with sv start ntpd throw an error (see original post)?
Title: Re: SME 8.x: Issue with NTPD or misconfiguration?
Post by: guest22 on December 30, 2014, 09:51:22 PM
I believe mmcarn nailed it. Only one question though: if this is a feature and not a bug, why does starting the service with sv start ntpd throw an error (see original post)?
I suspect of what I said in my previous comment.
Title: Re: SME 8.x: Issue with NTPD or misconfiguration?
Post by: Daniel B. on December 30, 2014, 11:31:39 PM
Original post talks about restarting ntpd with /etc/init.d/ntpd restart. This is expected to fail, ntpd is monitored and must be restarted using sv t /services/ntpd
Title: Re: SME 8.x: Issue with NTPD or misconfiguration?
Post by: Michail Pappas on December 31, 2014, 08:55:55 AM
After a reboot I could not reproduce any errors, nothing bad I could see in /var/log/messages or else. Consider this thread solved please.