From b4d710e9280b11fa4c61733ea28f7dd7d9c40a77 Mon Sep 17 00:00:00 2001 From: GONG Jie Date: Thu, 9 May 2019 13:18:33 +0800 Subject: [PATCH 1/4] Add directory /etc/systemd/system/ to the systemd service search path --- xCAT/postscripts/xcatlib.sh | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/xCAT/postscripts/xcatlib.sh b/xCAT/postscripts/xcatlib.sh index e7b059494..2c6a3aa44 100755 --- a/xCAT/postscripts/xcatlib.sh +++ b/xCAT/postscripts/xcatlib.sh @@ -317,7 +317,7 @@ function servicemap { #all the service unit files are placed under /lib/systemd/system/ on ubuntu #all the service unit files are placed under /usr/lib/systemd/system/ on redhat and sles #path should be delimited with space - path="/usr/lib/systemd/system/ /lib/systemd/system/" + path="/usr/lib/systemd/system/ /lib/systemd/system/ /etc/systemd/system/" postfix=".service" svcmgrcmd="systemctl" elif [ "$svcmgrtype" = "2" ];then From 929eb79ce75ccc3841257ce96f12a81b0fbd2ae9 Mon Sep 17 00:00:00 2001 From: GONG Jie Date: Thu, 9 May 2019 16:18:20 +0800 Subject: [PATCH 2/4] Add a new return code 17, for activating --- xCAT/postscripts/xcatlib.sh | 2 ++ 1 file changed, 2 insertions(+) diff --git a/xCAT/postscripts/xcatlib.sh b/xCAT/postscripts/xcatlib.sh index 2c6a3aa44..4c3cf0210 100755 --- a/xCAT/postscripts/xcatlib.sh +++ b/xCAT/postscripts/xcatlib.sh @@ -549,6 +549,8 @@ function checkservicestatus { retcode=1 elif echo $output|grep -E -i "^failed$";then retcode=2 + elif echo $output|grep -E -i "^activating$";then + retcode=17 fi elif [ -n "$svcjob" ];then output=$(initctl status $svcjob) From 53f318113cdeb0965302c255d5c681042c32c245 Mon Sep 17 00:00:00 2001 From: GONG Jie Date: Thu, 9 May 2019 16:20:38 +0800 Subject: [PATCH 3/4] Abort updatenode if the xCAT compute node is still in post-booting process --- xCAT/postscripts/xcatdsklspost | 35 ++++++++++++++++++++++++++++++++++ 1 file changed, 35 insertions(+) diff --git a/xCAT/postscripts/xcatdsklspost b/xCAT/postscripts/xcatdsklspost index 057f25ccf..056d2f2d5 100755 --- a/xCAT/postscripts/xcatdsklspost +++ b/xCAT/postscripts/xcatdsklspost @@ -285,6 +285,41 @@ else esac fi +# The cheat sheet for ${MODE} +# Empty +# node deployment +# 1 - updatenode -P +# Execute postscripts listed in the postscripts table or parameters +# 2 - updatenode -S +# Perform Software Maintenanc - updatenode -S +# 3 - moncfg rmcmon +# Abosoulted +# 4 +# Statelite mode +# 5 +# Update security +# 6 - xcatpostinit1 +# During node reboot +case "${MODE}" in +"1"|"2"|"5") + # The cheat sheet for checkservicestatus + # Return code + # 0 - active + # 1 - inactive + # 2 - failed + # 3 - others + # 17 - activating + # 127 - error + checkservicestatus xcatpostinit1 >/dev/null 2>&1 + case "$?" in + "17") + echolog "warning" "xCAT post-booting process is not completed yet. Abort. Please try later." + exit 255 + ;; + esac + ;; +esac + update_VPD() { if [ -f /usr/sbin/vpdupdate ]; then From 0c8fc1521cbab166ea7571be9def70176534eaab Mon Sep 17 00:00:00 2001 From: GONG Jie Date: Thu, 9 May 2019 16:32:50 +0800 Subject: [PATCH 4/4] Fix typo --- xCAT/postscripts/xcatdsklspost | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/xCAT/postscripts/xcatdsklspost b/xCAT/postscripts/xcatdsklspost index 056d2f2d5..3440250cd 100755 --- a/xCAT/postscripts/xcatdsklspost +++ b/xCAT/postscripts/xcatdsklspost @@ -293,7 +293,7 @@ fi # 2 - updatenode -S # Perform Software Maintenanc - updatenode -S # 3 - moncfg rmcmon -# Abosoulted +# Obsoleted # 4 # Statelite mode # 5