Linux - ServerThis forum is for the discussion of Linux Software used in a server related context.
Notices
Welcome to LinuxQuestions.org, a friendly and active Linux Community.
You are currently viewing LQ as a guest. By joining our community you will have the ability to post topics, receive our newsletter, use the advanced search, subscribe to threads and access many other special features. Registration is quick, simple and absolutely free. Join our community today!
Note that registered members see fewer ads, and ContentLink is completely disabled once you log in.
If you have any problems with the registration process or your account login, please contact us. If you need to reset your password, click here.
Having a problem logging in? Please visit this page to clear all LQ-related cookies.
Get a virtual cloud desktop with the Linux distro that you want in less than five minutes with Shells! With over 10 pre-installed distros to choose from, the worry-free installation life is here! Whether you are a digital nomad or just looking for flexibility, Shells can put your Linux machine on the device that you want to use.
Exclusive for LQ members, get up to 45% off per month. Click here for more info.
I have a set of machines on a disconnected network. Periodically, one of the machines connects to the internet and synchronizes its time with a time server that is not known until the connection is established. (The machine queries a central command server for the address of the time server it should synchronize to.)
I then use a custom tool to do some calculations to call adjtimex() and adjust the clock so that it runs fairly accurately.
I know ntpd is supposed to be able to handle disconnected networks but I thought you had to preconfigure the servers in the configuration file.
Regardless ... it is the way it is.
My intent is to run ntpd on this machine (without configured "server"s) so that it can serve time to the internal network. (Periodic synchronization using ntpdate from the internal machine to the bridge machine.)
The problem:
ntpd wants to fuss with the values I set using adjtimex(). I want it to quit thinking it needs to adjust the clock and just serve time to the internal network. (Maybe I have a GPS time source hooked directly to the machine!)
I have a set of machines on a disconnected network. Periodically, one of the machines connects to the internet and synchronizes its time with a time server that is not known until the connection is established. (The machine queries a central command server for the address of the time server it should synchronize to.) I then use a custom tool to do some calculations to call adjtimex() and adjust the clock so that it runs fairly accurately. I know ntpd is supposed to be able to handle disconnected networks but I thought you had to preconfigure the servers in the configuration file.
Regardless ... it is the way it is.
My intent is to run ntpd on this machine (without configured "server"s) so that it can serve time to the internal network. (Periodic synchronization using ntpdate from the internal machine to the bridge machine.)
The problem:
ntpd wants to fuss with the values I set using adjtimex(). I want it to quit thinking it needs to adjust the clock and just serve time to the internal network. (Maybe I have a GPS time source hooked directly to the machine!)
Any idea how to tell it to stop?
I've never tried to configure it as such, but it's my understanding that you can set one of the disconnected machines to be a time server (as you've done), and give it a fudge factor of 10, with a reference server of 127.0.0.1. Granted, it will then try to update itself, but I think that NTP is going to have a problem if it doesn't find a higher stratum server further upstream.
I have done the GPS thing, and it works great...and you DO NOT have to have a specialized appliance, either. Grab a cheap (>$100 USD) USB GPS receiver only. Don't need software or anything else, as long as it generates NMEA data. Plug it into a USB port, and do "ln -s /dev/ttyUSB0 /dev/gps". From there, you can set up NTP to read the NMEA data directly, and it'll then become a live, stratum 1 server.
ntpd will perform similar calculations to adjust time but does it over a period of time and do not know if it that feature can be turned off. As stated you can set up ntpd to use the local clock as a source if it can not connect to a timer server. BTW you can not run ntpdate if ntpd is already started.
The server's configuration file is set up with the fudge factor and pointing at the local machine (server 127.0.0.1 with fudge 127.0.0.1 stratum 10). One of the main issues is that when it starts up it's messing with the "freq" part of the timex adjustment that's already loaded. I've already calculated and set "tick" and "freq" in a call to adjtimex() so that the system clock runs accurately. I don't need ntpd to go messing with those values.
I've never had a problem running ntpdate while ntpd is running in this configuration. You just have to pass it the "-u" option so that it doesn't conflict with the NTP socket already in use.
The server's configuration file is set up with the fudge factor and pointing at the local machine (server 127.0.0.1 with fudge 127.0.0.1 stratum 10). One of the main issues is that when it starts up it's messing with the "freq" part of the timex adjustment that's already loaded. I've already calculated and set "tick" and "freq" in a call to adjtimex() so that the system clock runs accurately. I don't need ntpd to go messing with those values.
I've never had a problem running ntpdate while ntpd is running in this configuration. You just have to pass it the "-u" option so that it doesn't conflict with the NTP socket already in use.
Paul Braman
Well, you obviously know more about NTP than I do. The GPS receiver solution works well for me, and I've got three in an NTP pool that serve up time for the whole company. I knew about the fudge and localhost thing from when I was learning, but I've had VERY good results with the GPS devices, but I know that's not where you want to go for a solution.
LinuxQuestions.org is looking for people interested in writing
Editorials, Articles, Reviews, and more. If you'd like to contribute
content, let us know.