From 923e9d8bedb6f564ef0969c8a7e8c4024a1280a8 Mon Sep 17 00:00:00 2001 From: Jan Cholasta Date: Fri, 24 Jan 2014 10:16:48 +0100 Subject: Fix ntpd config on clients. https://fedorahosted.org/freeipa/ticket/4094 --- freeipa.spec.in | 10 ++++++++++ 1 file changed, 10 insertions(+) (limited to 'freeipa.spec.in') diff --git a/freeipa.spec.in b/freeipa.spec.in index 03e53611..3b0ecefd 100644 --- a/freeipa.spec.in +++ b/freeipa.spec.in @@ -562,6 +562,16 @@ if [ $1 -gt 1 ] ; then /sbin/restorecon /etc/krb5.conf fi fi + + if [ -f '/etc/sysconfig/ntpd' -a $restore -ge 2 ]; then + if grep -E -q 'OPTIONS=.*-u ntp:ntp' /etc/sysconfig/ntpd 2>/dev/null; then + sed -r '/OPTIONS=/ { s/\s+-u ntp:ntp\s+/ /; s/\s*-u ntp:ntp\s*// }' /etc/sysconfig/ntpd >/etc/sysconfig/ntpd.ipanew + mv /etc/sysconfig/ntpd.ipanew /etc/sysconfig/ntpd + /sbin/restorecon /etc/sysconfig/ntpd + + /bin/systemctl condrestart ntpd.service 2>&1 || : + fi + fi fi %triggerin -n freeipa-client -- openssh-server -- cgit