[master][PATCH] Use ntpdate instead of rdate (#950267)
Vratislav Podzimek
vpodzime at redhat.com
Thu May 9 12:20:57 UTC 2013
The rdate utility uses the old protocol that is not supported by many NTP
servers.
Signed-off-by: Vratislav Podzimek <vpodzime at redhat.com>
---
anaconda.spec.in | 2 +-
pyanaconda/ntp.py | 6 +++---
2 files changed, 4 insertions(+), 4 deletions(-)
diff --git a/anaconda.spec.in b/anaconda.spec.in
index af7452c..381dc4e 100644
--- a/anaconda.spec.in
+++ b/anaconda.spec.in
@@ -115,7 +115,7 @@ Requires: anaconda-yum-plugins
Requires: libselinux-python >= %{libselinuxver}
Requires: kbd
Requires: chrony
-Requires: rdate
+Requires: ntpdate
Requires: rsync
Requires: hostname
%ifnarch s390 s390x
diff --git a/pyanaconda/ntp.py b/pyanaconda/ntp.py
index 61e9a6a..0014a9d 100644
--- a/pyanaconda/ntp.py
+++ b/pyanaconda/ntp.py
@@ -44,7 +44,7 @@ class NTPconfigError(Exception):
def ntp_server_working(server):
"""
- Runs rdate to try to connect to the $server (timeout may take some time).
+ Runs ntpdate to try to connect to the $server (timeout may take some time).
:return: True if the given server is reachable and working, False otherwise
@@ -54,7 +54,7 @@ def ntp_server_working(server):
# thread-safe and hangs if this function is called from threads.
# By using tee (and block-buffered pipes) it is also much slower.
#we just need to know the exit status
- retc = os.system("rdate -p %s &>/dev/null" % server)
+ retc = os.system("ntpdate -q %s &>/dev/null" % server)
return retc == 0
@@ -164,7 +164,7 @@ def one_time_sync(server, callback=None):
"""
- ret = iutil.execWithRedirect("rdate", ["-s", server])
+ ret = iutil.execWithRedirect("ntpdate", [server])
success = ret == 0
--
1.7.11.7
More information about the anaconda-patches
mailing list