summaryrefslogtreecommitdiff
path: root/bin/locmaint
diff options
context:
space:
mode:
authorSean Whitton <spwhitton@spwhitton.name>2020-04-06 09:51:02 -0700
committerSean Whitton <spwhitton@spwhitton.name>2020-04-06 09:51:02 -0700
commitf38e312d7f28e3c8527d6b6dcbf8e4b57d8277ec (patch)
tree34b1d1a808d01e1bca04f35eedaf486a691268fc /bin/locmaint
parentedfdf9db53975d08d1029d0c8ccec64467262cae (diff)
downloaddotfiles-f38e312d7f28e3c8527d6b6dcbf8e4b57d8277ec.tar.gz
locmaint: offer to spin this host now
Diffstat (limited to 'bin/locmaint')
-rwxr-xr-xbin/locmaint15
1 files changed, 15 insertions, 0 deletions
diff --git a/bin/locmaint b/bin/locmaint
index d9f3ca42..09d88a86 100755
--- a/bin/locmaint
+++ b/bin/locmaint
@@ -605,6 +605,21 @@ sub do_sysmaint {
}
}
+ # Point of this is so that if the apt upgrade undid any config,
+ # it'll get restored before we attempt a reboot -- then can always
+ # choose to accept the maintainer's conffile during the above
+ # upgrades.
+ #
+ # On hosts which are manually spun or spun only when online, also
+ # useful refresh sbuild chroots
+ if (-e "/usr/local/propellor"
+ and prompt_Yn "Spin this host with propellor?") {
+ interactive_ensure_subroutine_success sub {
+ system_pty_capture as_root
+ "/bin/bash -c 'cd /usr/local/propellor && ./propellor'"
+ };
+ }
+
if (($suite ne STABLE || -e "/var/run/reboot-required")
&& prompt_yn("Should reboot; do it now?")) {
exec as_root("reboot");