diff --git a/xCAT/postscripts/setupntp b/xCAT/postscripts/setupntp index 6d442cdcf..7748f2805 100755 --- a/xCAT/postscripts/setupntp +++ b/xCAT/postscripts/setupntp @@ -1,25 +1,21 @@ -#!/bin/ksh +#!/bin/sh # IBM(c) 2007 EPL license http://www.eclipse.org/legal/epl-v10.html -#egan@us.ibm.com -#(C)IBM Corp # - -. $XCATROOT/lib/functions - -if TIMESERVERS=$(tabdb $SITETAB timeservers 1) -then - : -else - echo "$0: timeservers not defined in $SITETAB" | logger -t xcat - exit +#--------------------------------------------------------------------------- +# setup NTP configuration on the compute nodes +# +#--------------------------------------------------------------------------- +master=$MASTER +conf_file="/etc/ntp.conf" +conf_file_backup="/etc/ntp.conf.postbackup" +# if backup does not exist, backup +if [ ! -f $conf_file_backup ]; then + mv -f $conf_file $conf_file_backup fi logger -t xcat "Install: Setup NTP" -for i in $(echo $TIMESERVERS | tr ',' ' ') -do - echo "server $i.$DOMAIN" -done >/etc/ntp.conf +echo "server $master" >$conf_file mkdir -p /etc/ntp chown ntp /etc/ntp @@ -31,10 +27,6 @@ authenticate no keys /etc/ntp/keys trustedkey 65535 requestkey 65535 -controlkey 65535" >>/etc/ntp.conf +controlkey 65535" >>$conf_file -for i in $(echo $TIMESERVERS | tr ',' ' ') -do - echo "$i.$DOMAIN" -done >/etc/ntp/step-tickers