diff --git a/.gitignore b/.gitignore index 4ff9ed3..c5c36ff 100644 --- a/.gitignore +++ b/.gitignore @@ -1,2 +1,2 @@ -/chrony-3.3.tar.gz -/clknetsim-5b4d14.tar.gz +/chrony-3.4-pre1.tar.gz +/clknetsim-774308.tar.gz diff --git a/chrony-getrandom.patch b/chrony-getrandom.patch deleted file mode 100644 index 06581e4..0000000 --- a/chrony-getrandom.patch +++ /dev/null @@ -1,34 +0,0 @@ -commit 7c5bd948bb7e21fa0ee22f29e97748b2d0360319 -Author: Miroslav Lichvar -Date: Thu May 17 14:16:58 2018 +0200 - - util: fall back to reading /dev/urandom when getrandom() blocks - - With recent changes in the Linux kernel, the getrandom() system call may - block for a long time after boot on machines that don't have enough - entropy. It blocks the chronyd's initialization before it can detach - from the terminal and may cause a chronyd service to fail to start due - to a timeout. - - At least for now, enable the GRND_NONBLOCK flag to make the system call - non-blocking and let the code fall back to reading /dev/urandom (which - never blocks) if the system call failed with EAGAIN or any other error. - - This makes the start of chronyd non-deterministic with respect to files - that it needs to open and possibly also makes it slightly easier to - guess the transmit/receive timestamp in client requests until the - urandom source is fully initialized. - -diff --git a/util.c b/util.c -index 4b3e455..76417d5 100644 ---- a/util.c -+++ b/util.c -@@ -1224,7 +1224,7 @@ get_random_bytes_getrandom(char *buf, unsigned int len) - if (disabled) - break; - -- if (getrandom(rand_buf, sizeof (rand_buf), 0) != sizeof (rand_buf)) { -+ if (getrandom(rand_buf, sizeof (rand_buf), GRND_NONBLOCK) != sizeof (rand_buf)) { - disabled = 1; - break; - } diff --git a/chrony-pidfile.patch b/chrony-pidfile.patch deleted file mode 100644 index 249443a..0000000 --- a/chrony-pidfile.patch +++ /dev/null @@ -1,85 +0,0 @@ -commit 26e08abe71fe66703e06afae1168144dd1eecf3f -Author: Miroslav Lichvar -Date: Thu Jun 7 16:43:59 2018 +0200 - - main: create directories before writing pidfile - - This makes it possible to save pidfile in /var/run/chrony. - -diff --git a/main.c b/main.c -index a2202e9..e538cc5 100644 ---- a/main.c -+++ b/main.c -@@ -530,9 +530,6 @@ int main - /* Check whether another chronyd may already be running */ - check_pidfile(); - -- /* Write our pidfile to prevent other chronyds running */ -- write_pidfile(); -- - if (!user) - user = CNF_GetUser(); - -@@ -543,6 +540,9 @@ int main - /* Create directories for sockets, log files, and dump files */ - CNF_CreateDirs(pw->pw_uid, pw->pw_gid); - -+ /* Write our pidfile to prevent other instances from running */ -+ write_pidfile(); -+ - PRV_Initialise(); - LCL_Initialise(); - SCH_Initialise(); - -commit e50dc739d88feca6e0da034406034f3d3cf60ca4 -Author: Miroslav Lichvar -Date: Thu Jun 7 16:54:59 2018 +0200 - - configure: move default pidfile to /var/run/chrony - - This allows chronyd to remove its pidfile on exit after dropping the - root privileges in order to prevent another chronyd instance from - failing to start, e.g. due to a wrong SELinux label from chronyd -q. - -diff --git a/configure b/configure -index 25773de..c5de5ea 100755 ---- a/configure -+++ b/configure -@@ -108,7 +108,7 @@ For better control, use the options below. - since 1970-01-01 [50*365 days ago] - --with-user=USER Specify default chronyd user [root] - --with-hwclockfile=PATH Specify default path to hwclock(8) adjtime file -- --with-pidfile=PATH Specify default pidfile [/var/run/chronyd.pid] -+ --with-pidfile=PATH Specify default pidfile [/var/run/chrony/chronyd.pid] - --with-rtcdevice=PATH Specify default path to RTC device [/dev/rtc] - --with-sendmail=PATH Path to sendmail binary [/usr/lib/sendmail] - --enable-debug Enable debugging support -@@ -229,7 +229,7 @@ feat_ntp_signd=0 - ntp_era_split="" - default_user="root" - default_hwclockfile="" --default_pidfile="/var/run/chronyd.pid" -+default_pidfile="/var/run/chrony/chronyd.pid" - default_rtcdevice="/dev/rtc" - mail_program="/usr/lib/sendmail" - - -commit 10150bfcab76141b3a9c33b95ad71904fe8ecca2 -Author: Miroslav Lichvar -Date: Thu Jun 7 17:43:57 2018 +0200 - - examples: update pidfile in chronyd.service - -diff --git a/examples/chronyd.service b/examples/chronyd.service -index 4ffe3b1..1777413 100644 ---- a/examples/chronyd.service -+++ b/examples/chronyd.service -@@ -7,7 +7,7 @@ ConditionCapability=CAP_SYS_TIME - - [Service] - Type=forking --PIDFile=/var/run/chronyd.pid -+PIDFile=/var/run/chrony/chronyd.pid - EnvironmentFile=-/etc/sysconfig/chronyd - ExecStart=/usr/sbin/chronyd $OPTIONS - PrivateTmp=yes diff --git a/chrony.spec b/chrony.spec index e9914d6..803c9bf 100644 --- a/chrony.spec +++ b/chrony.spec @@ -1,9 +1,10 @@ %global _hardened_build 1 -%global clknetsim_ver 5b4d14 +%global prerelease -pre1 +%global clknetsim_ver 774308 %bcond_without debug Name: chrony -Version: 3.3 +Version: 3.4 Release: 5%{?dist} Summary: An NTP client/server @@ -19,12 +20,8 @@ Source4: chrony-dnssrv@.timer Source10: https://github.com/mlichvar/clknetsim/archive/%{clknetsim_ver}/clknetsim-%{clknetsim_ver}.tar.gz %{?gitpatch:Patch0: chrony-%{version}%{?prerelease}-%{gitpatch}.patch.gz} -# move pidfile to /var/run/chrony to allow chronyd to remove it on exit -Patch1: chrony-pidfile.patch # add NTP servers from DHCP when starting service Patch2: chrony-service-helper.patch -# avoid blocking in getrandom system call -Patch3: chrony-getrandom.patch BuildRequires: libcap-devel libedit-devel nettle-devel pps-tools-devel %ifarch %{ix86} x86_64 %{arm} aarch64 mipsel mips64el ppc64 ppc64le s390 s390x @@ -55,9 +52,7 @@ service to other computers in the network. %prep %setup -q -n %{name}-%{version}%{?prerelease} -a 10 %{?gitpatch:%patch0 -p1} -%patch1 -p1 -b .pidfile %patch2 -p1 -b .service-helper -%patch3 -p1 -b .getrandom %{?gitpatch: echo %{version}-%{gitpatch} > version.txt} @@ -67,7 +62,7 @@ md5sum -c <<-EOF | (! grep -v 'OK$') e473a9fab7fe200cacce3dca8b66290b examples/chrony.conf.example2 ba6bb05c50e03f6b5ab54a2b7914800d examples/chrony.keys.example 6a3178c4670de7de393d9365e2793740 examples/chrony.logrotate - 63e0781f84e89ba6029d93ef0722c4ce examples/chrony.nm-dispatcher + 8748a663f0b1943ea491858f414a6b26 examples/chrony.nm-dispatcher 921b354e94f5e3db124cb50d11cd560f examples/chronyd.service EOF diff --git a/sources b/sources index ac6ced9..4e89cb6 100644 --- a/sources +++ b/sources @@ -1,2 +1,2 @@ -SHA512 (chrony-3.3.tar.gz) = 36975d863599141e8e5b071d35cf67326b27f5b0da7ec942dbb4530377d10472b0729eea632e0702718b515cb2d5fd41a7eba158e6dade7f05adfb1bdffa5df0 -SHA512 (clknetsim-5b4d14.tar.gz) = 6fc12fec423af00bb7329ee903e49021d38285e891cdb855e2c48ebf335d4142cc742acce85f37a51f97ed33643ff54d9da9a1adf6365b8e5a719a409334020c +SHA512 (chrony-3.4-pre1.tar.gz) = b45c2f94060ee4f5917d49420a726c412231cb8c3fdc4475465daee6d24d809ae6cb146332e88c975d58f969de357d1b9e2fb3a1c66e35f988f6c8828b39f9a3 +SHA512 (clknetsim-774308.tar.gz) = 303c9d270e62f3de80a02da387b3df4188dabac738f249ac25096e202cbb2991e23c116713dfce5c3f4c17c1925af9796b0828de74b501fef1cc01b098e2c5c5