From mboxrd@z Thu Jan 1 00:00:00 1970 From: Michael Tremer To: development@lists.ipfire.org Subject: Re: [PATCH] Ship NTP changes Date: Wed, 01 Jun 2022 10:43:37 +0100 Message-ID: In-Reply-To: <0DAE83CC-29C1-40D5-869A-8DFECB275C2E@gmail.com> MIME-Version: 1.0 Content-Type: multipart/mixed; boundary="===============1642861370874869245==" List-Id: --===============1642861370874869245== Content-Type: text/plain; charset="utf-8" Content-Transfer-Encoding: quoted-printable Okay, that is soft enough for me. > On 31 May 2022, at 17:08, Jon Murphy wrote: >=20 > Michael, >=20 > (see below) >=20 >=20 >> On May 31, 2022, at 6:49 AM, Michael Tremer = wrote: >>=20 >> Hello everyone, >>=20 >> I would say that it is worth to work on this change, because it is simple = enough that we won=E2=80=99t need to spend a week. If it is going to be repla= ced by chronie or something else, so be it - at least we had a problem fixed = in the meantime. >>=20 >>> On 30 May 2022, at 22:30, Jon Murphy wrote: >>>=20 >>> Peter, >>>=20 >>> (see below) >>>=20 >>>=20 >>>> On May 30, 2022, at 2:07 PM, Peter M=C3=BCller wrote: >>>>=20 >>>> Hello Jon, >>>>=20 >>>> thank you for submitting this. >>>>=20 >>>> I consent with the intention of your patch, and believe this is the cure= (or at least >>>> a medicine) to insanely high clock drifts on some IPFire installations. = Based on the >>>> forum activity, there used to be more of them, but my gut feeling is tha= t this issue >>>> never completely went away. >>>=20 >>> I found one system that was off by 38 seconds per day=E2=80=A6 >>=20 >> Okay. This is really bad though. Watches from a bubble gum machine keep ti= me better than this. >>=20 >>>>=20 >>>> Nevertheless, I would like to await Arne's feedback on this: Particularl= y on ARM systems >>>> without a battery-backed RTC, IPFire comes up with a bogus time, and I a= m not sure what >>>> the implications of this patch would be for such systems. >>>=20 >>> `ntpd` added a feature that may help: >>> " -g no panicgate Allow the first adjustment to be Big" >>>=20 >>=20 >> Yes, the rationale here is that if the system comes up with Jan 1st, 1970,= ntpd refuses to change that. I don=E2=80=99t know why. It does not seem to m= ake sense to me. >>=20 >>>=20 >>>>=20 >>>>> Hello, >>>>>=20 >>>>> The change I made to the initscript ntp file does not seem very elegant= ! But I was not sure of a better way too complete the same results. =20 >>>>>=20 >>>>>> + echo -e "server ${NTP_ADDR_1} prefer\nserver ${NTP_ADDR_2}" > /etc/= ntp/ntpInclude.conf >>>>>=20 >>>>> Is this OK or does it belong in a different section of code. It needs = to be updated when the NTP Servers are changed or when the time.cgi (Time Ser= ver) page is updated. >>>>=20 >>>> Hmm, I would favour a better solution as well. That file might be popula= ted, and just >>>> overwriting it seems to be a bit brutal to me. :-) >>>=20 >>> The `/etc/ntp/ntpInclude.conf` file is intentionally over written. I was= going to do a find & replace on the `config/ntp/ntp.conf` file, but this see= med much simpler. Barbaric but simple! >>=20 >> I agree that this isn=E2=80=99t the most elegant solution, but it isn=E2= =80=99t far off. >>=20 >> I would give the file a different name, because =E2=80=9CntpInclude.conf= =E2=80=9D does not really represent what it holds - which is the servers. >>=20 >> Is it necessary to mark one of the servers with the =E2=80=9Cprefer=E2=80= =9D keyword? I am not sure if we should rank them. Shouldn=E2=80=99t the syst= em choose the one that is most accurate? >=20 >=20 > If I understand prefer correctly this helps break the "tie". =20 > prefer > Marks the server as preferred. All other things being equal, this host will= be chosen for synchronization among a set of correctly operating hosts. See = the "Mitigation Rules and the prefer Keyword" page for further information. >=20 > Both servers could be marked "prefer" but that just means the preference be= comes the first server in the config files. > The mitigation rules are designed to provide an intelligent selection of th= e system peer from among the selectable sources of different types. >=20 > When used with the server or peer commands, the prefer option designates on= e or more sources as preferred over all others. While the rules do not forbid= it, it is usually not useful to designate more than one source as preferred;= however, if more than one source is so designated, they are used in the orde= r specified in the configuration file. If the first one becomes unselectable,= the second one is considered and so forth. =20 >=20 >=20 >>=20 >>>>=20 >>>>> -and- >>>>>=20 >>>>> Is chrony going to replace NTP? If so, then the change below is not ne= eded. >>>>=20 >>>> I would really like so, but don't see that happen in IPFire 2.x soon. Fo= r the medium >>>> term at least, you patch is by no means obsolete. >>>>=20 >>>>> Please don't hurt me! >>>>=20 >>>> Hope I did not. :-) >>>>=20 >>>=20 >>> No pain! :-) >>>=20 >>>=20 >>>> Thanks, and best regards, >>>> Peter M=C3=BCller >>>>=20 >>>>>=20 >>>>> Jon >>>>>=20 >>>>>=20 >>>>>> On May 26, 2022, at 7:40 PM, Jon Murphy wrot= e: >>>>>>=20 >>>>>> - Device time more accurate. (e.g., +/- 10 seconds per day to < 100 m= s on some devices) >>>>>> ( I know we don't need the perfect time server ) >>>>>> - NTP and time will be accurate in manual mode (setting on Time Server= > NTP Configuration WebGUI) >>>>>> - Change NTP "prefer" server: >>>>>> - The current preferred NTP server in an Undisciplined Local Clock. >>>>>> - This is intended when no outside source of synchronized time is ava= ilable. >>>>>> - Change the "prefer" server from 127.127.1.0 to the Primary NTP serv= er specified on >>>>>> the Time Server > NTP Configuration WebGUI page. >>>>>> - Change allows the drift file (located at /etc/ntp/drift) to be popul= ated by ntpd. >>>>>> - The drift file is updated about once per hour which helps correct t= he device time. >>>>>>=20 >>>>>> Signed-off-by: Jon Murphy >>>>>> --- >>>>>> config/ntp/ntp.conf | 3 ++- >>>>>> src/initscripts/system/ntp | 2 ++ >>>>>> 2 files changed, 4 insertions(+), 1 deletion(-) >>>>>>=20 >>>>>> diff --git a/config/ntp/ntp.conf b/config/ntp/ntp.conf >>>>>> index 9e393ca8e..bcaf2ee9e 100644 >>>>>> --- a/config/ntp/ntp.conf >>>>>> +++ b/config/ntp/ntp.conf >>>>>> @@ -1,6 +1,7 @@ >>>>>> disable monitor >>>>>> restrict default nomodify noquery >>>>>> restrict 127.0.0.1 >>>>>> -server 127.127.1.0 prefer >>>>>> +server 127.127.1.0 >>>>>> fudge 127.127.1.0 stratum 10 >>>>>> driftfile /etc/ntp/drift >>>>>> +includefile /etc/ntp/ntpInclude.conf >>>>>> diff --git a/src/initscripts/system/ntp b/src/initscripts/system/ntp >>>>>> index 74b8bc86a..6c8174d25 100644 >>>>>> --- a/src/initscripts/system/ntp >>>>>> +++ b/src/initscripts/system/ntp >>>>>> @@ -52,6 +52,8 @@ case "$1" in >>>>>> fi >>>>>> fi >>>>>>=20 >>>>>> + echo -e "server ${NTP_ADDR_1} prefer\nserver ${NTP_ADDR_2}" > /etc/= ntp/ntpInclude.conf >>>>>> + >>>>>> boot_mesg "Starting ntpd..." >>>>>> loadproc /usr/bin/ntpd -Ap /var/run/ntpd.pid >>>>>> ;; >>>>>> --=20 >>>>>> 2.30.2 --===============1642861370874869245==--