mirror of
https://github.com/xcat2/xcat-core.git
synced 2026-07-31 18:19:40 +00:00
886db49e27
The generated /opt/xcat/xcatinstallpost ran the install postscripts first and only disabled the xcatpostinit1 service afterwards. If one of those postscripts rebooted the node (for example a firmware or kernel update), the service was still enabled, so on the next boot the whole postscript set ran again from the start. Disable the service *before* running the postscripts so a mid-postscript reboot cannot re-trigger them. The disable decision reads OSVER (base variant only), RUNBOOTSCRIPTS and NODESTATUS, which the included xcatinstallpost script would otherwise set. Moving the INCLUDE below the disable block leaves those variables unset, so read them up front (the included script re-reads them) and source xcatlib.sh so msgutil_r is available; the disable decision is then identical to before. The original change (lenovobuild9184cbe0) touched only the legacy post.xcat. Modern EL uses the systemd variants: post.xcat.ng (RHEL/CentOS 8 and 9) and post.xcat.rhels10 (RHEL 10). Apply the same reorder to all three so the fix actually takes effect on current platforms. Lab-validated with a full AlmaLinux 9.8 stateful install (post.xcat.ng path): the generated xcatinstallpost disables the service before running the postscripts, the postscripts run exactly once, the node reaches "booted", and with the default NODESTATUS=1 the service is left enabled just as before. Recovered from the unmerged lenovobuild branch (original9184cbe0), adapted and extended to the .ng and .rhels10 variants. Co-authored-by: Jarrod Johnson <10814490+jjohnson42@users.noreply.github.com>