From c1673f730b485f2a2aed1dcff03251ff0896e410 Mon Sep 17 00:00:00 2001 From: Victor Hu Date: Mon, 12 Dec 2016 15:43:17 -0500 Subject: [PATCH 1/3] Since the genesis kernel is not intended to be long running, there's no need to start ntp daemon, simply attempt to sync with ntpdate. There's an issue in this code where we query ntpq for the offset too quickly after starting the ntp daemon. This causes the offset to always be 0 and we continue. We have seen situations where ntpd starts before the first check and becomes > 1000. Then it takes 15 minutes before the 2nd attempt and delays the hardware discovery process --- xCAT-genesis-scripts/bin/doxcat | 12 ++---------- 1 file changed, 2 insertions(+), 10 deletions(-) diff --git a/xCAT-genesis-scripts/bin/doxcat b/xCAT-genesis-scripts/bin/doxcat index 6a637fb91f..f57234a493 100755 --- a/xCAT-genesis-scripts/bin/doxcat +++ b/xCAT-genesis-scripts/bin/doxcat @@ -260,11 +260,10 @@ fi openssl genrsa -out /etc/xcat/certkey.pem 4096 > /dev/null 2>&1 & logger -s -t $log_label -p local4.info "Acquired IPv4 address on $bootnic" - ip addr show dev $bootnic|grep -v 'scope link'|grep -v 'dynamic'|grep -v inet6|grep inet|awk '{print $2}' -logger -s -t $log_label -p local4.info "Starting ntpd..." -ntpd -g -x +logger -s -t $log_label -p local4.info "Attempting to sync the date with $XCATMASTER..." +ntpdate $XCATMASTER if [ -e "/dev/rtc" ]; then logger -s -t $log_label -p local4.info "Attempting to sync hardware clock..." @@ -272,13 +271,6 @@ if [ -e "/dev/rtc" ]; then disown fi -# rv 0 state does not work with the new ntp versions -logger -s -t $log_label -p local4.info "Checking ntpq for the offset values..." -while [ "`ntpq -c 'rv 0 offset' | awk -F '=' '/offset=/ { print $2 }' | awk -F '.' '{ print $1 }' | sed s/-//`" -ge 1000 ]; do - sleep 1 -done -logger -s -t $log_label -p local4.info "Checking ntpq for the offset values... Done" - logger -s -t $log_label -p local4.info "Restarting syslog..." read -r RSYSLOG_PID /dev/null kill "$RSYSLOG_PID" 2>/dev/null From 23179aeaa90dd32ac06eab85f1f8ec1a724decc4 Mon Sep 17 00:00:00 2001 From: Victor Hu Date: Tue, 13 Dec 2016 13:21:03 -0500 Subject: [PATCH 2/3] Adding ntpdate to the list of commands to put into xCAT-genesis-base --- xCAT-genesis-builder/install | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/xCAT-genesis-builder/install b/xCAT-genesis-builder/install index 67e6950fa8..137d7f008d 100755 --- a/xCAT-genesis-builder/install +++ b/xCAT-genesis-builder/install @@ -9,7 +9,7 @@ dracut_install efibootmgr #dracut_install libvirtd /usr/share/libvirt/cpu_map.xml /usr/bin/qemu-img /usr/libexec/qemu-kvm dracut_install mkswap df brctl vconfig ifenslave ssh-keygen scp clear dhclient lldpad dracut_install lldptool /lib64/libnss_dns-2.12.so /lib64/libnss_dns.so.2 -dracut_install poweroff ntpq ntpd hwclock date /usr/share/terminfo/x/xterm /usr/share/terminfo/s/screen /etc/nsswitch.conf /etc/services +dracut_install poweroff ntpq ntpd ntpdate hwclock date /usr/share/terminfo/x/xterm /usr/share/terminfo/s/screen /etc/nsswitch.conf /etc/services dracut_install /sbin/rsyslogd /etc/protocols umount /bin/rpm /usr/lib/rpm/rpmrc dracut_install chmod /lib/libc.so.6 /lib/ld-linux.so.2 /lib/libdl.so.2 /lib/libm.so.6 /sbin/route /sbin/ifconfig /usr/bin/whoami /usr/bin/head /usr/bin/tail basename /etc/redhat-release ping tr lsusb /usr/share/hwdata/usb.ids #ibm fw wrapper requirements dracut_install dmidecode /usr/lib64/libstdc++.so.6 #uxspi prereqs, but will use dmidecode to improve decision on loading ipmi_si From 482f6b7fc2f40a592b746b39883e6914c27f2f05 Mon Sep 17 00:00:00 2001 From: Victor Hu Date: Tue, 13 Dec 2016 13:42:07 -0500 Subject: [PATCH 3/3] Use the -b option to force the time change --- xCAT-genesis-scripts/bin/doxcat | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/xCAT-genesis-scripts/bin/doxcat b/xCAT-genesis-scripts/bin/doxcat index f57234a493..12d4e31917 100755 --- a/xCAT-genesis-scripts/bin/doxcat +++ b/xCAT-genesis-scripts/bin/doxcat @@ -263,7 +263,7 @@ logger -s -t $log_label -p local4.info "Acquired IPv4 address on $bootnic" ip addr show dev $bootnic|grep -v 'scope link'|grep -v 'dynamic'|grep -v inet6|grep inet|awk '{print $2}' logger -s -t $log_label -p local4.info "Attempting to sync the date with $XCATMASTER..." -ntpdate $XCATMASTER +ntpdate -b $XCATMASTER if [ -e "/dev/rtc" ]; then logger -s -t $log_label -p local4.info "Attempting to sync hardware clock..."