update to 1.28-pre1
This commit is contained in:
parent
04c745b7d1
commit
2762934d9d
2
.gitignore
vendored
2
.gitignore
vendored
@ -1 +1 @@
|
|||||||
/chrony-1.27.tar.gz
|
/chrony-1.28-pre1.tar.gz
|
||||||
|
@ -1,24 +0,0 @@
|
|||||||
commit 0bb772c575b3842c38e6a58591ecea94449e9bae
|
|
||||||
Author: Miroslav Lichvar <mlichvar@redhat.com>
|
|
||||||
Date: Fri Mar 8 13:54:10 2013 +0100
|
|
||||||
|
|
||||||
Fix delta calculation with extreme frequency offsets
|
|
||||||
|
|
||||||
This should prevent chronyd from getting stuck and refusing new samples
|
|
||||||
due to failing test4 when the current measured frequency offset is close
|
|
||||||
to 1.0. That can happen when the system clock is stepped forward behind
|
|
||||||
chronyd's back.
|
|
||||||
|
|
||||||
diff --git a/ntp_core.c b/ntp_core.c
|
|
||||||
index 0fb93e1..be9f613 100644
|
|
||||||
--- a/ntp_core.c
|
|
||||||
+++ b/ntp_core.c
|
|
||||||
@@ -793,7 +793,7 @@ receive_packet(NTP_Packet *message, struct timeval *now, double now_err, NCR_Ins
|
|
||||||
assuming worst case frequency error between us and the other
|
|
||||||
source */
|
|
||||||
|
|
||||||
- delta = local_interval - remote_interval / (1.0 - source_freq_lo);
|
|
||||||
+ delta = local_interval - remote_interval * (1.0 + source_freq_lo);
|
|
||||||
|
|
||||||
/* Calculate theta. Following the NTP definition, this is negative
|
|
||||||
if we are fast of the remote source. */
|
|
@ -33,6 +33,9 @@ keyfile /etc/chrony.keys
|
|||||||
# Specify the key used as password for chronyc.
|
# Specify the key used as password for chronyc.
|
||||||
commandkey 1
|
commandkey 1
|
||||||
|
|
||||||
|
# Generate command key if missing.
|
||||||
|
generatecommandkey
|
||||||
|
|
||||||
# Disable logging of client accesses.
|
# Disable logging of client accesses.
|
||||||
noclientlog
|
noclientlog
|
||||||
|
|
||||||
|
@ -1,46 +1,12 @@
|
|||||||
#!/bin/bash
|
#!/bin/bash
|
||||||
|
|
||||||
config=/etc/chrony.conf
|
|
||||||
keyfile=/etc/chrony.keys
|
|
||||||
chronyc=/usr/bin/chronyc
|
chronyc=/usr/bin/chronyc
|
||||||
dhclient_servers=/var/lib/dhclient/chrony.servers.*
|
dhclient_servers=/var/lib/dhclient/chrony.servers.*
|
||||||
dhclient_added_servers=/var/lib/dhclient/chrony.added_servers
|
dhclient_added_servers=/var/lib/dhclient/chrony.added_servers
|
||||||
service_name=chronyd.service
|
service_name=chronyd.service
|
||||||
|
|
||||||
get_key() {
|
|
||||||
awk '/^[ \t]*'$1'\>/ { if ($3 == "") print "MD5", $2;
|
|
||||||
else print $2, $3; exit }' < $keyfile
|
|
||||||
}
|
|
||||||
|
|
||||||
get_commandkeyid() {
|
|
||||||
awk '/^[ \t]*commandkey\>/ { keyid=$2 } END { print keyid }' < $config
|
|
||||||
}
|
|
||||||
|
|
||||||
chrony_command() {
|
chrony_command() {
|
||||||
commandkeyid=$(get_commandkeyid)
|
$chronyc -a -m "$1"
|
||||||
[ -z "$commandkeyid" ] && return 1
|
|
||||||
commandkey=$(get_key $commandkeyid)
|
|
||||||
[ -z "$commandkey" ] && return 2
|
|
||||||
|
|
||||||
authhash=${commandkey% *}
|
|
||||||
password=${commandkey#* }
|
|
||||||
|
|
||||||
$chronyc <<EOF
|
|
||||||
authhash $authhash
|
|
||||||
password $password
|
|
||||||
$1
|
|
||||||
EOF
|
|
||||||
}
|
|
||||||
|
|
||||||
generate_commandkey() {
|
|
||||||
commandkeyid=$(get_commandkeyid)
|
|
||||||
[ -z "$commandkeyid" ] && return 1
|
|
||||||
commandkey=$(get_key $commandkeyid)
|
|
||||||
[ -z "$commandkey" ] || return 0
|
|
||||||
|
|
||||||
password=$(tr -c -d '0-9A-F' < /dev/urandom 2> /dev/null | head -c 40)
|
|
||||||
[ ${#password} -eq 40 ] &&
|
|
||||||
echo "$commandkeyid SHA1 HEX:$password" >> $keyfile
|
|
||||||
}
|
}
|
||||||
|
|
||||||
update_dhclient_added_servers() {
|
update_dhclient_added_servers() {
|
||||||
@ -87,9 +53,6 @@ is_running() {
|
|||||||
}
|
}
|
||||||
|
|
||||||
case "$1" in
|
case "$1" in
|
||||||
generate-commandkey)
|
|
||||||
generate_commandkey
|
|
||||||
;;
|
|
||||||
add-dhclient-servers)
|
add-dhclient-servers)
|
||||||
add_dhclient_servers
|
add_dhclient_servers
|
||||||
;;
|
;;
|
||||||
@ -106,7 +69,7 @@ case "$1" in
|
|||||||
chrony_command "$2"
|
chrony_command "$2"
|
||||||
;;
|
;;
|
||||||
*)
|
*)
|
||||||
echo $"Usage: $0 {generate-commandkey|add-dhclient-servers|remove-dhclient-servers|is-running|command|forced-command}"
|
echo $"Usage: $0 {add-dhclient-servers|remove-dhclient-servers|is-running|command|forced-command}"
|
||||||
exit 2
|
exit 2
|
||||||
esac
|
esac
|
||||||
exit $?
|
exit $?
|
||||||
|
@ -1,6 +1,7 @@
|
|||||||
|
%global prerelease -pre1
|
||||||
Name: chrony
|
Name: chrony
|
||||||
Version: 1.27
|
Version: 1.28
|
||||||
Release: 3%{?gitpatch:.%{gitpatch}}%{?dist}
|
Release: 0.1.pre1%{?dist}
|
||||||
Summary: An NTP client/server
|
Summary: An NTP client/server
|
||||||
|
|
||||||
Group: System Environment/Daemons
|
Group: System Environment/Daemons
|
||||||
@ -16,7 +17,6 @@ Source7: chrony.nm-dispatcher
|
|||||||
Source8: chrony.dhclient
|
Source8: chrony.dhclient
|
||||||
Source9: chrony-wait.service
|
Source9: chrony-wait.service
|
||||||
%{?gitpatch:Patch0: chrony-%{version}%{?prerelease}-%{gitpatch}.patch.gz}
|
%{?gitpatch:Patch0: chrony-%{version}%{?prerelease}-%{gitpatch}.patch.gz}
|
||||||
Patch1: chrony-delta.patch
|
|
||||||
|
|
||||||
BuildRequires: libcap-devel libedit-devel nss-devel pps-tools-devel bison texinfo
|
BuildRequires: libcap-devel libedit-devel nss-devel pps-tools-devel bison texinfo
|
||||||
|
|
||||||
@ -40,7 +40,6 @@ clocks, system real-time clock or manual input as time references.
|
|||||||
%prep
|
%prep
|
||||||
%setup -q -n %{name}-%{version}%{?prerelease}
|
%setup -q -n %{name}-%{version}%{?prerelease}
|
||||||
%{?gitpatch:%patch0 -p1}
|
%{?gitpatch:%patch0 -p1}
|
||||||
%patch1 -p1 -b .delta
|
|
||||||
|
|
||||||
%{?gitpatch: echo %{version}-%{gitpatch} > version.txt}
|
%{?gitpatch: echo %{version}-%{gitpatch} > version.txt}
|
||||||
|
|
||||||
|
@ -6,7 +6,6 @@ Conflicts=ntpd.service
|
|||||||
[Service]
|
[Service]
|
||||||
Type=forking
|
Type=forking
|
||||||
EnvironmentFile=-/etc/sysconfig/chronyd
|
EnvironmentFile=-/etc/sysconfig/chronyd
|
||||||
ExecStartPre=/usr/libexec/chrony-helper generate-commandkey
|
|
||||||
ExecStart=/usr/sbin/chronyd -u chrony $OPTIONS
|
ExecStart=/usr/sbin/chronyd -u chrony $OPTIONS
|
||||||
ExecStartPost=/usr/libexec/chrony-helper add-dhclient-servers
|
ExecStartPost=/usr/libexec/chrony-helper add-dhclient-servers
|
||||||
|
|
||||||
|
Loading…
Reference in New Issue
Block a user