From 13bca11a9d6c4bb7e98c12f68eb2d56aafa15d8d Mon Sep 17 00:00:00 2001 From: Yuan Bai Date: Wed, 7 Nov 2018 16:47:46 +0800 Subject: [PATCH] add sys log for redhat statelite (#5771) * add sys log for redhat statelite --- .../xcat/netboot/rh/dracut/xcat-premount.sh | 10 +++- .../netboot/rh/dracut_033/xcat-premount.sh | 8 ++- .../netboot/rh/dracut_033/xcat-prepivot.sh | 50 +++++++++++++----- .../share/xcat/netboot/rh/dracut_033/xcatroot | 22 +++++--- .../netboot/rh/dracut_047/xcat-premount.sh | 11 ++-- .../netboot/rh/dracut_047/xcat-prepivot.sh | 51 ++++++++++++++----- .../share/xcat/netboot/rh/dracut_047/xcatroot | 22 +++++--- .../netboot/sles/dracut_033/xcat-premount.sh | 10 +++- xCAT/postscripts/xcatdsklspost | 13 +++-- xCAT/postscripts/xcatpostinit1.netboot | 2 +- 10 files changed, 147 insertions(+), 52 deletions(-) diff --git a/xCAT-server/share/xcat/netboot/rh/dracut/xcat-premount.sh b/xCAT-server/share/xcat/netboot/rh/dracut/xcat-premount.sh index 40c1dbbe5..9f320bb66 100644 --- a/xCAT-server/share/xcat/netboot/rh/dracut/xcat-premount.sh +++ b/xCAT-server/share/xcat/netboot/rh/dracut/xcat-premount.sh @@ -1,6 +1,8 @@ #!/bin/sh #script to update nodelist.nodestatus during provision +XCAT="$(getarg XCAT=)" +STATEMNT="$(getarg STATEMNT=)" MASTER=`echo $XCAT |awk -F: '{print $1}'` getarg nonodestatus @@ -11,8 +13,12 @@ if [ $? -ne 0 ]; then XCATIPORT="3002" fi - - +log_label="xcat.deployment" +[ "$xcatdebugmode" = "1" -o "$xcatdebugmode" = "2" ] && SYSLOGHOST="" || SYSLOGHOST="-n $MASTER" +logger $SYSLOGHOST -t $log_label -p local4.info "=============deployment starting====================" +logger $SYSLOGHOST -t $log_label -p local4.info "Starting xcat-premount..." +[ "$xcatdebugmode" > "0" ] && logger $SYSLOGHOST -t $log_label -p local4.debug "MASTER=$MASTER XCATIPORT=$XCATIPORT NODESTATUS=$NODESTATUS" if [ $NODESTATUS -ne 0 ];then + logger $SYSLOGHOST -t $log_label -p local4.info "Sending request to $MASTER:$XCATIPORT for changing status to netbooting..." /tmp/updateflag $MASTER $XCATIPORT "installstatus netbooting" fi diff --git a/xCAT-server/share/xcat/netboot/rh/dracut_033/xcat-premount.sh b/xCAT-server/share/xcat/netboot/rh/dracut_033/xcat-premount.sh index 394009dac..9f320bb66 100644 --- a/xCAT-server/share/xcat/netboot/rh/dracut_033/xcat-premount.sh +++ b/xCAT-server/share/xcat/netboot/rh/dracut_033/xcat-premount.sh @@ -13,8 +13,12 @@ if [ $? -ne 0 ]; then XCATIPORT="3002" fi - - +log_label="xcat.deployment" +[ "$xcatdebugmode" = "1" -o "$xcatdebugmode" = "2" ] && SYSLOGHOST="" || SYSLOGHOST="-n $MASTER" +logger $SYSLOGHOST -t $log_label -p local4.info "=============deployment starting====================" +logger $SYSLOGHOST -t $log_label -p local4.info "Starting xcat-premount..." +[ "$xcatdebugmode" > "0" ] && logger $SYSLOGHOST -t $log_label -p local4.debug "MASTER=$MASTER XCATIPORT=$XCATIPORT NODESTATUS=$NODESTATUS" if [ $NODESTATUS -ne 0 ];then + logger $SYSLOGHOST -t $log_label -p local4.info "Sending request to $MASTER:$XCATIPORT for changing status to netbooting..." /tmp/updateflag $MASTER $XCATIPORT "installstatus netbooting" fi diff --git a/xCAT-server/share/xcat/netboot/rh/dracut_033/xcat-prepivot.sh b/xCAT-server/share/xcat/netboot/rh/dracut_033/xcat-prepivot.sh index d8c232831..4bbdffa0f 100755 --- a/xCAT-server/share/xcat/netboot/rh/dracut_033/xcat-prepivot.sh +++ b/xCAT-server/share/xcat/netboot/rh/dracut_033/xcat-prepivot.sh @@ -1,9 +1,13 @@ #!/bin/sh +log_label="xcat.deployment" NEWROOT=/sysroot SERVER=${SERVER%%/*} SERVER=${SERVER%:} RWDIR=.statelite XCAT="$(getarg XCAT=)" +xcatdebugmode="$(getarg xcatdebugmode=)" +XCATMASTER=$XCAT +MASTER=`echo $XCATMASTER |awk -F: '{print $1}'` STATEMNT="$(getarg STATEMNT=)" if [ ! -z $STATEMNT ]; then #btw, uri style might have left future options other than nfs open, will u se // to detect uri in the future I guess SNAPSHOTSERVER=${STATEMNT%:*} @@ -17,6 +21,9 @@ if [ ! -z $STATEMNT ]; then #btw, uri style might have left future options other fi fi + +[ "$xcatdebugmode" = "1" -o "$xcatdebugmode" = "2" ] && SYSLOGHOST="" || SYSLOGHOST="-n $MASTER" +logger $SYSLOGHOST -t $log_label -p local4.info "Executing xcat-prepivot to set up statelite..." echo Setting up Statelite mkdir -p $NEWROOT @@ -27,14 +34,18 @@ MAXTRIES=7 ITER=0 if [ ! -e "$NEWROOT/$RWDIR" ]; then echo "" - echo "This NFS root directory doesn't have a /$RWDIR directory for me to mount a rw filesystem. You'd better create it... " + msg="This NFS root directory doesn't have a /$RWDIR directory for me to mount a rw filesystem. You'd better create it... " + echo "$msg" echo "" + logger $SYSLOGHOST -t $log_label -p local4.error "$msg" /bin/sh fi if [ ! -e "$NEWROOT/etc/init.d/statelite" ]; then echo "" - echo "$NEWROOT/etc/init.d/statelite doesn't exist. Perhaps you didn't create this image with th e -m statelite mode" + msg="$NEWROOT/etc/init.d/statelite doesn't exist. Perhaps you didn't create this image with the -m statelite mode" + echo "$msg" + logger $SYSLOGHOST -t $log_label -p local4.error "$msg" echo "" /bin/sh fi @@ -59,15 +70,19 @@ if [ ! -z $SNAPSHOTSERVER ]; then while ! mount $SNAPSHOTSERVER:/$SNAPSHOTROOT $NEWROOT/$RWDIR/persistent -o $MNT_OPTIONS; do ITER=$(( ITER + 1 )) if [ "$ITER" == "$MAXTRIES" ]; then - echo "Your are dead, rpower $ME boot to play again." - echo "Possible problems: + msg="Your are dead, rpower $ME boot to play again. + Possible problems: 1. $SNAPSHOTSERVER is not exporting $SNAPSHOTROOT ? 2. Is DNS set up? Maybe that's why I can't mount $SNAPSHOTSERVER." + echo "$msg" + logger $SYSLOGHOST -t $log_label -p local4.error "$msg" /bin/sh exit fi RS=$(( $RANDOM % 20 )) - echo "Trying again in $RS seconds..." + msg="Trying again in $RS seconds..." + echo "$msg" + logger $SYSLOGHOST -t $log_label -p local4.info "$msg" sleep $RS done @@ -78,13 +93,17 @@ if [ ! -z $SNAPSHOTSERVER ]; then while ! umount -l $NEWROOT/$RWDIR/persistent; do ITER=$(( ITER + 1 )) if [ "$ITER" == "$MAXTRIES" ]; then - echo "Your are dead, rpower $ME boot to play again." - echo "Cannot umount $NEWROOT/$RWDIR/persistent." + msg="Your are dead, rpower $ME boot to play again. + Cannot umount $NEWROOT/$RWDIR/persistent." + echo "$msg" + logger $SYSLOGHOST -t $log_label -p local4.error "$msg" /bin/sh exit fi RS=$(( $RANDOM % 20 )) - echo "Trying again in $RS seconds..." + msg="Trying again in $RS seconds..." + echo "$msg" + logger $SYSLOGHOST -t $log_label -p local4.info "$msg" sleep $RS done @@ -93,20 +112,26 @@ if [ ! -z $SNAPSHOTSERVER ]; then while ! mount $SNAPSHOTSERVER:/$SNAPSHOTROOT/$ME $NEWROOT/$RWDIR/persistent -o $MNT_OPTIONS; do ITER=$(( ITER + 1 )) if [ "$ITER" == "$MAXTRIES" ]; then - echo "Your are dead, rpower $ME boot to play again." - echo "Possible problems: cannot mount to $SNAPSHOTSERVER:/$SNAPSHOTROOT/$ME." + msg="Your are dead, rpower $ME boot to play again. + Possible problems: cannot mount to $SNAPSHOTSERVER:/$SNAPSHOTROOT/$ME." + echo $msg + logger $SYSLOGHOST -t $log_label -p local4.info "$msg" /bin/sh exit fi RS=$(( $RANDOM % 20 )) - echo "Trying again in $RS seconds..." + msg="Trying again in $RS seconds..." + echo "$msg" + logger $SYSLOGHOST -t $log_label -p local4.info "$msg" sleep $RS done fi # TODO: handle the dhclient/resolv.conf/ntp, etc -echo "Get to enable localdisk" +logger $SYSLOGHOST -t $log_label -p local4.info "Enabling localdisk ..." +echo "Enable localdisk ..." $NEWROOT/etc/init.d/localdisk +logger $SYSLOGHOST -t $log_label -p local4.info "Preparing mount points ..." $NEWROOT/etc/init.d/statelite READONLY=yes export READONLY @@ -174,3 +199,4 @@ fi echo 'settle_exit_if_exists="--exit-if-exists=/dev/root"; rm "$job"' > $hookdir/initqueue/xcat.sh # force udevsettle to break > $hookdir/initqueue/work +logger $SYSLOGHOST -t $log_label -p local4.info "Exit xcat-prepivot" diff --git a/xCAT-server/share/xcat/netboot/rh/dracut_033/xcatroot b/xCAT-server/share/xcat/netboot/rh/dracut_033/xcatroot index 1bab4cf52..1531756fd 100755 --- a/xCAT-server/share/xcat/netboot/rh/dracut_033/xcatroot +++ b/xCAT-server/share/xcat/netboot/rh/dracut_033/xcatroot @@ -168,6 +168,7 @@ elif [ -r /rootimg-statelite.gz ]; then echo "" echo "The /$RWDIR directory doesn't exist in the rootimg... " echo "" + logger $SYSLOGHOST -t $log_label -p local4.err "The /$RWDIR directory doesn't exist in the rootimg..." /bin/sh fi @@ -175,6 +176,7 @@ elif [ -r /rootimg-statelite.gz ]; then echo "" echo "$NEWROOT/etc/init.d/statelite doesn't exist... " echo "" + logger $SYSLOGHOST -t $log_label -p local4.err "$NEWROOT/etc/init.d/statelite doesn't exist... " /bin/sh fi @@ -208,10 +210,12 @@ elif [ -r /rootimg-statelite.gz ]; then while ! mount $SNAPSHOTSERVER:/$SNAPSHOTROOT $NEWROOT/$RWDIR/persistent -o $MNT_OPTIONS; do ITER=$(( ITER + 1 )) if [ "$ITER" == "$MAXTRIES" ]; then - echo "You are dead, rpower $ME boot to play again." - echo "Possible problems: + msg="You are dead, rpower $ME boot to play again. + Possible problems: 1. $SNAPSHOTSERVER is not exporting $SNAPSHOTROOT ? 2. Is DNS set up? Maybe that's why I can't mount $SNAPSHOTSERVER." + echo "$msg" + logger $SYSLOGHOST -t $log_label -p local4.err "$msg" /bin/sh exit fi @@ -227,8 +231,10 @@ elif [ -r /rootimg-statelite.gz ]; then while ! umount -l $NEWROOT/$RWDIR/persistent; do ITER=$(( ITER + 1 )) if [ "$ITER" == "$MAXTRIES" ]; then - echo "Your are dead, rpower $ME boot to play again." - echo "Cannot umount $NEWROOT/$RWDIR/persistent." + msg="Your are dead, rpower $ME boot to play again. + Cannot umount $NEWROOT/$RWDIR/persistent." + echo "$msg" + logger $SYSLOGHOST -t $log_label -p local4.err "$msg" /bin/sh exit fi @@ -242,8 +248,10 @@ elif [ -r /rootimg-statelite.gz ]; then while ! mount $SNAPSHOTSERVER:/$SNAPSHOTROOT/$ME $NEWROOT/$RWDIR/persistent -o $MNT_OPTIONS; do ITER=$(( ITER + 1 )) if [ "$ITER" == "$MAXTRIES" ]; then - echo "Your are dead, rpower $ME boot to play again." - echo "Possible problems: cannot mount to $SNAPSHOTSERVER:/$SNAPSHOTROOT/$ME." + msg="Your are dead, rpower $ME boot to play again. + Possible problems: cannot mount to $SNAPSHOTSERVER:/$SNAPSHOTROOT/$ME." + echo "$msg" + logger $SYSLOGHOST -t $log_label -p local4.err "$msg" /bin/sh exit fi @@ -253,7 +261,9 @@ elif [ -r /rootimg-statelite.gz ]; then done fi + logger $SYSLOGHOST -t $log_label -p local4.info "Enabling localdisk ..." $NEWROOT/etc/init.d/localdisk + logger $SYSLOGHOST -t $log_label -p local4.info "Preparing mount points ..." $NEWROOT/etc/init.d/statelite fastboot=yes export fastboot diff --git a/xCAT-server/share/xcat/netboot/rh/dracut_047/xcat-premount.sh b/xCAT-server/share/xcat/netboot/rh/dracut_047/xcat-premount.sh index 6c67fb267..9f320bb66 100644 --- a/xCAT-server/share/xcat/netboot/rh/dracut_047/xcat-premount.sh +++ b/xCAT-server/share/xcat/netboot/rh/dracut_047/xcat-premount.sh @@ -1,5 +1,4 @@ -#!/bin/bash -set -x +#!/bin/sh #script to update nodelist.nodestatus during provision XCAT="$(getarg XCAT=)" @@ -14,8 +13,12 @@ if [ $? -ne 0 ]; then XCATIPORT="3002" fi - - +log_label="xcat.deployment" +[ "$xcatdebugmode" = "1" -o "$xcatdebugmode" = "2" ] && SYSLOGHOST="" || SYSLOGHOST="-n $MASTER" +logger $SYSLOGHOST -t $log_label -p local4.info "=============deployment starting====================" +logger $SYSLOGHOST -t $log_label -p local4.info "Starting xcat-premount..." +[ "$xcatdebugmode" > "0" ] && logger $SYSLOGHOST -t $log_label -p local4.debug "MASTER=$MASTER XCATIPORT=$XCATIPORT NODESTATUS=$NODESTATUS" if [ $NODESTATUS -ne 0 ];then + logger $SYSLOGHOST -t $log_label -p local4.info "Sending request to $MASTER:$XCATIPORT for changing status to netbooting..." /tmp/updateflag $MASTER $XCATIPORT "installstatus netbooting" fi diff --git a/xCAT-server/share/xcat/netboot/rh/dracut_047/xcat-prepivot.sh b/xCAT-server/share/xcat/netboot/rh/dracut_047/xcat-prepivot.sh index c09dfe486..a3bcb8188 100755 --- a/xCAT-server/share/xcat/netboot/rh/dracut_047/xcat-prepivot.sh +++ b/xCAT-server/share/xcat/netboot/rh/dracut_047/xcat-prepivot.sh @@ -1,10 +1,13 @@ #!/bin/bash -set -x +log_label="xcat.deployment" NEWROOT=/sysroot SERVER=${SERVER%%/*} SERVER=${SERVER%:} RWDIR=.statelite XCAT="$(getarg XCAT=)" +xcatdebugmode="$(getarg xcatdebugmode=)" +XCATMASTER=$XCAT +MASTER=`echo $XCATMASTER |awk -F: '{print $1}'` STATEMNT="$(getarg STATEMNT=)" if [ ! -z $STATEMNT ]; then #btw, uri style might have left future options other than nfs open, will u se // to detect uri in the future I guess SNAPSHOTSERVER=${STATEMNT%:*} @@ -18,6 +21,9 @@ if [ ! -z $STATEMNT ]; then #btw, uri style might have left future options other fi fi + +[ "$xcatdebugmode" = "1" -o "$xcatdebugmode" = "2" ] && SYSLOGHOST="" || SYSLOGHOST="-n $MASTER" +logger $SYSLOGHOST -t $log_label -p local4.info "Executing xcat-prepivot to set up statelite..." echo Setting up Statelite mkdir -p $NEWROOT @@ -28,14 +34,18 @@ MAXTRIES=7 ITER=0 if [ ! -e "$NEWROOT/$RWDIR" ]; then echo "" - echo "This NFS root directory doesn't have a /$RWDIR directory for me to mount a rw filesystem. You'd better create it... " + msg="This NFS root directory doesn't have a /$RWDIR directory for me to mount a rw filesystem. You'd better create it... " + echo "$msg" echo "" + logger $SYSLOGHOST -t $log_label -p local4.error "$msg" /bin/sh fi if [ ! -e "$NEWROOT/etc/init.d/statelite" ]; then echo "" - echo "$NEWROOT/etc/init.d/statelite doesn't exist. Perhaps you didn't create this image with th e -m statelite mode" + msg="$NEWROOT/etc/init.d/statelite doesn't exist. Perhaps you didn't create this image with the -m statelite mode" + echo "$msg" + logger $SYSLOGHOST -t $log_label -p local4.error "$msg" echo "" /bin/sh fi @@ -60,15 +70,19 @@ if [ ! -z $SNAPSHOTSERVER ]; then while ! mount $SNAPSHOTSERVER:/$SNAPSHOTROOT $NEWROOT/$RWDIR/persistent -o $MNT_OPTIONS; do ITER=$(( ITER + 1 )) if [ "$ITER" == "$MAXTRIES" ]; then - echo "Your are dead, rpower $ME boot to play again." - echo "Possible problems: + msg="Your are dead, rpower $ME boot to play again. + Possible problems: 1. $SNAPSHOTSERVER is not exporting $SNAPSHOTROOT ? 2. Is DNS set up? Maybe that's why I can't mount $SNAPSHOTSERVER." + echo "$msg" + logger $SYSLOGHOST -t $log_label -p local4.error "$msg" /bin/sh exit fi RS=$(( $RANDOM % 20 )) - echo "Trying again in $RS seconds..." + msg="Trying again in $RS seconds..." + echo "$msg" + logger $SYSLOGHOST -t $log_label -p local4.info "$msg" sleep $RS done @@ -79,13 +93,17 @@ if [ ! -z $SNAPSHOTSERVER ]; then while ! umount -l $NEWROOT/$RWDIR/persistent; do ITER=$(( ITER + 1 )) if [ "$ITER" == "$MAXTRIES" ]; then - echo "Your are dead, rpower $ME boot to play again." - echo "Cannot umount $NEWROOT/$RWDIR/persistent." + msg="Your are dead, rpower $ME boot to play again. + Cannot umount $NEWROOT/$RWDIR/persistent." + echo "$msg" + logger $SYSLOGHOST -t $log_label -p local4.error "$msg" /bin/sh exit fi RS=$(( $RANDOM % 20 )) - echo "Trying again in $RS seconds..." + msg="Trying again in $RS seconds..." + echo "$msg" + logger $SYSLOGHOST -t $log_label -p local4.info "$msg" sleep $RS done @@ -94,20 +112,26 @@ if [ ! -z $SNAPSHOTSERVER ]; then while ! mount $SNAPSHOTSERVER:/$SNAPSHOTROOT/$ME $NEWROOT/$RWDIR/persistent -o $MNT_OPTIONS; do ITER=$(( ITER + 1 )) if [ "$ITER" == "$MAXTRIES" ]; then - echo "Your are dead, rpower $ME boot to play again." - echo "Possible problems: cannot mount to $SNAPSHOTSERVER:/$SNAPSHOTROOT/$ME." + msg="Your are dead, rpower $ME boot to play again. + Possible problems: cannot mount to $SNAPSHOTSERVER:/$SNAPSHOTROOT/$ME." + echo $msg + logger $SYSLOGHOST -t $log_label -p local4.info "$msg" /bin/sh exit fi RS=$(( $RANDOM % 20 )) - echo "Trying again in $RS seconds..." + msg="Trying again in $RS seconds..." + echo "$msg" + logger $SYSLOGHOST -t $log_label -p local4.info "$msg" sleep $RS done fi # TODO: handle the dhclient/resolv.conf/ntp, etc -echo "Get to enable localdisk" +logger $SYSLOGHOST -t $log_label -p local4.info "Enabling localdisk ..." +echo "Enable localdisk ..." $NEWROOT/etc/init.d/localdisk +logger $SYSLOGHOST -t $log_label -p local4.info "Preparing mount points ..." $NEWROOT/etc/init.d/statelite READONLY=yes export READONLY @@ -175,3 +199,4 @@ fi echo 'settle_exit_if_exists="--exit-if-exists=/dev/root"; rm "$job"' > $hookdir/initqueue/xcat.sh # force udevsettle to break > $hookdir/initqueue/work +logger $SYSLOGHOST -t $log_label -p local4.info "Exit xcat-prepivot" diff --git a/xCAT-server/share/xcat/netboot/rh/dracut_047/xcatroot b/xCAT-server/share/xcat/netboot/rh/dracut_047/xcatroot index 254adb7fe..9f2b4182b 100755 --- a/xCAT-server/share/xcat/netboot/rh/dracut_047/xcatroot +++ b/xCAT-server/share/xcat/netboot/rh/dracut_047/xcatroot @@ -168,6 +168,7 @@ elif [ -r /rootimg-statelite.gz ]; then echo "" echo "The /$RWDIR directory doesn't exist in the rootimg... " echo "" + logger $SYSLOGHOST -t $log_label -p local4.err "The /$RWDIR directory doesn't exist in the rootimg..." /bin/sh fi @@ -175,6 +176,7 @@ elif [ -r /rootimg-statelite.gz ]; then echo "" echo "$NEWROOT/etc/init.d/statelite doesn't exist... " echo "" + logger $SYSLOGHOST -t $log_label -p local4.err "$NEWROOT/etc/init.d/statelite doesn't exist... " /bin/sh fi @@ -208,10 +210,12 @@ elif [ -r /rootimg-statelite.gz ]; then while ! mount $SNAPSHOTSERVER:/$SNAPSHOTROOT $NEWROOT/$RWDIR/persistent -o $MNT_OPTIONS; do ITER=$(( ITER + 1 )) if [ "$ITER" == "$MAXTRIES" ]; then - echo "You are dead, rpower $ME boot to play again." - echo "Possible problems: + msg="You are dead, rpower $ME boot to play again. + Possible problems: 1. $SNAPSHOTSERVER is not exporting $SNAPSHOTROOT ? 2. Is DNS set up? Maybe that's why I can't mount $SNAPSHOTSERVER." + echo "$msg" + logger $SYSLOGHOST -t $log_label -p local4.err "$msg" /bin/sh exit fi @@ -227,8 +231,10 @@ elif [ -r /rootimg-statelite.gz ]; then while ! umount -l $NEWROOT/$RWDIR/persistent; do ITER=$(( ITER + 1 )) if [ "$ITER" == "$MAXTRIES" ]; then - echo "Your are dead, rpower $ME boot to play again." - echo "Cannot umount $NEWROOT/$RWDIR/persistent." + msg="Your are dead, rpower $ME boot to play again. + Cannot umount $NEWROOT/$RWDIR/persistent." + echo "$msg" + logger $SYSLOGHOST -t $log_label -p local4.err "$msg" /bin/sh exit fi @@ -242,8 +248,10 @@ elif [ -r /rootimg-statelite.gz ]; then while ! mount $SNAPSHOTSERVER:/$SNAPSHOTROOT/$ME $NEWROOT/$RWDIR/persistent -o $MNT_OPTIONS; do ITER=$(( ITER + 1 )) if [ "$ITER" == "$MAXTRIES" ]; then - echo "Your are dead, rpower $ME boot to play again." - echo "Possible problems: cannot mount to $SNAPSHOTSERVER:/$SNAPSHOTROOT/$ME." + msg="Your are dead, rpower $ME boot to play again. + Possible problems: cannot mount to $SNAPSHOTSERVER:/$SNAPSHOTROOT/$ME." + echo "$msg" + logger $SYSLOGHOST -t $log_label -p local4.err "$msg" /bin/sh exit fi @@ -253,7 +261,9 @@ elif [ -r /rootimg-statelite.gz ]; then done fi + logger $SYSLOGHOST -t $log_label -p local4.info "Enabling localdisk ..." $NEWROOT/etc/init.d/localdisk + logger $SYSLOGHOST -t $log_label -p local4.info "Preparing mount points ..." $NEWROOT/etc/init.d/statelite fastboot=yes export fastboot diff --git a/xCAT-server/share/xcat/netboot/sles/dracut_033/xcat-premount.sh b/xCAT-server/share/xcat/netboot/sles/dracut_033/xcat-premount.sh index 40c1dbbe5..9f320bb66 100644 --- a/xCAT-server/share/xcat/netboot/sles/dracut_033/xcat-premount.sh +++ b/xCAT-server/share/xcat/netboot/sles/dracut_033/xcat-premount.sh @@ -1,6 +1,8 @@ #!/bin/sh #script to update nodelist.nodestatus during provision +XCAT="$(getarg XCAT=)" +STATEMNT="$(getarg STATEMNT=)" MASTER=`echo $XCAT |awk -F: '{print $1}'` getarg nonodestatus @@ -11,8 +13,12 @@ if [ $? -ne 0 ]; then XCATIPORT="3002" fi - - +log_label="xcat.deployment" +[ "$xcatdebugmode" = "1" -o "$xcatdebugmode" = "2" ] && SYSLOGHOST="" || SYSLOGHOST="-n $MASTER" +logger $SYSLOGHOST -t $log_label -p local4.info "=============deployment starting====================" +logger $SYSLOGHOST -t $log_label -p local4.info "Starting xcat-premount..." +[ "$xcatdebugmode" > "0" ] && logger $SYSLOGHOST -t $log_label -p local4.debug "MASTER=$MASTER XCATIPORT=$XCATIPORT NODESTATUS=$NODESTATUS" if [ $NODESTATUS -ne 0 ];then + logger $SYSLOGHOST -t $log_label -p local4.info "Sending request to $MASTER:$XCATIPORT for changing status to netbooting..." /tmp/updateflag $MASTER $XCATIPORT "installstatus netbooting" fi diff --git a/xCAT/postscripts/xcatdsklspost b/xCAT/postscripts/xcatdsklspost index e6651d711..0a94a131a 100755 --- a/xCAT/postscripts/xcatdsklspost +++ b/xCAT/postscripts/xcatdsklspost @@ -236,15 +236,13 @@ parsehttpserver () # Main # parse the arguments +log_label="xcat.updatenode" ARGNUM=$#; if [ -z $1 ]; then NODE_DEPLOYMENT=1 log_label="xcat.deployment" - echolog "info" "=============deployment starting====================" else NODE_DEPLOYMENT=0 - log_label="xcat.updatenode" - echolog "info" "=============updatenode starting====================" case $1 in 1|2|5) MODE=$1 @@ -299,9 +297,16 @@ else fi fi ;; - 3|4|6) MODE=$1;; + 4) + MODE=$1 + log_label="xcat.deployment" + ;; + 3|6) MODE=$1;; esac fi +if [ $NODE_DEPLOYMENT -ne 1 ] && [ $MODE -ne 4 ] ; then + echolog "info" "=============updatenode starting====================" +fi # set the default path for the xcatpost directory xcatpost="/xcatpost" # Check for debug mode and you have nodename available you can change the path for debug diff --git a/xCAT/postscripts/xcatpostinit1.netboot b/xCAT/postscripts/xcatpostinit1.netboot index 0128cefeb..851e43da4 100755 --- a/xCAT/postscripts/xcatpostinit1.netboot +++ b/xCAT/postscripts/xcatpostinit1.netboot @@ -22,7 +22,7 @@ fi if [ -n "$LOGLABEL" ]; then log_label=$LOGLABEL else - log_label="xcat" + log_label="xcat.deployment" fi XCATSERVER=$(grep --only-matching "\" /proc/cmdline |cut -d= -f2 |cut -d: -f1 2>/dev/null)