From: Michael Tremer Date: Mon, 25 Mar 2019 22:01:17 +0000 (+0000) Subject: chrony: Update to 3.4 X-Git-Url: http://git.ipfire.org/cgi-bin/gitweb.cgi?a=commitdiff_plain;h=9296f2a8401787ac41c8a50695e41e7f0bd38eb3;p=ipfire-3.x.git chrony: Update to 3.4 Signed-off-by: Michael Tremer --- diff --git a/chrony/chrony-helper b/chrony/chrony-helper deleted file mode 100644 index 34add5f40..000000000 --- a/chrony/chrony-helper +++ /dev/null @@ -1,68 +0,0 @@ -#!/bin/bash - -config=/etc/chrony.conf -keyfile=/etc/chrony.keys -chronyc=/usr/bin/chronyc -dhclient_servers=/var/lib/dhclient/chrony.servers.* -service_name=chronyd.service - -get_key() { - awk '/^[ \t]*'$1'\>/ { print $2; exit }' < $keyfile -} - -get_commandkeyid() { - awk '/^[ \t]*commandkey\>/ { keyid=$2 } END { print keyid }' < $config -} - -chrony_command() { - commandkeyid=$(get_commandkeyid) - [ -z "$commandkeyid" ] && return 1 - commandkey=$(get_key $commandkeyid) - [ -z "$commandkey" ] && return 2 - - $chronyc <> $keyfile -} - -add_dhclient_servers() { - command=$(cat $dhclient_servers 2> /dev/null | - while read server serverargs; do - echo "add server $server $serverargs" - done) - if [ -n "$command" ]; then - chrony_command "$command" &> /dev/null - fi -} - -is_running() { - systemctl status chronyd.service &> /dev/null -} - -case "$1" in - generate-commandkey) - generate_commandkey - ;; - add-dhclient-servers) - add_dhclient_servers - ;; - command) - is_running && chrony_command "$2" - ;; - *) - echo $"Usage: $0 {generate-commandkey|add-dhclient-servers|command}" - exit 2 -esac -exit $? - diff --git a/chrony/chrony.conf b/chrony/chrony.conf index 3d58b816d..0a1adda98 100644 --- a/chrony/chrony.conf +++ b/chrony/chrony.conf @@ -26,9 +26,6 @@ makestep 100 3 keyfile /etc/chrony.keys -# Specify the key used as password for chronyc. -commandkey 1 - # Disable logging of client accesses. noclientlog diff --git a/chrony/chrony.dhclient b/chrony/chrony.dhclient deleted file mode 100644 index 73fa893ff..000000000 --- a/chrony/chrony.dhclient +++ /dev/null @@ -1,24 +0,0 @@ -#!/bin/bash - -SERVERFILE=$SAVEDIR/chrony.servers.$interface - -chrony_config() { - rm -f $SERVERFILE - if [ "$PEERNTP" != "no" ]; then - /usr/libexec/chrony-helper command "$( - for server in $new_ntp_servers; do - echo "add server $server $NTPSERVERARGS" - echo "$server $NTPSERVERARGS" >> $SERVERFILE - done)" &> /dev/null - fi -} - -chrony_restore() { - if [ -f $SERVERFILE ]; then - /usr/libexec/chrony-helper command "$( - while read server serverargs; do - echo "delete $server" - done < $SERVERFILE)" &> /dev/null - rm -f $SERVERFILE - fi -} diff --git a/chrony/chrony.nm b/chrony/chrony.nm index 10daf278d..a0e073db7 100644 --- a/chrony/chrony.nm +++ b/chrony/chrony.nm @@ -4,11 +4,11 @@ ############################################################################### name = chrony -version = 1.26 -release = 9 +version = 3.4 +release = 1 groups = System/Daemons -url = http://chrony.tuxfamily.org +url = https://chrony.tuxfamily.org license = GPLv2 summary = An NTP client/server. @@ -20,11 +20,14 @@ description clocks, system real-time clock or manual input as time references. end +source_dl = https://download.tuxfamily.org/chrony/ + build requires bison libcap-devel libedit-devel + nettle-devel readline-devel shadow-utils texinfo @@ -50,17 +53,10 @@ build install -m 640 -p %{DIR_SOURCE}/chrony.keys %{BUILDROOT}/etc/chrony.keys chown -v root.chrony %{BUILDROOT}/etc/chrony.keys - mkdir -pv %{BUILDROOT}/etc/dhcp/dhclient.d - install -m 755 -p %{DIR_SOURCE}/chrony.dhclient \ - %{BUILDROOT}/etc/dhcp/dhclient.d/chrony.sh - mkdir -pv %{BUILDROOT}/etc/logrotate.d install -m 644 -p %{DIR_SOURCE}/chrony.logrotate \ %{BUILDROOT}/etc/logrotate.d/chrony - mkdir -pv %{BUILDROOT}/usr/lib/chrony - install -m 755 -p %{DIR_SOURCE}/chrony-helper %{BUILDROOT}/usr/lib/chrony-helper - chown -Rv chrony.chrony %{BUILDROOT}/var/{lib,log}/chrony end end diff --git a/chrony/systemd/chronyd.service b/chrony/systemd/chronyd.service index 018098299..0a8ab0ad7 100644 --- a/chrony/systemd/chronyd.service +++ b/chrony/systemd/chronyd.service @@ -5,9 +5,7 @@ Conflicts=ntpd.service [Service] EnvironmentFile=-/etc/sysconfig/chronyd -ExecStartPre=/usr/lib/chrony-helper generate-commandkey ExecStart=/usr/sbin/chronyd -n -u chrony $OPTIONS -ExecStartPost=/usr/lib/chrony-helper add-dhclient-servers [Install] WantedBy=multi-user.target