diff options
author | Sean Whitton <spwhitton@spwhitton.name> | 2021-07-02 12:40:54 -0700 |
---|---|---|
committer | Sean Whitton <spwhitton@spwhitton.name> | 2021-07-06 21:19:39 -0700 |
commit | 2ec9cea43c46854dd36e0cf9ba0b0d42d428a286 (patch) | |
tree | 74c2b6e256aac883eae9ffde58fcd5aaa76d6f48 /src/property/reboot.lisp | |
parent | 2259c1e367b0bf35825f77adac34f796b027c295 (diff) | |
download | consfigurator-2ec9cea43c46854dd36e0cf9ba0b0d42d428a286.tar.gz |
add AT-END, REBOOT:REBOOTED-AT-END
Signed-off-by: Sean Whitton <spwhitton@spwhitton.name>
Diffstat (limited to 'src/property/reboot.lisp')
-rw-r--r-- | src/property/reboot.lisp | 33 |
1 files changed, 33 insertions, 0 deletions
diff --git a/src/property/reboot.lisp b/src/property/reboot.lisp new file mode 100644 index 0000000..5728e0a --- /dev/null +++ b/src/property/reboot.lisp @@ -0,0 +1,33 @@ +;;; Consfigurator -- Lisp declarative configuration management system + +;;; Copyright (C) 2021 Sean Whitton <spwhitton@spwhitton.name> + +;;; This file is free software; you can redistribute it and/or modify +;;; it under the terms of the GNU General Public License as published by +;;; the Free Software Foundation; either version 3, or (at your option) +;;; any later version. + +;;; This file is distributed in the hope that it will be useful, +;;; but WITHOUT ANY WARRANTY; without even the implied warranty of +;;; MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the +;;; GNU General Public License for more details. + +;;; You should have received a copy of the GNU General Public License +;;; along with this program. If not, see <http://www.gnu.org/licenses/>. + +(in-package :consfigurator.property.reboot) +(named-readtables:in-readtable :consfigurator) + +(defprop %rebooted-at-end :posix () + (:apply (at-end + (lambda (result) + (declare (ignore result)) + (mrun "shutdown" "-r" "+1") + (inform t "*** SYSTEM REBOOT SCHEDULED, one minute delay ***"))))) + +(defproplist rebooted-at-end :posix () + "Schedule a reboot for the end of the current (sub)deployment. +The reboot is scheduled with a one minute delay to allow remote Lisp images to +return correct exit statuses to the root Lisp, for the root Lisp to have time +to download their output, etc." + (container:when-contained (:reboot) (%rebooted-at-end))) |