2
0
mirror of https://github.com/xcat2/xcat-core.git synced 2026-09-05 04:27:55 +00:00

fix(xcat-core): correct the boot-flip comment

The comment blamed mawk: updateflag.awk needs gawk's |& and Ubuntu's /usr/bin/awk is mawk. That
is wrong on this path -- compute.subiquity.tmpl has installed gawk in the target since Ubuntu
20.04 support was added, so updateflag.awk would have found it.

The flip was going unanswered because xcatd's install monitor, which serves port 3002, dies and
is never re-forked. That is fixed in #7759. The /dev/tcp exchange here is hardening: it retries
and reports, rather than reinstalling in silence.

Signed-off-by: Daniel Hilst <392820+dhilst@users.noreply.github.com>
This commit is contained in:
Daniel Hilst
2026-08-28 09:38:44 -03:00
parent a0c8f7eae7
commit 1cbdad2531
@@ -108,9 +108,9 @@ autoinstall:
curtin in-target --target /target /root/post.script;
} >>/target/var/log/xcat/xcat.log 2>&1'
# Flip the node to local-disk boot, or it PXE-loops back into the installer on reboot.
# The in-target post-script does this through updateflag.awk, which needs gawk's |& and
# Ubuntu's /usr/bin/awk is mawk, so it silently failed. Send "next" to xcatd from the live
# installer over bash's /dev/tcp instead, and log a failure rather than reinstalling.
# "next" is the request xcatd's install monitor answers with "nodeset <node> next". Send it
# from the live installer, retried, and log a failure rather than silently reinstalling. A
# monitor that died and never came back is a separate problem; see #7759.
- ['bash', '-c', 'xm=#XCATVAR:XCATMASTER#; ok=0; for i in 1 2 3 4 5; do if exec 3<>/dev/tcp/$xm/3002; then read -r r <&3 || true; printf "next\n" >&3; if read -r r <&3; then ok=1; fi; exec 3>&- 3<&-; [ "$ok" = 1 ] && break; fi; sleep 5; done; if [ "$ok" != 1 ]; then echo "xcat: FAILED to flip $(hostname) to local-disk boot via $xm:3002; the node will PXE back into the installer" >>/target/var/log/xcat/xcat.log; fi; exit 0']
error-commands:
- tar -c --ignore-failed-read --transform='s/^/#HOSTNAME#-logs\//' /var/crash /var/log/installer /tmp/pre-install.log /autoinstall.yaml 2>/dev/null |nc -l 8080