summaryrefslogtreecommitdiff
path: root/distrib/miniroot/install.sub
diff options
context:
space:
mode:
authorFlorian Obser <florian@cvs.openbsd.org>2019-04-24 18:11:01 +0000
committerFlorian Obser <florian@cvs.openbsd.org>2019-04-24 18:11:01 +0000
commit242d85a21dec7b688a75711c213f3327c83db80d (patch)
tree7970a3976324d3e0e88ece0358e19cce5d00d1c4 /distrib/miniroot/install.sub
parent54f5d4427a35a5d6228d9e3c628713399f949975 (diff)
In unattended mode do a reboot even if things go wrong and
additionally install a watchdog to do a reboot after 30 minutes if the script gets completely stuck. A half upgraded system that reboots at least gives us a chance that it will come back and we can fix it. Just having it sit there isn't helping anyone. It would be nicer if the watchdog were kernel based... OK deraadt
Diffstat (limited to 'distrib/miniroot/install.sub')
-rw-r--r--distrib/miniroot/install.sub9
1 files changed, 7 insertions, 2 deletions
diff --git a/distrib/miniroot/install.sub b/distrib/miniroot/install.sub
index ce3f6616ba8..65df649ff78 100644
--- a/distrib/miniroot/install.sub
+++ b/distrib/miniroot/install.sub
@@ -1,5 +1,5 @@
#!/bin/ksh
-# $OpenBSD: install.sub,v 1.1115 2019/04/24 15:59:22 florian Exp $
+# $OpenBSD: install.sub,v 1.1116 2019/04/24 18:11:00 florian Exp $
#
# Copyright (c) 1997-2015 Todd Miller, Theo de Raadt, Ken Westerback
# Copyright (c) 2015, Robert Peichaer <rpe@openbsd.org>
@@ -2871,7 +2871,8 @@ do_autoinstall() {
/$AI_MODE -af /tmp/ai/ai.$AI_MODE.conf 2>&1 </dev/null |
sed "s/^.*$(echo '\r')//;w/tmp/ai/ai.log"
- [[ -f /tmp/ai/ai.done ]] || err_exit "failed; check /tmp/ai/ai.log"
+ $UU || [[ -f /tmp/ai/ai.done ]] ||
+ err_exit "failed; check /tmp/ai/ai.log"
# Email autoinstall protocol to root on next boot.
prep_root_mail /tmp/ai/ai.log "$(hostname) $AI_MODE log"
@@ -3381,6 +3382,10 @@ __EOT
elif $UU; then
MODE=upgrade
check_unattendedupgrade || exit 1
+
+ # trigger watchdog
+ (sleep 1800 && reboot) &
+
cat <<__EOT > /auto_upgrade.conf
Location of sets = disk
Pathname to the sets = /home/upgrade/