From 760b5385526c8ae9a725182859886908231129f3 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Vin=C3=ADcius=20Ferr=C3=A3o?= <2031761+viniciusferrao@users.noreply.github.com> Date: Thu, 23 Jul 2026 21:38:44 -0300 Subject: [PATCH] fix(postscripts): schedule the reboot with a systemd timer on SUSE The reboot postscript backgrounds "(sleep 75; reboot) &". On SUSE that can fire while the installer is still finishing, rebooting the node mid-install. Use a systemd timer (systemd-run --on-active=90 /sbin/reboot) on SUSE, which the installer teardown does not race; EL and Ubuntu keep the existing backgrounded sleep. Gated on SUSE and the presence of systemd-run, so no other platform changes. Recovered from the unmerged lenovobuild branch (6785eb3a, 4fe2a72c, ac04f5ad; net effect, consolidated). Co-authored-by: Jarrod Johnson <10814490+jjohnson42@users.noreply.github.com> --- xCAT/postscripts/reboot | 9 ++++++++- 1 file changed, 8 insertions(+), 1 deletion(-) diff --git a/xCAT/postscripts/reboot b/xCAT/postscripts/reboot index 6aace8cb7..018f2ccc4 100755 --- a/xCAT/postscripts/reboot +++ b/xCAT/postscripts/reboot @@ -3,7 +3,14 @@ #(C)IBM Corp # -(sleep 75;/sbin/reboot) & +# On SUSE the backgrounded "sleep then reboot" can fire while the installer is +# still finishing and reboot the node mid-install. Schedule the reboot with a +# systemd timer there instead, which the installer teardown does not race. +if grep NAME /etc/os-release | egrep '(SLE|SUSE)' > /dev/null && [ -x /usr/bin/systemd-run ]; then + systemd-run --on-active=90 --timer-property=AccuracySec=10s /sbin/reboot +else + (sleep 75;/sbin/reboot) & +fi exit 0