Bug 279413 - NTPD: Leap-Seconds.list IPv6 alone cannot be obtained and error occurs.
Summary: NTPD: Leap-Seconds.list IPv6 alone cannot be obtained and error occurs.
Status: New
Alias: None
Product: Base System
Classification: Unclassified
Component: conf (show other bugs)
Version: Unspecified
Hardware: Any Any
: --- Affects Only Me
Assignee: freebsd-bugs (Nobody)
URL:
Keywords:
Depends on:
Blocks:
 
Reported: 2024-05-30 21:48 UTC by takefu
Modified: 2024-06-21 18:08 UTC (History)
1 user (show)

See Also:


Attachments
a Part of /etc/rc.conf.local (7.29 KB, application/x-shellscript)
2024-06-21 18:06 UTC, CrazyMihey
no flags Details

Note You need to log in before you can comment on or make changes to this bug.
Description takefu 2024-05-30 21:48:24 UTC
bug #275419 Errors occur only in IPv6 after updating.

"HPiers.obspm.fr" Error that occurs because this host does not communicate with IPv6.
No errors occur under dual stack with IPv4.

adhoc
# sysrc ntp_leapfile_sources=https://data.iana.org/time-zones/tzdb/leap-seconds.list
Comment 1 CrazyMihey 2024-06-21 18:06:56 UTC
Created attachment 251607 [details]
a Part of /etc/rc.conf.local
Comment 2 CrazyMihey 2024-06-21 18:08:03 UTC
Thats Right, «HTTPS://HPIERS.OBSPM.Fr», suggested in «/etc/defaults/rc.conf» of FreeBSD 14.0 #7 does not SupPort IPv6.
I publish My Decision, made in January and [not Hardly Tested] on IPv6-Only Servers.
This is a Fragment of My «/etc/rc.conf.local», Comments and Suggestions are WellCome:

#!/bin/sh
# Здесь ШеБанг ИсПользуетСя ИсКлючитЕльНо для КорРектнОго ЦветоВыДеления Синтаксиса в Текстовых РедакТорАх, вроде «mcedit» (GNU MidNight Commander), «FarColorer» (Far Manager), и, возможно, Других… Сурсящая ПодПроГрамма «source_rc_confs» из «/etc/defaults/rc.conf» ПроИгнорирует SheBang, Справедливо СоЧтя Его за НеУдачный Комментарий.
…
#──────────────────────────────────────────────────────────────────────────────────────────────────#
# Creates a Simple Match-Pattern (Mask) from a given String.
# This Patterns can be used for Parameter Expansions (#/##/%/%%) and Case/esaC Command in SH Scripts.
# UsAge:
# AnyCasePattern <InirialString>
# For Example, «AnyCasePattern "Some <Used> Parameter."»
# Will ReTurn String: «[Ss][Oo][Mm][Ee][[:space:]][<][Uu][Ss][Ee][Dd][>][[:space:]][Pp][Aa][Rr][Aa][Mm][Ee][Tt][Ee][Rr][.]», which can be Applied in Case/#/% Constructions of SH.
# AnyCasePattern Works on Pure SH: avoids using External Utilities such as IConv, TR and SEd.
# AnyCasePattern Can Be easily Expanded for any National Symbols Support.
AnyCasePattern()
 {
  local H T="${*}" R=""	# Header, Tail, Result.
  if [ -n "${T}" ]
   then
    while [ -n "${T}" ]
     do
      H="${T%"${T#?}"}"
      T="${T#?}"	# Using Third VariAble (Accumulator A="${T#?}"; H="${T%"${A}"}"; T="${A}") does not Increase Performance, while Avoiding Double "${T#?}" — Operation…
      case "${H}" in	# Static Case Operator Operates about 4–6 Times Faster, than For-Loop; ≈2–3 Times Faster, than For+Case (For This Particular Case). Tested on Intel® Atom™/Xeon® i386/AMD64.
       [Aa]) H="Aa";;
       [Bb]) H="Bb";;
       [Cc]) H="Cc";;
       [Dd]) H="Dd";;
       [Ee]) H="Ee";;
       [Ff]) H="Ff";;
       [Gg]) H="Gg";;
       [Hh]) H="Hh";;
       [Ii]) H="Ii";;
       [Jj]) H="Jj";;
       [Kk]) H="Kk";;
       [Ll]) H="Ll";;
       [Mm]) H="Mm";;
       [Nn]) H="Nn";;
       [Oo]) H="Oo";;
       [Pp]) H="Pp";;
       [Qq]) H="Qq";;
       [Rr]) H="Rr";;
       [Ss]) H="Ss";;
       [Tt]) H="Tt";;
       [Uu]) H="Uu";;
       [Vv]) H="Vv";;
       [Ww]) H="Ww";;
       [Xx]) H="Xx";;
       [Yy]) H="Yy";;
       [Zz]) H="Zz";;
       [[:space:]]) H="[:space:]";;
      esac
      R="${R}[${H}]"
     done
    printf "%s" "${R}"
    return "0"
   else
    return "1"
  fi
 }
