2
0
mirror of https://github.com/xcat2/xcat-core.git synced 2026-10-21 23:28:19 +00:00
Files
xcat-core/xCAT/postscripts/reboot
T
Vinícius Ferrão 760b538552 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>
2026-07-23 21:38:44 -03:00

17 lines
549 B
Bash
Executable File

#!/bin/sh
# IBM(c) 2007 EPL license http://www.eclipse.org/legal/epl-v10.html
#(C)IBM Corp
#
# 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