mirror of
https://github.com/xcat2/xcat-core.git
synced 2026-10-22 07:38:08 +00:00
fix(xcat-core): an openEuler node reinstalls for ever instead of booting
reg_linux_diskfull_installation_flat never finishes on openEuler. The install completes, the
postscripts run, and then the node reboots into the installer again and repeats, so the case waited
an hour and the node stayed at status=installing.
post.xcat.ng ends with updateflag.awk, the call its own comment calls the one that must always run
to prevent infinite installation loops. It passed $MASTER, a hostname. The anaconda %post chroot on
openEuler has no /etc/resolv.conf and no management node entry in /etc/hosts, so gawk cannot open
the socket. From the node's own /var/log/xcat/xcat.log:
awk: /xcatpost/updateflag.awk:15: warning: remote host and port information
(xcat58-mn, 3002) invalid: Name or service not known
updateflag.awk: Retrying flag update
It retries ten times, gives up, and the status is never sent. Nothing reports it: the retry message
goes to logger, and a %post chroot runs no rsyslog.
The same script already uses $MASTER_IP for all 36 of its other callbacks, and the kickstart sets it
to the same host: MASTER_IP=192.168.58.1, MASTER=xcat58-mn. All six updateflag calls now use the
address, so none of them depends on a resolver the node does not have.
Signed-off-by: Daniel Hilst <392820+dhilst@users.noreply.github.com>
This commit is contained in:
@@ -63,7 +63,7 @@ sleep "$RAND"
|
||||
if ! type openssl >/dev/null 2>&1
|
||||
then
|
||||
msgutil_r "$MASTER_IP" "error" "/usr/bin/openssl does not exist, halt ..." "/var/log/xcat/xcat.log" "$log_label"
|
||||
/tmp/updateflag "$MASTER" "$XCATIPORT" "installstatus failed"
|
||||
/tmp/updateflag "$MASTER_IP" "$XCATIPORT" "installstatus failed"
|
||||
sleep infinity
|
||||
fi
|
||||
|
||||
@@ -107,7 +107,7 @@ msgutil_r "$MASTER_IP" "info" "trying to download postscripts from $MASTER_IP...
|
||||
if ! type curl >/dev/null 2>&1
|
||||
then
|
||||
msgutil_r "$MASTER_IP" "error" "Command curl not found, halt ..." "/var/log/xcat/xcat.log" "$log_label"
|
||||
/tmp/updateflag "$MASTER" "$XCATIPORT" "installstatus failed"
|
||||
/tmp/updateflag "$MASTER_IP" "$XCATIPORT" "installstatus failed"
|
||||
sleep infinity
|
||||
fi
|
||||
|
||||
@@ -143,7 +143,7 @@ download_recursive "http://$MASTER_IP:${HTTPPORT}$INSTALLDIR/postscripts/" "/xca
|
||||
if [ "$?" -ne "0" ]
|
||||
then
|
||||
msgutil_r "$MASTER_IP" "error" "failed to download postscripts from http://$MASTER_IP$INSTALLDIR/postscripts/, check /tmp/download.log on the node, halt ..." "/var/log/xcat/xcat.log" "$log_label"
|
||||
/tmp/updateflag "$MASTER" "$XCATIPORT" "installstatus failed"
|
||||
/tmp/updateflag "$MASTER_IP" "$XCATIPORT" "installstatus failed"
|
||||
sleep infinity
|
||||
fi
|
||||
|
||||
@@ -189,7 +189,7 @@ if [ ! -x /xcatpost/mypostscript ]; then
|
||||
# Stop if no getpostscript.awk to help the next bit
|
||||
if [ ! -x /xcatpost/getpostscript.awk ]; then
|
||||
msgutil_r "$MASTER_IP" "error" "/xcatpost/getpostscript.awk does not exist, halt ..." "/var/log/xcat/xcat.log" "$log_label"
|
||||
/tmp/updateflag "$MASTER" "$XCATIPORT" "installstatus failed"
|
||||
/tmp/updateflag "$MASTER_IP" "$XCATIPORT" "installstatus failed"
|
||||
sleep infinity
|
||||
fi
|
||||
/xcatpost/getpostscript.awk | egrep '<data>' | sed -e 's/<[^>]*>//g' | egrep -v '^ *$' | sed -e 's/^ *//' | sed -e 's/</</g' -e 's/>/>/g' -e 's/&/\&/g' -e 's/"/"/g' -e "s/'/'/g" >/xcatpost/mypostscript
|
||||
@@ -301,7 +301,7 @@ esac
|
||||
chmod 0755 /xcatpost/mypostscript
|
||||
if [ ! -x /xcatpost/mypostscript ]; then
|
||||
msgutil_r "$MASTER_IP" "error" "failed to generate mypostscript file, halt ..." "/var/log/xcat/xcat.log" "$log_label"
|
||||
/tmp/updateflag "$MASTER" "$XCATIPORT" "installstatus failed"
|
||||
/tmp/updateflag "$MASTER_IP" "$XCATIPORT" "installstatus failed"
|
||||
sleep infinity
|
||||
else
|
||||
case "$XCATDEBUGMODE" in
|
||||
@@ -454,7 +454,7 @@ esac
|
||||
|
||||
msgutil_r "$MASTER_IP" "info" "finished firstboot preparation, sending request to $MASTER:3002 for changing status..." "/var/log/xcat/xcat.log" "$log_label"
|
||||
# The following command should always be run to prevent infinite installation loops
|
||||
updateflag.awk "$MASTER" 3002
|
||||
updateflag.awk "$MASTER_IP" 3002
|
||||
|
||||
cd /
|
||||
|
||||
|
||||
Reference in New Issue
Block a user