+++ /dev/null
-# For more information about this file, see the man pages
-# ntp.conf(5), ntp_acc(5), ntp_auth(5), ntp_clock(5), ntp_misc(5), ntp_mon(5).
-
-driftfile VARNTP/drift
-
-# Permit time synchronization with our time source, but do not
-# permit the source to query or modify the service on this system.
-restrict default kod nomodify notrap nopeer noquery
-restrict -6 default kod nomodify notrap nopeer noquery
-
-# Permit all access over the loopback interface. This could
-# be tightened as well, but to do so would effect some of
-# the administrative functions.
-restrict 127.0.0.1
-restrict -6 ::1
-
-# Hosts on local network are less restricted.
-#restrict 192.168.1.0 mask 255.255.255.0 nomodify notrap
-
-# 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
-
-#broadcast 192.168.1.255 autokey # broadcast server
-#broadcastclient # broadcast client
-#broadcast 224.0.1.1 autokey # multicast server
-#multicastclient 224.0.1.1 # multicast client
-#manycastserver 239.255.254.254 # manycast server
-#manycastclient 239.255.254.254 autokey # manycast client
-
-# Enable public key cryptography.
-#crypto
-
-includefile ETCNTP/crypto/pw
-
-# Key file containing the keys and key identifiers used when operating
-# with symmetric key cryptography.
-keys ETCNTP/keys
-
-# Specify the key identifiers which are trusted.
-#trustedkey 4 8 42
-
-# Specify the key identifier to use with the ntpdc utility.
-#requestkey 8
-
-# Specify the key identifier to use with the ntpq utility.
-#controlkey 8
-
-# Enable writing of statistics records.
-#statistics clockstats cryptostats loopstats peerstats
+++ /dev/null
-###############################################################################
-# IPFire.org - An Open Source Firewall Solution #
-# Copyright (C) - IPFire Development Team <info@ipfire.org> #
-###############################################################################
-
-name = ntp
-version = %{ver_major}.8
-ver_major = 4.2
-release = 4
-
-groups = System/Daemons
-url = http://www.ntp.org/
-license = (MIT and BSD and BSD with advertising) and GPLv2
-summary = The NTP daemon and utilities.
-
-description
- The Network Time Protocol (NTP) is used to synchronize a computer's
- time with another reference time source. This package includes ntpd
- (a daemon which continuously adjusts system time) and utilities used
- to query and configure the ntpd daemon.
-end
-
-source_dl = http://www.eecis.udel.edu/~ntp/ntp_spool/ntp4/ntp-%{ver_major}/
-
-# The vendor part in the NTP pool address.
-VENDORZONE = %{DISTRO_SNAME}
-
-build
- requires
- libcap-devel
- libedit-devel
- openssl-devel
- perl-HTML-Parser
- pps-tools-devel
- end
-
- prepare_cmds
- # Create ntp user and group.
- %{create_user}
- end
-
- configure_options += \
- --sysconfdir=%{sysconfdir}/ntp/crypto \
- --enable-all-clocks \
- --enable-parse-clocks \
- --enable-ntp-signd=%{localstatedir}/run/ntp_signd \
- --without-rpath
-
- make_install_targets += bindir=%{sbindir}
-
- install_cmds
- mkdir -pv %{BUILDROOT}%{mandir}/man{5,8}
- sed -i "s/sntp\.1/sntp\.8/" %{BUILDROOT}%{mandir}/man1/sntp.1
- mv -v %{BUILDROOT}%{mandir}/man{1/sntp.1,8/sntp.8}
- rm -rfv %{BUILDROOT}%{mandir}/man1
-
- # Fix section numbers.
- sed -i 's/\(\.TH[a-zA-Z ]*\)[1-9]\(.*\)/\18\2/' \
- %{BUILDROOT}%{mandir}/man8/*.8
-
- mkdir -pv %{BUILDROOT}/%{sysconfdir}/sysconfig
- mkdir -pv %{BUILDROOT}/%{localstatedir}/{lib/ntp,log/ntpstats}
- mkdir -pv %{BUILDROOT}%{prefix}/lib
- touch %{BUILDROOT}/%{localstatedir}/lib/ntp/{drift,sntp-kod}
-
- sed \
- -e "s@VENDORZONE@%{VENDORZONE}@g" \
- -e "s@ETCNTP@%{sysconfdir}/ntp@g" \
- -e "s@VARNTP@%{localstatedir}/lib/ntp@g" \
- < %{DIR_SOURCE}/ntp.conf > %{BUILDROOT}%{sysconfdir}/ntp.conf
-
- mkdir -pv %{BUILDROOT}%{sysconfdir}/ntp
- sed -e "s@VENDORZONE@%{VENDORZONE}@g" \
- < %{DIR_SOURCE}/ntp.step-tickers > %{BUILDROOT}%{sysconfdir}/ntp/step-tickers
-
- # Install crypto pw.
- mkdir -pv %{BUILDROOT}%{sysconfdir}/ntp/crypto
- install -p -m 600 %{DIR_SOURCE}/ntp.cryptopw \
- %{BUILDROOT}%{sysconfdir}/ntp/crypto/pw
-
- # Install keys.
- install -p -m 600 %{DIR_SOURCE}/ntp.keys \
- %{BUILDROOT}%{sysconfdir}/ntp/keys
-
- # Install ntpdate wrapper.
- install -p -m 755 %{DIR_SOURCE}/ntpdate-wrapper\
- %{BUILDROOT}%{prefix}/lib/ntpdate-wrapper
- install -p -m 644 %{DIR_SOURCE}/ntpdate.sysconfig \
- %{BUILDROOT}%{sysconfdir}/sysconfig/ntpdate
-
- mkdir -pv %{unitdir}/ntp-units.d
- echo "ntpd.service" > %{unitdir}/ntp-units.d/60-ntpd.list
-
- # Fix ownership.
- chown -R ntp:ntp %{BUILDROOT}%{sharedstatedir}/ntp
- end
-end
-
-create_user
- getent group ntp >/dev/null || groupadd -g 38 ntp || :
- getent passwd ntp >/dev/null || useradd -u 38 -g 38 -s /sbin/nologin \
- -M -r -d %{sysconfdir}/ntp ntp || :
-end
-
-packages
- package %{name}
- groups += Base
-
- requires
- ntpdate = %{thisver}
- end
-
- datafiles
- %{localstatedir}/lib/ntp/drift
- end
-
- script postin
- systemctl daemon-reload >/dev/null 2>&1 || :
- systemctl --no-reload enable ntpd.service >/dev/null 2>&1 || :
- end
-
- script preun
- systemctl --no-reload disable ntpd.service >/dev/null 2>&1 || :
- systemctl stop ntpd.service >/dev/null 2>&1 || :
- end
-
- script postun
- systemctl daemon-reload >/dev/null 2>&1 || :
- end
-
- script postup
- systemctl daemon-reload >/dev/null 2>&1 || :
- systemctl try-restart ntpd.service >/dev/null 2>&1 || :
- end
- end
-
- package ntpdate
- summary = Utility to set the date and time via NTP.
-
- description
- ntpdate is a program for retrieving the date and time
- from NTP servers.
- end
-
- files
- %{sbindir}/ntpdate
- %{mandir}/man8/ntpdate.8*
- end
-
- script prein
- %{create_user}
- end
-
- script postin
- systemctl daemon-reload >/dev/null 2>&1 || :
- end
-
- script preun
- systemctl --no-reload disable ntpdate.service >/dev/null 2>&1 || :
- systemctl stop ntpdate.service >/dev/null 2>&1 || :
- end
-
- script postun
- systemctl daemon-reload >/dev/null 2>&1 || :
- end
- end
-
- package %{name}-devel
- template DEVEL
- end
-
- package %{name}-debuginfo
- template DEBUGINFO
- end
-end
+++ /dev/null
-#!/bin/bash
-
-ntpconf=/etc/ntp.conf
-ntpstep=/etc/ntp/step-tickers
-
-[ "$EUID" != "0" ] && exit 4
-[ -x /usr/sbin/ntpdate ] || exit 5
-[ -f /etc/sysconfig/ntpdate ] || exit 6
-. /etc/sysconfig/ntpdate
-
-[ -f $ntpstep ] && tickers=$(sed 's/#.*//' $ntpstep) || tickers=
-
-if ! echo "$tickers" | grep -qi '[a-z0-9]' && [ -f $ntpconf ]; then
- # the step-tickers file doesn't specify a server,
- # use servers from ntp.conf instead
- tickers=$(awk '$1=="peer"||$1=="server"{print $2}' $ntpconf | \
- grep -Ev '127\.127\.[0-9]+\.[0-9]+')
-fi
-
-if ! echo "$tickers" | grep -qi '[a-z0-9]'; then
- echo "NTP server not specified in $ntpstep or $ntpconf"
- exit 6
-fi
-
-[ -z "$RETRIES" ] && RETRIES=2
-retry=0
-while true; do
- /usr/sbin/ntpdate -U ntp -s -b $OPTIONS $tickers &> /dev/null
- RETVAL=$?
- [ $RETVAL -eq 0 ] || [ $retry -ge "$RETRIES" ] && break
- sleep $[10 * (1 << $retry)]
- retry=$[$retry + 1]
-done
-
-[ $RETVAL -eq 0 ] && [ "$SYNC_HWCLOCK" = "yes" ] && /sbin/hwclock --systohc
-exit $RETVAL