mirror of
https://github.com/xcat2/xcat-core.git
synced 2025-08-24 12:10:25 +00:00
Merge pull request #6303 from neo954/updatenode-lock
Prevent updatenode running when xCAT post-booting process is not completed on compute node
This commit is contained in:
@@ -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
|
||||
# Obsoleted
|
||||
# 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
|
||||
|
@@ -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
|
||||
@@ -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)
|
||||
|
Reference in New Issue
Block a user