diff options
author | Jan Cholasta <jcholast@redhat.com> | 2014-01-24 10:16:48 +0100 |
---|---|---|
committer | Martin Kosek <mkosek@redhat.com> | 2014-01-24 13:01:40 +0100 |
commit | a744b5e53beed526335baf6d19e3881b966e743a (patch) | |
tree | a4e2903814bc80ad6b80cb34c1ac0ad532941f32 | |
parent | 17d6f27da33b99fb312d5bfdcf0a014caf093a1d (diff) | |
download | freeipa-a744b5e53beed526335baf6d19e3881b966e743a.tar.gz freeipa-a744b5e53beed526335baf6d19e3881b966e743a.tar.xz freeipa-a744b5e53beed526335baf6d19e3881b966e743a.zip |
Fix ntpd config on clients.
https://fedorahosted.org/freeipa/ticket/4094
-rw-r--r-- | freeipa.spec.in | 10 | ||||
-rw-r--r-- | ipa-client/ipaclient/ntpconf.py | 2 |
2 files changed, 11 insertions, 1 deletions
diff --git a/freeipa.spec.in b/freeipa.spec.in index 1d2a83aef..138390ed7 100644 --- a/freeipa.spec.in +++ b/freeipa.spec.in @@ -549,6 +549,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 eb9afdeee..f0e5ebbde 100644 --- a/ipa-client/ipaclient/ntpconf.py +++ b/ipa-client/ipaclient/ntpconf.py @@ -74,7 +74,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 |