summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorJan Cholasta <jcholast@redhat.com>2014-01-24 10:16:48 +0100
committerMartin Kosek <mkosek@redhat.com>2014-01-24 13:01:32 +0100
commit923e9d8bedb6f564ef0969c8a7e8c4024a1280a8 (patch)
treee685881c9289549763ad80460fdb49de693aaba9
parent2bb2aa8c484285648e6f422a00006f0f00a352ef (diff)
downloadfreeipa-923e9d8bedb6f564ef0969c8a7e8c4024a1280a8.zip
freeipa-923e9d8bedb6f564ef0969c8a7e8c4024a1280a8.tar.gz
freeipa-923e9d8bedb6f564ef0969c8a7e8c4024a1280a8.tar.xz
Fix ntpd config on clients.
https://fedorahosted.org/freeipa/ticket/4094
-rw-r--r--freeipa.spec.in10
-rw-r--r--ipa-client/ipaclient/ntpconf.py2
2 files changed, 11 insertions, 1 deletions
diff --git a/freeipa.spec.in b/freeipa.spec.in
index 03e5361..3b0ecef 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
diff --git a/ipa-client/ipaclient/ntpconf.py b/ipa-client/ipaclient/ntpconf.py
index 714d4fb..4304c3c 100644
--- a/ipa-client/ipaclient/ntpconf.py
+++ b/ipa-client/ipaclient/ntpconf.py
@@ -73,7 +73,7 @@ keys /etc/ntp/keys
"""
ntp_sysconfig = """# Drop root to id 'ntp:ntp' by default.
-OPTIONS="-x -u ntp:ntp -p /var/run/ntpd.pid"
+OPTIONS="-x -p /var/run/ntpd.pid"
# Set to 'yes' to sync hw clock after successful ntpdate
SYNC_HWCLOCK=yes