#══════════════════════════════════════════════════════════════════════════════════════════════════#

# URLHost ExtrActs Full HostName form the URL.
# UsAge:
# URLHost "<Long URL>"
# For Example, «URLHost "HTTP://StupidUser:Remember@Data.IANA.Org/time-zones/data/leap-seconds.list?Date=ToDay#3692217600"»
# Will ReTurn String: «Data.IANA.Org»
# Multiple URLs will be SingleSpace-Separated. No External Utilities (in ${PATH}) Required.
URLHost()
 {
  local H R
  for H in "${@}"
   {
    H="${H#*"//"}"	# ReMove Scheme/Protocol Part;
    H="${H%%"/"*}"	# ReMove Host Path and Parameters;
    R="${R}${R:+" "}${H#*"@"}"	# ReMove LogIn:PassWord Part.
   }
  printf "%s" "${R}"
 }
#══════════════════════════════════════════════════════════════════════════════════════════════════#

…
  # Файл, СоДержащий Текущий Сдвиг Времени — ДоПолни́тельную (ВисоКо́сную, Ска́чущую) Секу́нду, Перемещён с «IETF.Org» на «HTTPS://Data.IANA.Org/time-zones/data/leap-seconds.list».	# HTTPS://Ru.WikiPedia.Org/wiki/Дополнительная_секунда
  if [ -n "${name}" -a "${name%[Nn][Tt][Pp][Dd]*}" != "${name}" ]	# Execute Next ↓ «HardWork» on NTPD or NTPDate Start/Stop Only. 
   then	# Configuration Files «/etc/rc.conf» and «/etc/rc.conf.local» are Included by Every Deamon Script on Start/Stop/ReStart/ReLoad/… These Actions ↓ may take Some Time During Boot Process, so They should be performed only when running Time Daemons.
    Alt_NTP_LeapFile_Sources="${Alt_NTP_LeapFile_Sources}${Alt_NTP_LeapFile_Sources:+" "}HTTPS://HPIERS.OBSPM.Fr/iers/bul/bulc/ntp/leap-seconds.list"	# Paris Observatory IERS Centers …from Quasars to our changing Earth. Works Faster in Most Cases (Moscow, Amsterdam, …), SupPorts IPv4 Only (Not AvailAble on IPv6-Only Hosts).
    Alt_NTP_LeapFile_Sources="${Alt_NTP_LeapFile_Sources}${Alt_NTP_LeapFile_Sources:+" "}HTTPS://Data.IANA.Org/time-zones/data/leap-seconds.list"	# The Global Coordination of the DNS Root, IP Addressing, and Other InterNet Protocol Resources is Performed as the InterNet Assigned Numbers Authority (IANA) Functions. SupPorts IPv4 and IPv6.
    for Alt_NTP_LeapFile_Source in ${Alt_NTP_LeapFile_Sources}
     {
      Alt_NTP_LeapFile_Source_Pattern="$(AnyCasePattern "$(URLHost "${Alt_NTP_LeapFile_Source}")")"
      [ "${ntp_leapfile_sources%${Alt_NTP_LeapFile_Source_Pattern}*}" == "${ntp_leapfile_sources}" ] && ntp_leapfile_sources="${ntp_leapfile_sources}${ntp_leapfile_sources:+" "}${Alt_NTP_LeapFile_Source}"
     }
    unset Alt_NTP_LeapFile_Source Alt_NTP_LeapFile_Sources Alt_NTP_LeapFile_Source_Pattern
  fi
…
  ntpd_enable="Yes"	# Дэмон СинХронизации СисТемнОго Времени.
…
	# Такой «Фортэль» Работает на FreeBSD: ПодПрограмма «run_rc_command» из Скрипта «/etc/rc.subr» Формирует Строку ЗаПуска Дэмона в своей Переменной «${_doit}», добавляя Туда Параметры, в том числе «${${name}_nice}», без ДоПолнительной ПроВерки на «Целое Число −20…20», так что можно «Вставить в Цепочку ЗаПуска» ещё и Утилиту idprio/rtprio…
  ntpd_nice="-20 rtprio 0"	# ЗаПуск NTPD с Максимальным «Приоритетом Реального Времени» и Минимальной «Вежливостью» («Уступчивостью», «Nice») к Другим Процессам в Системе. Ибо Время — это Самый Ценный и НеВосПолнимый Ресурс, а Учитывать Его следует особенно Тщательно.	# Running NTPD with Maximum «Real-Time Priority» and Minimum «Politeness» («Compliance», «Nice») to Other Processes in the System. Because Time is the Most ValuAble and IrRePlaceAble Resource, and It should be taken into Account especially Carefully.
  ntpd_flags="--authreq --bcastsync"
  ntpd_sync_on_start="Yes"		# ПриХодитСя ИсПользовать Сей ПараМетр, ВзаМесто «--panicgate» по Причине Кривости ОбРаБотки ПараМетров СкрипТом ЗаПуска «/etc/rc.d/ntpd».
…