summaryrefslogtreecommitdiffstats
path: root/etc/periodic
diff options
context:
space:
mode:
authorcy <cy@FreeBSD.org>2016-02-10 07:16:17 +0000
committercy <cy@FreeBSD.org>2016-02-10 07:16:17 +0000
commitab8cd691029d03339e2c5ca0d056aae390b2e7ac (patch)
tree73ccc7af60f9fedfd02474a7816821a707c7106e /etc/periodic
parentcb56e836d9a9db908a5f1e021e6483e1e8aab048 (diff)
downloadFreeBSD-src-ab8cd691029d03339e2c5ca0d056aae390b2e7ac.zip
FreeBSD-src-ab8cd691029d03339e2c5ca0d056aae390b2e7ac.tar.gz
MFC r289421, r293037, r294773, and r294884.
ntp leap-leapseconds support. r289421: Add default leap-seconds file. This should help ntp networks get the leap second date correct Updates to the file can be obtained from ftp://time.nist.gov/pub/ or ftp://tycho.usno.navy.mil/pub/ntp/. r293037: Update leap-seconds to latest. This will satisfy the ntpd leap-second version check. r294773: Add support for automatic leap-second file updates. The working copy of leapfile resides in /var/dbntpd.leap-seconds.list. /etc/ntp/leap-seconds (periodically updated from ftp://time.nist.gov/pub/ or ftp://tycho.usno.navy.mil/pub/ntp/) contains the master copy should automatic leapfile updates be disabled (default). Automatic leapfile updates are fetched from $ntp_leapfile_sources, defaulting to https://www.ietf.org/timezones/data/leap-seconds.list, within $ntp_leapfile_expiry_days (default 30 days) from leap-seconds file expiry. Automatic updates can be enabled by setting $daily_ntpd_leapfile_enable="YES" in periodic.conf. To avoid congesting the ntp leapfile source the automatic update randomized by default but can be disabled through daily_ntpd_avoid_congestion="NO" in periodic.conf. r294884: Allow specification of fetch options for ntp leap-seconds fetch. Approved by: re (gjb)
Diffstat (limited to 'etc/periodic')
-rwxr-xr-xetc/periodic/daily/480.leapfile-ntpd28
-rw-r--r--etc/periodic/daily/Makefile3
2 files changed, 30 insertions, 1 deletions
diff --git a/etc/periodic/daily/480.leapfile-ntpd b/etc/periodic/daily/480.leapfile-ntpd
new file mode 100755
index 0000000..8429824
--- /dev/null
+++ b/etc/periodic/daily/480.leapfile-ntpd
@@ -0,0 +1,28 @@
+#!/bin/sh
+#
+# $FreeBSD$
+#
+
+# If there is a global system configuration file, suck it in.
+#
+if [ -r /etc/defaults/periodic.conf ]
+then
+ . /etc/defaults/periodic.conf
+ source_periodic_confs
+fi
+
+case "$daily_ntpd_leapfile_enable" in
+ [Yy][Ee][Ss])
+ case "$daily_ntpd_avoid_congestion" in
+ [Yy][Ee][Ss])
+ # Avoid dogpiling
+ (sleep $(jot -r 1 0 86400); service ntpd fetch) &
+ ;;
+ *)
+ service ntpd fetch
+ ;;
+ esac
+ ;;
+esac
+
+exit $rc
diff --git a/etc/periodic/daily/Makefile b/etc/periodic/daily/Makefile
index 593c0f6..617af49 100644
--- a/etc/periodic/daily/Makefile
+++ b/etc/periodic/daily/Makefile
@@ -34,7 +34,8 @@ FILES+= 130.clean-msgs
.endif
.if ${MK_NTP} != "no"
-FILES+= 480.status-ntpd
+FILES+= 480.status-ntpd \
+ 480.leapfile-ntpd
.endif
.if ${MK_PKGTOOLS} != "no"
OpenPOWER on IntegriCloud