diff options
author | Sean Whitton <spwhitton@spwhitton.name> | 2022-06-26 15:38:14 -0700 |
---|---|---|
committer | Sean Whitton <spwhitton@spwhitton.name> | 2022-06-27 13:26:21 -0700 |
commit | d9956e8f094c9e1b1c38f0d25792f7ded11f879b (patch) | |
tree | b508a341d1d4d392b826d034aeeea33589b046fe | |
parent | d71c49cb57ff028c36c9645771f33249d1481632 (diff) | |
download | consfigurator-d9956e8f094c9e1b1c38f0d25792f7ded11f879b.tar.gz |
REBOOT:AT-END: add fallback scheduling
Signed-off-by: Sean Whitton <spwhitton@spwhitton.name>
-rw-r--r-- | src/property/reboot.lisp | 16 |
1 files changed, 11 insertions, 5 deletions
diff --git a/src/property/reboot.lisp b/src/property/reboot.lisp index fe213d8..3fa324a 100644 --- a/src/property/reboot.lisp +++ b/src/property/reboot.lisp @@ -19,11 +19,17 @@ (named-readtables:in-readtable :consfigurator) (defprop %at-end :posix () - (:apply (consfigurator:at-end - (lambda (result) - (declare (ignore result)) - (mrun "shutdown" "-r" "+1") - (inform t "*** SYSTEM REBOOT SCHEDULED, one minute delay ***"))))) + (:apply + (consfigurator:at-end + (lambda (result) + (declare (ignore result)) + (handler-case (mrun "shutdown" "-r" "+1") + ;; Sometimes after INSTALLER::%ROOT-FILESYSTEMS-FLIPPED shutdown(8) + ;; can't schedule a future reboot, but an immediate one is fine. + (run-failed () + (mrun "nohup" "sh" "-c" + "(sleep 60; shutdown -r now) </dev/null >/dev/null 2>&1 &"))) + (inform t "*** SYSTEM REBOOT SCHEDULED, one minute delay ***"))))) (defproplist at-end :posix () "Schedule a reboot for the end of the current (sub)deployment. |