diff --git a/.chrony.metadata b/.chrony.metadata index c107a12..e898eed 100644 --- a/.chrony.metadata +++ b/.chrony.metadata @@ -1,2 +1,2 @@ -bc43c7c3671fcb5d998428b485847f8a1d6cfff9 SOURCES/chrony-2.1.1.tar.gz -fbd4b56e546927e4a60beef9667fb844686bb1e1 SOURCES/clknetsim-c0e2b4.tar.gz +564dd010a10fbdcc7c177337115ccffa43fe0f95 SOURCES/chrony-3.1.tar.gz +922f475728383b56b03eeadaf990c9231a51a9e3 SOURCES/clknetsim-ce89a1.tar.gz diff --git a/.gitignore b/.gitignore index 63266e0..6c4aebf 100644 --- a/.gitignore +++ b/.gitignore @@ -1,2 +1,2 @@ -SOURCES/chrony-2.1.1.tar.gz -SOURCES/clknetsim-c0e2b4.tar.gz +SOURCES/chrony-3.1.tar.gz +SOURCES/clknetsim-ce89a1.tar.gz diff --git a/SOURCES/chrony-phcdelay.patch b/SOURCES/chrony-phcdelay.patch new file mode 100644 index 0000000..d1d510e --- /dev/null +++ b/SOURCES/chrony-phcdelay.patch @@ -0,0 +1,33 @@ +commit abb09418b16993ecd8289dd459dff91701f4f971 +Author: Miroslav Lichvar +Date: Wed Apr 19 12:20:14 2017 +0200 + + sys_linux: don't drop PHC samples with zero delay + + When processing data from the PTP_SYS_OFFSET ioctl, the sample is + dropped when an interval between two consecutive readings of the system + clock is negative or zero, assuming the clock has been stepped between + the two readings. + + With a real PHC the interval is normally expected to be at least a + microsecond, but with a virtual PHC and a low-resolution system clock + it's possible to get two readings with the same system time. Modify the + check to drop only samples with a negative delay. + +diff --git a/sys_linux.c b/sys_linux.c +index c06112a..649afb0 100644 +--- a/sys_linux.c ++++ b/sys_linux.c +@@ -705,9 +705,11 @@ get_phc_sample(int phc_fd, double precision, struct timespec *phc_ts, + phc_tss[i] = ts2; + delays[i] = UTI_DiffTimespecsToDouble(&ts3, &ts1); + +- if (delays[i] <= 0.0) ++ if (delays[i] < 0.0) { + /* Step in the middle of a PHC reading? */ ++ DEBUG_LOG(LOGF_SysLinux, "Bad PTP_SYS_OFFSET sample delay=%e", delays[i]); + return 0; ++ } + + if (!i || delays[i] < min_delay) + min_delay = delays[i]; diff --git a/SOURCES/chrony-service-helper.patch b/SOURCES/chrony-service-helper.patch new file mode 100644 index 0000000..fe11392 --- /dev/null +++ b/SOURCES/chrony-service-helper.patch @@ -0,0 +1,11 @@ +diff -up chrony-3.1/examples/chronyd.service.service-helper chrony-3.1/examples/chronyd.service +--- chrony-3.1/examples/chronyd.service.service-helper 2017-01-31 12:12:01.863772826 +0100 ++++ chrony-3.1/examples/chronyd.service 2017-01-31 12:12:30.371860064 +0100 +@@ -10,6 +10,7 @@ Type=forking + PIDFile=/var/run/chronyd.pid + EnvironmentFile=-/etc/sysconfig/chronyd + ExecStart=/usr/sbin/chronyd $OPTIONS ++ExecStartPost=/usr/libexec/chrony-helper update-daemon + PrivateTmp=yes + ProtectHome=yes + ProtectSystem=full diff --git a/SOURCES/chrony-smoothleap.patch b/SOURCES/chrony-smoothleap.patch deleted file mode 100644 index 34af532..0000000 --- a/SOURCES/chrony-smoothleap.patch +++ /dev/null @@ -1,78 +0,0 @@ -commit c0a8afdb68694a31045111c6d7481c2cced34a34 -Author: Miroslav Lichvar -Date: Mon Sep 12 12:23:09 2016 +0200 - - smooth: fix selection of 1st stage direction - - When the smoothing process is updated with extremely small (e.g. - sub-nanosecond) values, both directions may give a negative length of - the 1st or 3rd stage due to numerical errors and the selection will fail - an in assertion. Rework the code to select the direction which gives a - smaller error. - -diff --git a/smooth.c b/smooth.c -index 4fa037b..08b80ba 100644 ---- a/smooth.c -+++ b/smooth.c -@@ -137,7 +137,7 @@ get_smoothing(struct timespec *now, double *poffset, double *pfreq, - static void - update_stages(void) - { -- double s1, s2, s, l1, l2, l3, lc, f, f2; -+ double s1, s2, s, l1, l2, l3, lc, f, f2, l1t[2], l3t[2], err[2]; - int i, dir; - - /* Prepare the three stages so that the integral of the frequency offset -@@ -146,22 +146,41 @@ update_stages(void) - s1 = smooth_offset / max_wander; - s2 = smooth_freq * smooth_freq / (2.0 * max_wander * max_wander); - -- l1 = l2 = l3 = 0.0; -- - /* Calculate the lengths of the 1st and 3rd stage assuming there is no -- frequency limit. If length of the 1st stage comes out negative, switch -- its direction. */ -- for (dir = -1; dir <= 1; dir += 2) { -+ frequency limit. The direction of the 1st stage is selected so that -+ the lengths will not be negative. With extremely small offsets both -+ directions may give a negative length due to numerical errors, so select -+ the one which gives a smaller error. */ -+ -+ for (i = 0, dir = -1; i <= 1; i++, dir += 2) { -+ err[i] = 0.0; - s = dir * s1 + s2; -- if (s >= 0.0) { -- l3 = sqrt(s); -- l1 = l3 - dir * smooth_freq / max_wander; -- if (l1 >= 0.0) -- break; -+ -+ if (s < 0.0) { -+ err[i] += -s; -+ s = 0.0; - } -+ -+ l3t[i] = sqrt(s); -+ l1t[i] = l3t[i] - dir * smooth_freq / max_wander; -+ -+ if (l1t[i] < 0.0) { -+ err[i] += l1t[i] * l1t[i]; -+ l1t[i] = 0.0; -+ } -+ } -+ -+ if (err[0] < err[1]) { -+ l1 = l1t[0]; -+ l3 = l3t[0]; -+ dir = -1; -+ } else { -+ l1 = l1t[1]; -+ l3 = l3t[1]; -+ dir = 1; - } - -- assert(dir <= 1 && l1 >= 0.0 && l3 >= 0.0); -+ l2 = 0.0; - - /* If the limit was reached, shorten 1st+3rd stages and set a 2nd stage */ - f = dir * smooth_freq + l1 * max_wander - max_freq; diff --git a/SOURCES/chrony-timestamping.patch b/SOURCES/chrony-timestamping.patch new file mode 100644 index 0000000..ce719a3 --- /dev/null +++ b/SOURCES/chrony-timestamping.patch @@ -0,0 +1,181 @@ +diff -up chrony-3.1/configure.timestamping chrony-3.1/configure +--- chrony-3.1/configure.timestamping 2017-01-31 11:22:11.000000000 +0100 ++++ chrony-3.1/configure 2017-02-03 12:09:22.911633573 +0100 +@@ -651,8 +651,8 @@ if [ $feat_timestamping = "1" ] && [ $tr + test_code 'SW/HW timestamping' 'sys/types.h sys/socket.h linux/net_tstamp.h + linux/errqueue.h linux/ptp_clock.h' '' '' ' + int val = SOF_TIMESTAMPING_SOFTWARE | SOF_TIMESTAMPING_RX_SOFTWARE | +- SOF_TIMESTAMPING_RAW_HARDWARE | SOF_TIMESTAMPING_OPT_CMSG; +- return sizeof (struct scm_timestamping) + SCM_TSTAMP_SND + PTP_SYS_OFFSET + ++ SOF_TIMESTAMPING_RAW_HARDWARE | 1; ++ return 3 * sizeof (struct timespec) + 0 + PTP_SYS_OFFSET + + setsockopt(0, SOL_SOCKET, SO_SELECT_ERR_QUEUE + SO_TIMESTAMPING, + &val, sizeof (val));' + then +diff -up chrony-3.1/doc/chrony.conf.man.in.timestamping chrony-3.1/doc/chrony.conf.man.in +--- chrony-3.1/doc/chrony.conf.man.in.timestamping 2017-01-31 11:34:16.000000000 +0100 ++++ chrony-3.1/doc/chrony.conf.man.in 2017-02-03 12:09:22.911633573 +0100 +@@ -3065,7 +3065,7 @@ timestamping. If the server or peer supp + be enabled by the \fBxleave\fP option in the \fBserver\fP or the + \fBpeer\fP directive. + .sp +-This directive is supported on Linux 3.19 and newer. The NIC must support HW ++This directive is supported on Linux. The NIC must support HW + timestamping, which can be verified with the \fBethtool \-T\fP command. The list of + capabilities should include \fISOF_TIMESTAMPING_RAW_HARDWARE\fP, + \fISOF_TIMESTAMPING_TX_HARDWARE\fP, \fISOF_TIMESTAMPING_RX_HARDWARE\fP, and the filter +diff -up chrony-3.1/ntp_io_linux.c.timestamping chrony-3.1/ntp_io_linux.c +--- chrony-3.1/ntp_io_linux.c.timestamping 2017-01-31 11:22:11.000000000 +0100 ++++ chrony-3.1/ntp_io_linux.c 2017-02-03 12:10:10.720767667 +0100 +@@ -36,6 +36,10 @@ + #include + #include + ++/* Missing in older kernel headers */ ++#define SOF_TIMESTAMPING_OPT_CMSG (1<<10) ++#define SCM_TSTAMP_SND 0 ++ + #include "array.h" + #include "conf.h" + #include "hwclock.h" +@@ -95,6 +99,10 @@ static int ts_tx_flags; + /* Flag indicating the socket options can't be changed in control messages */ + static int permanent_ts_options; + ++/* Index of a HW-timestamping interface, but only if the machine has not more ++ than one */ ++static int single_hwts_if_index; ++ + /* ================================================== */ + + static int +@@ -253,6 +261,84 @@ update_interface_speed(struct Interface + + /* ================================================== */ + ++static int ++check_sof_opt_cmsg() ++{ ++ int sock_fd, flags; ++ ++ sock_fd = socket(AF_INET, SOCK_DGRAM, 0); ++ if (sock_fd < 0) ++ return 0; ++ ++ flags = SOF_TIMESTAMPING_OPT_CMSG; ++ ++ if (setsockopt(sock_fd, SOL_SOCKET, SO_TIMESTAMPING, &flags, sizeof (flags)) < 0) { ++ DEBUG_LOG(LOGF_NtpIOLinux, "SOF_TIMESTAMPING_OPT_CMSG not supported"); ++ close(sock_fd); ++ return 0; ++ } ++ ++ close(sock_fd); ++ return 1; ++} ++ ++/* ================================================== */ ++ ++static int ++get_single_hwts_index() ++{ ++ struct ifaddrs *ifaddr, *ifa; ++ struct ethtool_ts_info ts_info; ++ struct ifreq req; ++ int sock_fd, if_index, hwts_if_index = INVALID_IF_INDEX; ++ ++ sock_fd = socket(AF_INET, SOCK_DGRAM, 0); ++ if (sock_fd < 0) ++ return INVALID_IF_INDEX; ++ ++ if (getifaddrs(&ifaddr)) { ++ DEBUG_LOG(LOGF_NtpIOLinux, "getifaddrs() failed : %s", strerror(errno)); ++ close(sock_fd); ++ return INVALID_IF_INDEX; ++ } ++ ++ for (ifa = ifaddr; ifa; ifa = ifa->ifa_next) { ++ memset(&req, 0, sizeof (req)); ++ memset(&ts_info, 0, sizeof (ts_info)); ++ ++ if (snprintf(req.ifr_name, sizeof (req.ifr_name), "%s", ifa->ifa_name) >= ++ sizeof (req.ifr_name)) ++ break; ++ ++ if (ioctl(sock_fd, SIOCGIFINDEX, &req)) ++ break; ++ ++ if_index = req.ifr_ifindex; ++ ts_info.cmd = ETHTOOL_GET_TS_INFO; ++ req.ifr_data = (char *)&ts_info; ++ ++ if (ioctl(sock_fd, SIOCETHTOOL, &req)) ++ break; ++ ++ if (ts_info.phc_index < 0) ++ continue; ++ ++ if (hwts_if_index != INVALID_IF_INDEX && hwts_if_index != if_index) ++ break; ++ ++ hwts_if_index = if_index; ++ } ++ ++ close(sock_fd); ++ freeifaddrs(ifaddr); ++ ++ if (ifa) ++ return INVALID_IF_INDEX; ++ ++ return hwts_if_index; ++} ++ ++/* ================================================== */ + void + NIO_Linux_Initialise(void) + { +@@ -289,8 +375,20 @@ NIO_Linux_Initialise(void) + ts_tx_flags = SOF_TIMESTAMPING_TX_SOFTWARE; + } + +- /* Enable IP_PKTINFO in messages looped back to the error queue */ +- ts_flags |= SOF_TIMESTAMPING_OPT_CMSG; ++ single_hwts_if_index = INVALID_IF_INDEX; ++ ++ /* Enable IP_PKTINFO in messages looped back to the error queue if possible. ++ If not, HW timestamping of IPv4 packets can be supported only with one ++ interface capable of HW timestamping. */ ++ if (check_sof_opt_cmsg()) { ++ ts_flags |= SOF_TIMESTAMPING_OPT_CMSG; ++ } else if (ARR_GetSize(interfaces) > 0) { ++ single_hwts_if_index = get_single_hwts_index(); ++ if (single_hwts_if_index == INVALID_IF_INDEX) ++ LOG(LOGS_WARN, LOGF_NtpIOLinux, "Missing SOF_TIMESTAMPING_OPT_CMSG option for HW timestamping with multiple HW-timestamping interfaces"); ++ else ++ LOG(LOGS_INFO, LOGF_NtpIOLinux, "Enabled single-interface HW-timestamping mode"); ++ } + + /* Kernels before 4.7 ignore timestamping flags set in control messages */ + permanent_ts_options = !SYS_Linux_CheckKernelVersion(4, 7); +@@ -499,7 +597,9 @@ NIO_Linux_ProcessMessage(NTP_Remote_Addr + + for (cmsg = CMSG_FIRSTHDR(hdr); cmsg; cmsg = CMSG_NXTHDR(hdr, cmsg)) { + if (cmsg->cmsg_level == SOL_SOCKET && cmsg->cmsg_type == SCM_TIMESTAMPING) { +- struct scm_timestamping ts3; ++ struct { ++ struct timespec ts[3]; ++ } ts3; + + memcpy(&ts3, CMSG_DATA(cmsg), sizeof (ts3)); + +@@ -507,6 +607,10 @@ NIO_Linux_ProcessMessage(NTP_Remote_Addr + LCL_CookTime(&ts3.ts[0], &local_ts->ts, &local_ts->err); + local_ts->source = NTP_TS_KERNEL; + } else if (!UTI_IsZeroTimespec(&ts3.ts[2])) { ++ if (local_addr->if_index == INVALID_IF_INDEX && ++ single_hwts_if_index != INVALID_IF_INDEX) ++ local_addr->if_index = single_hwts_if_index; ++ + iface = get_interface(local_addr->if_index); + if (iface) { + process_hw_timestamp(iface, &ts3.ts[2], local_ts, !is_tx ? length : 0, diff --git a/SOURCES/chrony-wait.service b/SOURCES/chrony-wait.service deleted file mode 100644 index 6513b4f..0000000 --- a/SOURCES/chrony-wait.service +++ /dev/null @@ -1,17 +0,0 @@ -[Unit] -Description=Wait for chrony to synchronize system clock -After=chronyd.service -Requires=chronyd.service -Before=time-sync.target -Wants=time-sync.target - -[Service] -Type=oneshot -# Wait up to ~10 minutes for chronyd to synchronize and the remaining -# clock correction to be less than 0.1 seconds -ExecStart=/usr/bin/chronyc waitsync 60 0.1 -RemainAfterExit=yes -StandardOutput=null - -[Install] -WantedBy=multi-user.target diff --git a/SOURCES/chrony.conf b/SOURCES/chrony.conf deleted file mode 100644 index 9da0097..0000000 --- a/SOURCES/chrony.conf +++ /dev/null @@ -1,46 +0,0 @@ -# Use public servers from the pool.ntp.org project. -# Please consider joining the pool (http://www.pool.ntp.org/join.html). -server 0.VENDORZONE.pool.ntp.org iburst -server 1.VENDORZONE.pool.ntp.org iburst -server 2.VENDORZONE.pool.ntp.org iburst -server 3.VENDORZONE.pool.ntp.org iburst - -# Ignore stratum in source selection. -stratumweight 0 - -# Record the rate at which the system clock gains/losses time. -driftfile /var/lib/chrony/drift - -# Enable kernel RTC synchronization. -rtcsync - -# In first three updates step the system clock instead of slew -# if the adjustment is larger than 10 seconds. -makestep 10 3 - -# Allow NTP client access from local network. -#allow 192.168/16 - -# Listen for commands only on localhost. -bindcmdaddress 127.0.0.1 -bindcmdaddress ::1 - -# Serve time even if not synchronized to any NTP server. -#local stratum 10 - -keyfile /etc/chrony.keys - -# Specify the key used as password for chronyc. -commandkey 1 - -# Generate command key if missing. -generatecommandkey - -# Disable logging of client accesses. -noclientlog - -# Send a message to syslog if a clock adjustment is larger than 0.5 seconds. -logchange 0.5 - -logdir /var/log/chrony -#log measurements statistics tracking diff --git a/SOURCES/chrony.helper b/SOURCES/chrony.helper index 0831482..c150ff6 100644 --- a/SOURCES/chrony.helper +++ b/SOURCES/chrony.helper @@ -117,7 +117,7 @@ update_dnssrv_servers() { set_dnssrv_timer() { local state=$1 name=$2 local srv_file=$helper_dir/dnssrv@$name servers - local timer=$dnssrv_timer_prefix$name.timer + local timer=$dnssrv_timer_prefix$(systemd-escape "$name").timer check_dnssrv_name "$name" || return 1 @@ -133,7 +133,10 @@ set_dnssrv_timer() { list_dnssrv_timers() { systemctl --all --full -t timer list-units | grep "^$dnssrv_timer_prefix" | \ - sed "s|^$dnssrv_timer_prefix\(.*\)\.timer.*|\1|" + sed "s|^$dnssrv_timer_prefix\(.*\)\.timer.*|\1|" | + while read -r name; do + systemd-escape --unescape "$name" + done } prepare_helper_dir() { diff --git a/SOURCES/chrony.keys b/SOURCES/chrony.keys deleted file mode 100644 index 6bed03a..0000000 --- a/SOURCES/chrony.keys +++ /dev/null @@ -1 +0,0 @@ -#1 a_key diff --git a/SOURCES/chrony.logrotate b/SOURCES/chrony.logrotate deleted file mode 100644 index 4bb83b2..0000000 --- a/SOURCES/chrony.logrotate +++ /dev/null @@ -1,8 +0,0 @@ -/var/log/chrony/*.log { - missingok - nocreate - sharedscripts - postrotate - /usr/libexec/chrony-helper command cyclelogs > /dev/null 2>&1 || true - endscript -} diff --git a/SOURCES/chronyd.service b/SOURCES/chronyd.service deleted file mode 100644 index 46da306..0000000 --- a/SOURCES/chronyd.service +++ /dev/null @@ -1,14 +0,0 @@ -[Unit] -Description=NTP client/server -After=ntpdate.service sntp.service ntpd.service -Conflicts=ntpd.service - -[Service] -Type=forking -PIDFile=/var/run/chronyd.pid -EnvironmentFile=-/etc/sysconfig/chronyd -ExecStart=/usr/sbin/chronyd $OPTIONS -ExecStartPost=/usr/libexec/chrony-helper update-daemon - -[Install] -WantedBy=multi-user.target diff --git a/SPECS/chrony.spec b/SPECS/chrony.spec index 02d0598..d15347b 100644 --- a/SPECS/chrony.spec +++ b/SPECS/chrony.spec @@ -1,37 +1,39 @@ %global _hardened_build 1 -%global clknetsim_ver c0e2b4 +%global clknetsim_ver ce89a1 %bcond_without debug Name: chrony -Version: 2.1.1 -Release: 4%{?dist} +Version: 3.1 +Release: 2%{?dist} Summary: An NTP client/server Group: System Environment/Daemons License: GPLv2 -URL: http://chrony.tuxfamily.org -Source0: http://download.tuxfamily.org/chrony/chrony-%{version}%{?prerelease}.tar.gz -Source1: chrony.conf -Source2: chrony.keys -Source3: chronyd.service -Source4: chrony.helper -Source5: chrony.logrotate -Source8: chrony.dhclient -Source9: chrony-wait.service +URL: https://chrony.tuxfamily.org +Source0: https://download.tuxfamily.org/chrony/chrony-%{version}%{?prerelease}.tar.gz +Source1: chrony.dhclient +Source2: chrony.helper +Source3: chrony-dnssrv@.service +Source4: chrony-dnssrv@.timer # simulator for test suite Source10: https://github.com/mlichvar/clknetsim/archive/%{clknetsim_ver}/clknetsim-%{clknetsim_ver}.tar.gz -Source11: chrony-dnssrv@.service -Source12: chrony-dnssrv@.timer -%{?gitpatch:Patch0: chrony-%{version}%{?prerelease}-%{gitpatch}.patch.gz} -Patch1: chrony-smoothleap.patch +# add NTP servers from DHCP when starting service +Patch1: chrony-service-helper.patch +# add limited support for SW/HW timestamping on older kernels +Patch2: chrony-timestamping.patch +# don't drop PHC samples with zero delay +Patch3: chrony-phcdelay.patch BuildRequires: libcap-devel libedit-devel nss-devel pps-tools-devel -BuildRequires: bison texinfo systemd-units +%ifarch %{ix86} x86_64 %{arm} aarch64 ppc64 ppc64le s390 s390x +BuildRequires: libseccomp-devel +%endif +BuildRequires: bison systemd-units Requires(pre): shadow-utils -Requires(post): systemd info -Requires(preun): systemd info +Requires(post): systemd +Requires(preun): systemd Requires(postun): systemd %description @@ -43,18 +45,33 @@ clocks, system real-time clock or manual input as time references. %if 0%{!?vendorzone:1} %{?fedora: %global vendorzone fedora.} -%{?rhel: %global vendorzone centos.} +%{?rhel: %global vendorzone rhel.} %endif %prep %setup -q -n %{name}-%{version}%{?prerelease} -a 10 -%{?gitpatch:%patch0 -p1} -%patch1 -p1 -b .smoothleap - -%{?gitpatch: echo %{version}-%{gitpatch} > version.txt} - -sed -e 's|VENDORZONE\.|%{vendorzone}|' < %{SOURCE1} > chrony.conf -touch -r %{SOURCE1} chrony.conf +%patch1 -p1 -b .service-helper +%patch2 -p1 -b .timestamping +%patch3 -p1 -b .phcdelay + +# review changes in packaged configuration files and scripts +md5sum -c <<-EOF | (! grep -v 'OK$') + 47ad7eccc410b981d2f2101cf5682616 examples/chrony-wait.service + 58978d335ec3752ac2c38fa82b48f0a5 examples/chrony.conf.example2 + ba6bb05c50e03f6b5ab54a2b7914800d examples/chrony.keys.example + 6a3178c4670de7de393d9365e2793740 examples/chrony.logrotate + 298b7f611078aa0176aad58e936c7b0d examples/chrony.nm-dispatcher + a85246982a89910b1e2d3356b7d131d7 examples/chronyd.service +EOF + +# use our vendor zone and replace the pool directive with server +# directives as some configuration tools don't support it yet +sed -e 's|^\(pool \)\(pool.ntp.org.*\)|'\ +'server 0.%{vendorzone}\2\nserver 1.%{vendorzone}\2\n'\ +'server 2.%{vendorzone}\2\nserver 3.%{vendorzone}\2|' \ + < examples/chrony.conf.example2 > chrony.conf + +touch -r examples/chrony.conf.example2 chrony.conf # regenerate the file from getdate.y rm -f getdate.c @@ -64,13 +81,17 @@ mv clknetsim-%{clknetsim_ver}* test/simulation/clknetsim %build %configure \ %{?with_debug: --enable-debug} \ + --enable-ntp-signd \ + --enable-scfilter \ --docdir=%{_docdir} \ + --with-ntp-era=$(date -d '1970-01-01 00:00:00+00:00' +'%s') \ --with-user=chrony \ + --with-hwclockfile=%{_sysconfdir}/adjtime \ --with-sendmail=%{_sbindir}/sendmail -make %{?_smp_mflags} all docs +make %{?_smp_mflags} %install -make install install-docs DESTDIR=$RPM_BUILD_ROOT +make install DESTDIR=$RPM_BUILD_ROOT rm -rf $RPM_BUILD_ROOT%{_docdir} @@ -82,28 +103,38 @@ mkdir -p $RPM_BUILD_ROOT%{_libexecdir} mkdir -p $RPM_BUILD_ROOT{%{_unitdir},%{_prefix}/lib/systemd/ntp-units.d} install -m 644 -p chrony.conf $RPM_BUILD_ROOT%{_sysconfdir}/chrony.conf -install -m 640 -p %{SOURCE2} $RPM_BUILD_ROOT%{_sysconfdir}/chrony.keys -install -m 644 -p %{SOURCE3} $RPM_BUILD_ROOT%{_unitdir}/chronyd.service -install -m 755 -p %{SOURCE4} $RPM_BUILD_ROOT%{_libexecdir}/chrony-helper -install -m 644 -p %{SOURCE5} $RPM_BUILD_ROOT%{_sysconfdir}/logrotate.d/chrony + +install -m 640 -p examples/chrony.keys.example \ + $RPM_BUILD_ROOT%{_sysconfdir}/chrony.keys install -m 755 -p examples/chrony.nm-dispatcher \ $RPM_BUILD_ROOT%{_sysconfdir}/NetworkManager/dispatcher.d/20-chrony -install -m 755 -p %{SOURCE8} \ +install -m 755 -p %{SOURCE1} \ $RPM_BUILD_ROOT%{_sysconfdir}/dhcp/dhclient.d/chrony.sh -install -m 644 -p %{SOURCE9} $RPM_BUILD_ROOT%{_unitdir}/chrony-wait.service -install -m 644 -p %{SOURCE11} $RPM_BUILD_ROOT%{_unitdir}/chrony-dnssrv@.service -install -m 644 -p %{SOURCE12} $RPM_BUILD_ROOT%{_unitdir}/chrony-dnssrv@.timer +install -m 644 -p examples/chrony.logrotate \ + $RPM_BUILD_ROOT%{_sysconfdir}/logrotate.d/chrony + +install -m 644 -p examples/chronyd.service \ + $RPM_BUILD_ROOT%{_unitdir}/chronyd.service +install -m 644 -p examples/chrony-wait.service \ + $RPM_BUILD_ROOT%{_unitdir}/chrony-wait.service +install -m 644 -p %{SOURCE3} $RPM_BUILD_ROOT%{_unitdir}/chrony-dnssrv@.service +install -m 644 -p %{SOURCE4} $RPM_BUILD_ROOT%{_unitdir}/chrony-dnssrv@.timer + +install -m 755 -p %{SOURCE2} $RPM_BUILD_ROOT%{_libexecdir}/chrony-helper + +cat > $RPM_BUILD_ROOT%{_sysconfdir}/sysconfig/chronyd < \ $RPM_BUILD_ROOT%{_prefix}/lib/systemd/ntp-units.d/50-chronyd.list -gzip -9 -f -n chrony.txt - %check # set random seed to get deterministic results -export CLKNETSIM_RANDOM_SEED=24501 +export CLKNETSIM_RANDOM_SEED=24502 make %{?_smp_mflags} -C test/simulation/clknetsim make check @@ -115,31 +146,24 @@ getent passwd chrony > /dev/null || /usr/sbin/useradd -r -g chrony \ %post %systemd_post chronyd.service chrony-wait.service -/sbin/install-info %{_infodir}/chrony.info.gz %{_infodir}/dir &> /dev/null -: %preun %systemd_preun chronyd.service chrony-wait.service -if [ "$1" -eq 0 ]; then - /sbin/install-info --delete %{_infodir}/chrony.info.gz \ - %{_infodir}/dir &> /dev/null -fi -: %postun %systemd_postun_with_restart chronyd.service %files -%doc COPYING FAQ NEWS README chrony.txt.gz +%doc COPYING FAQ NEWS README %config(noreplace) %{_sysconfdir}/chrony.conf %config(noreplace) %verify(not md5 size mtime) %attr(640,root,chrony) %{_sysconfdir}/chrony.keys %config(noreplace) %{_sysconfdir}/logrotate.d/chrony +%config(noreplace) %{_sysconfdir}/sysconfig/chronyd %{_sysconfdir}/NetworkManager/dispatcher.d/20-chrony %{_sysconfdir}/dhcp/dhclient.d/chrony.sh %{_bindir}/chronyc %{_sbindir}/chronyd %{_libexecdir}/chrony-helper -%{_infodir}/chrony.info* %{_prefix}/lib/systemd/ntp-units.d/*.list %{_unitdir}/chrony*.service %{_unitdir}/chrony*.timer @@ -150,8 +174,14 @@ fi %dir %attr(-,chrony,chrony) %{_localstatedir}/log/chrony %changelog -* Tue Dec 06 2016 CentOS Sources - 2.1.1-4.el7.centos -- rebrand vendorzone +* Mon Apr 24 2017 Miroslav Lichvar 3.1-2 +- don't drop PHC samples with zero delay (#1443342) + +* Fri Feb 03 2017 Miroslav Lichvar 3.1-1 +- update to 3.1 (#1387223 #1274250 #1350669 #1406445) +- don't start chronyd without capability to set system clock (#1306046) +- fix chrony-helper to escape names of systemd units (#1418968) +- package chronyd sysconfig file (#1396840) * Fri Nov 18 2016 Miroslav Lichvar 2.1.1-4 - fix crash with smoothtime leaponly directive (#1392793)