# NTP server list from: RITM0096493 %define ntpservers nsntp1.fnal.gov nsntp2.fnal.gov nsntp3.fnal.gov nsntp4.fnal.gov nsntp5.fnal.gov Name: fermilab-conf_timesync Obsoletes: zz_ntp_configure Version: 1.0 Release: 4 Summary: Configures network time sync for use at Fermilab Group: Fermilab License: GPL URL: http://helpdesk.fnal.gov Source0: fermilab_timesync.conf BuildRequires: bash coreutils systemd BuildArch: noarch Requires(post): policycoreutils coreutils systemd grep Requires: chrony >= 3.0 %description This package configures a time daemon correctly for use at Fermilab. At this time the default time servers are listed as: %{ntpservers} %prep %build cp %{SOURCE0} fermilab_timesettings.conf touch fermilab_timeservers.conf for system in %{ntpservers}; do echo "server ${system} iburst" >> fermilab_timeservers.conf done %install rm -rf %{buildroot} %{__install} -D fermilab_timesettings.conf %{buildroot}/etc/chrony.d/fermilab_timesettings.conf %{__install} -D fermilab_timeservers.conf %{buildroot}/etc/chrony.d/fermilab_timeservers.conf %clean rm -rf %{buildroot} %post -p /usr/bin/bash SELFCOPIES=${1:-0} if [[ ${SELFCOPIES -eq 1 ]]; then # start chrony systemctl enable chronyd.service # setup fetching ntp servers from dns as well as static list /usr/libexec/chrony-helper enable-dnssrv _ntp._udp.fnal.gov fi grep -v '#' /etc/chrony.conf | grep -q 'include /etc/chrony.d/\*.conf' if [[ $? -ne 0 ]]; then echo 'include /etc/chrony.d/*.conf' >> /etc/chrony.conf fi %postun -p /usr/bin/bash SELFCOPIES=${1:-0} if [[ ${SELFCOPIES -eq 0 ]]; then # setup fetching ntp servers from dns as well as static list /usr/libexec/chrony-helper disable-dnssrv _ntp._udp.fnal.gov fi ##################################################################### ##################################################################### %files %defattr(0644,root,root,0755) %config(noreplace) /etc/chrony.d/fermilab_timesettings.conf %config(noreplace) /etc/chrony.d/fermilab_timeservers.conf ##################################################################### %changelog * Mon Jan 13 2020 Pat Riehecky 1.0-4 - Initial build for EL8 * Mon Nov 2 2015 Pat Riehecky 1.0-3 - now removes config on uninstall * Thu Sep 24 2015 Pat Riehecky 1.0-2.2 - better use of restorecon * Tue Sep 8 2015 Pat Riehecky 1.0-2.1 - Corrected second typo * Tue Sep 8 2015 Pat Riehecky 1.0-2 - Corrected typo * Fri Aug 7 2015 Pat Riehecky 1.0-1 - No broadcast client per RITM0096493 - Server list from RITM0096493 - Initial build for EL7