LinuxQuestions.org

LinuxQuestions.org (/questions/)
-   Linux - Software (https://www.linuxquestions.org/questions/linux-software-2/)
-   -   NTP not working in orphan mode for openSuSE 11.1 (https://www.linuxquestions.org/questions/linux-software-2/ntp-not-working-in-orphan-mode-for-opensuse-11-1-a-803374/)

kcampen 04-21-2010 04:29 PM

NTP not working in orphan mode for openSuSE 11.1
 
It seems like everything is configured correctly but NTP will start, sync once, then never sync again.... Any ideas? Below are key lines from my /etc/ntp.conf files.

Server:
----------
tos orphan 9

server BOGUS_1 # Must operate in orphan mode
server BOGUS_2

-----------

Clients:
-----------
tos orphan 9

server <server_ip_above>

-----------

Log from client:

---- RESTART ---- 2010/04/21_10:59:36 ----
21 Apr 11:02:53 ntpd[11300]: synchronized to <server_ip_above>, stratum 9
21 Apr 11:02:53 ntpd[11300]: kernel time sync status change 0001

-----------

I restarted everything at 10:59 and it updated only once.... ??
Version is right off of the 11.1 install disk.
ntpq - standard NTP query program - Ver. 4.2.4p5

I had let it run over the weekend. It did not update so it is not just this one time. It never syncs again.

TB0ne 04-22-2010 09:04 AM

Quote:

Originally Posted by kcampen (Post 3943170)
It seems like everything is configured correctly but NTP will start, sync once, then never sync again.... Any ideas? Below are key lines from my /etc/ntp.conf files.

I restarted everything at 10:59 and it updated only once.... ??
Version is right off of the 11.1 install disk.
ntpq - standard NTP query program - Ver. 4.2.4p5

I had let it run over the weekend. It did not update so it is not just this one time. It never syncs again.

Well, not sure. Lots of things you don't mention in here.

You say you got it from the 11.1 install disk...11.1 of what? openSUSE? And the other servers, where do they get their time from? They're reporting back as stratum 9, which isn't that great. Stratum 16 is the highest you can go, and that's untrusted (basically, a good guess at the time).

Before you first start NTP, sync your clock with the ntpdate (or the sntp command, since ntpdate is depreciated). The clock has to be close before NTP can fire up. I usually will get my system clock right, then use the hwclock command to get the hardware clock to match. Then fire up NTP. Also, if the time drifts too much from the reference source, NTP will shut itself down.

Also, you don't mention whether this is on VMware or not, as there are problems with NTP (and time in general), unless the kernel is patched on the guest OS. You can patch things, or if you want a lowball solution, you can shove a cron job out there, to do an sntp command every 15 minutes/hour or so, to make sure the time is right.

Either way...I'd use something other than a stratum 9 clock for my reference. If you've got Internet access, use one of the internet clock pools, they're stratum 1.

kcampen 04-22-2010 11:12 AM

Thank you for you reply TBOne.

Yes, openSUSE 11.1.

This is within an isolated LAN so there is no internet (orphan mode). No other time sources are available. I am trying to get this working in orphan mode when no sources above stratum 9 are available. What is important is that all machines are the same time not so much that the time is correct (at this stage of development anyway).

The times are all close enough at the beginning and they sync once soon after startup. They just never sync again for some reason.

No VM, these are single board computers (PC on a board) from Performance Technologies.

Yes, I could add a cron job to sync periodically but that would defeat the purpose of NTP. If I cannot get NTP working, that is what I will have to do I suppose.

TB0ne 04-22-2010 11:28 AM

Quote:

Originally Posted by kcampen (Post 3944146)
Thank you for you reply TBOne.

Yes, openSUSE 11.1.

This is within an isolated LAN so there is no internet (orphan mode). No other time sources are available. I am trying to get this working in orphan mode when no sources above stratum 9 are available. What is important is that all machines are the same time not so much that the time is correct (at this stage of development anyway).

The times are all close enough at the beginning and they sync once soon after startup. They just never sync again for some reason.

No VM, these are single board computers (PC on a board) from Performance Technologies.

Yes, I could add a cron job to sync periodically but that would defeat the purpose of NTP. If I cannot get NTP working, that is what I will have to do I suppose.

Well, the only times I've seen NTPd stop, is because the clock drifted too much (see VM server...), or if the reference clock stopped providing a good time reference.

Since this is a 'single board' type thing, I'd check into how the hardware clock is synced up, and if it's drifting too much. Have you considered a GPS time source, since you're on an isolated network? A cheap $60 USB GPS receiver is all you need, and set up NTPD to use the NMEA data. You wind up with a strong stratum 1 clock.

kcampen 04-22-2010 12:26 PM

Thanks again TBOne,

Oh, I see the "Thanks" button in the lower right there....

The ntpd never stops. When I check status, it is always running. It is just never synchronizing to the server anylonger. The times are not very different so it is not the correction limit preventing anything. The log at /var/log/ntp doesn't say anything after the last sync.

GPS would work outdoors or if we had a PGS repeater in here but these are inside with no repeater. Once deployed, and later in development, there will be a time source. We just don't have it now so I'm trying to get orphan mode working.

The network occasionally has internet connectivity so I will have 0.us.pool.ntp.org (1, 2, & 3) set as servers. But they will not always be available and I am trying to be sure that orphan mode will work reliably. Here is the status and log. NTP is still running, there is just no activity in the log.

jcts-port-blade-2:~ # rcntp status
remote refid st t when poll reach delay offset jitter
==============================================================================
IP_BOGUS_MACHIN 64.113.32.5 2 u 598 1024 7 3.906 -23498. 36.754
*IP_LOCAL_SERVER 127.0.0.1 9 u 393 1024 377 3.906 -1.752 3.906
xxx.xxx.xxx.xxx .INIT. 16 u - 1024 0 0.000 0.000 0.000

Checking for network time protocol daemon (NTPD): running

jcts-port-blade-2:~ # tail /var/log/ntp
---- RESTART ---- 2010/04/21_13:25:13 ----
21 Apr 13:28:27 ntpd[16990]: synchronized to <ip_local_server>, stratum 9
21 Apr 13:28:27 ntpd[16990]: kernel time sync status change 0001

TB0ne 04-22-2010 01:31 PM

Quote:

Originally Posted by kcampen (Post 3944219)
Thanks again TBOne,

Oh, I see the "Thanks" button in the lower right there....

The ntpd never stops. When I check status, it is always running. It is just never synchronizing to the server anylonger. The times are not very different so it is not the correction limit preventing anything. The log at /var/log/ntp doesn't say anything after the last sync.

GPS would work outdoors or if we had a PGS repeater in here but these are inside with no repeater. Once deployed, and later in development, there will be a time source. We just don't have it now so I'm trying to get orphan mode working.

The network occasionally has internet connectivity so I will have 0.us.pool.ntp.org (1, 2, & 3) set as servers. But they will not always be available and I am trying to be sure that orphan mode will work reliably. Here is the status and log. NTP is still running, there is just no activity in the log.

jcts-port-blade-2:~ # rcntp status
remote refid st t when poll reach delay offset jitter
==============================================================================
IP_BOGUS_MACHIN 64.113.32.5 2 u 598 1024 7 3.906 -23498. 36.754
*IP_LOCAL_SERVER 127.0.0.1 9 u 393 1024 377 3.906 -1.752 3.906
xxx.xxx.xxx.xxx .INIT. 16 u - 1024 0 0.000 0.000 0.000

Checking for network time protocol daemon (NTPD): running

jcts-port-blade-2:~ # tail /var/log/ntp
---- RESTART ---- 2010/04/21_13:25:13 ----
21 Apr 13:28:27 ntpd[16990]: synchronized to <ip_local_server>, stratum 9
21 Apr 13:28:27 ntpd[16990]: kernel time sync status change 0001

It looks like it's running OK....the daemon should just magically keep things correct, once it's running. The jitter should settle down after a bit, too.

It's a hard one to track down, since NTP is stateless UDP traffic, but I have seen scripts available to watch such things. If you've got another machine, you might want to run wireshark on it, and look at the NTP port (UDP port 123), to see what it's doing. If NTPd is doing it's job, you should see bursts of traffic.


All times are GMT -5. The time now is 09:12 PM.