diff --git a/xCAT-server/lib/xcat/plugins/debian.pm b/xCAT-server/lib/xcat/plugins/debian.pm index 65b2cdbd5..c23c99498 100755 --- a/xCAT-server/lib/xcat/plugins/debian.pm +++ b/xCAT-server/lib/xcat/plugins/debian.pm @@ -1401,6 +1401,21 @@ sub mknetboot if(($nodestatus eq "n") or ($nodestatus eq "N") or ($nodestatus eq "0")){ $kcmdline .= " nonodestatus "; } + + + if($::XCATSITEVALS{xcatdebugmode} eq "1"){ + + my ($host, $ipaddr) = xCAT::NetworkUtils->gethostnameandip($xcatmaster); + if($ipaddr){ + $kcmdline .=" LOGSERVER=$ipaddr "; + }else{ + $kcmdline .=" LOGSERVER=$xcatmaster "; + } + + $kcmdline .= " xcatdebugmode=1 "; + } + + # add one parameter: ifname=: # which is used for dracut # the redhat5.x os will ignore it diff --git a/xCAT-server/lib/xcat/plugins/sles.pm b/xCAT-server/lib/xcat/plugins/sles.pm index ec35796c6..9cb5d6a42 100755 --- a/xCAT-server/lib/xcat/plugins/sles.pm +++ b/xCAT-server/lib/xcat/plugins/sles.pm @@ -576,6 +576,20 @@ sub mknetboot $kcmdline .= " nonodestatus "; } + + if($::XCATSITEVALS{xcatdebugmode} eq "1"){ + + my ($host, $ipaddr) = xCAT::NetworkUtils->gethostnameandip($xcatmaster); + if($ipaddr){ + $kcmdline .=" LOGSERVER=$ipaddr "; + }else{ + $kcmdline .=" LOGSERVER=$xcatmaster "; + } + + $kcmdline .= " xcatdebugmode=1 "; + } + + $kcmdline .= "NODE=$node "; # add flow control setting $kcmdline .= "FC=$useflowcontrol "; diff --git a/xCAT-server/share/xcat/install/scripts/scriptlib b/xCAT-server/share/xcat/install/scripts/scriptlib index f8de11775..a9cca7802 100644 --- a/xCAT-server/share/xcat/install/scripts/scriptlib +++ b/xCAT-server/share/xcat/install/scripts/scriptlib @@ -8,7 +8,7 @@ declare -F msgutil_r &>/dev/null || function msgutil_r { msgtype="debug" fi - if [ -n "logserver" ];then + if [ -n "$logserver" ];then logger -n $logserver -t xcat -p local4.$msgtype "$msgstr" if [ "$?" != "0" ];then exec 3<>/dev/udp/$logserver/514 >/dev/null 2>&1;logger -s -t xcat -p local4.$msgtype "$msgstr" 1>&3 2>&1 diff --git a/xCAT/postscripts/xcatlib.sh b/xCAT/postscripts/xcatlib.sh index 00cc88d4d..06069d905 100755 --- a/xCAT/postscripts/xcatlib.sh +++ b/xCAT/postscripts/xcatlib.sh @@ -715,7 +715,7 @@ function msgutil_r { fi - if [ -n "logserver" ];then + if [ -n "$logserver" ];then logger -n $logserver -t xcat -p local4.$msgtype "$msgstr" >/dev/null 2>&1 if [ "$?" != "0" ];then exec 3<>/dev/udp/$logserver/514 >/dev/null 2>&1;logger -s -t xcat -p local4.$msgtype "$msgstr" 1>&3 2>&1