From: Frank Brehm Date: Wed, 28 Mar 2018 14:17:47 +0000 (+0200) Subject: Implementing install_ntp in bin/postinst X-Git-Tag: 0.1.1~75 X-Git-Url: https://git.uhu-banane.org/?a=commitdiff_plain;h=d1f8de9cb31a64b7ac864471ec0eb3aed25d9795;p=pixelpark%2Fcreate-vmware-tpl.git Implementing install_ntp in bin/postinst --- diff --git a/bin/postinst b/bin/postinst index 3b39fcc..fb39e04 100644 --- a/bin/postinst +++ b/bin/postinst @@ -363,7 +363,7 @@ misc_packages() { echo log "Removing iptables-services ..." - yum remove -y install iptables-services + yum remove -y iptables-services echo "Stopping and disabling firewalld ..." systemctl stop firewalld systemctl disable firewalld @@ -415,6 +415,50 @@ install_legato_networker() { } +#----------------------------------------------------------- +install_ntp() { + + echo + log "Deinstalling chrony from whatever reason ..." + echo "Stopping chronyd ..." + systemctl stop chronyd + echo "Disabling chronyd ..." + systemctl disable chronyd + echo "Deinstalling chrony ..." + yum remove -y chrony + + echo + log "Installing NTP ..." + yum install -y ntp + + echo "Cofiguring ntpd ..." + mkdir -pv /etc/ntp + + cat <<-EOF > /etc/ntp.conf + tinker panic 0 + driftfile /var/lib/ntp/drift + # Permit time synchronization with our time source, but do not + # permit the source to query or modify the service on this system. + restrict default kod nomodify notrap nopeer noquery + restrict -6 default kod nomodify notrap nopeer noquery + restrict 127.0.0.1 + restrict -6 ::1 + server time01.pixelpark.com iburst + server time02.pixelpark.com iburst + server time03.pixelpark.com iburst + + EOF + + cat <<-EOF > /etc/ntp/step-tickers + time01.pixelpark.com + time02.pixelpark.com + time03.pixelpark.com + EOF + + systemctl enable ntpd + +} + #----------------------------------------------------------- main() { @@ -432,6 +476,7 @@ main() { misc_packages create_motd install_legato_networker + install_ntp tweak_grub