Fix ntpd config on clients.

https://fedorahosted.org/freeipa/ticket/4094
This commit is contained in:
Jan Cholasta
2014-01-24 10:16:48 +01:00
committed by Martin Kosek
parent 2bb2aa8c48
commit 923e9d8bed
2 changed files with 11 additions and 1 deletions

View File

@@ -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

View File

@@ -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