summaryrefslogtreecommitdiff
path: root/distrib
diff options
context:
space:
mode:
authorKlemens Nanni <kn@cvs.openbsd.org>2024-03-15 16:29:33 +0000
committerKlemens Nanni <kn@cvs.openbsd.org>2024-03-15 16:29:33 +0000
commitf230f4a0d91c911d88a052334ff2afa2ceafe0cc (patch)
tree881e0c182b48ea118913e3448d92a0a27d70522d /distrib
parentbc75188cd86247423e72d8fc19bedc8275706ff7 (diff)
Move code into new stop_watchdog()
We have {reset,start}_watchdog() which are only used in unattended upgrade code, but stopping the background timer is done inline for all upgrades, incl. interactive ones. Relocate it out of the very end of do_upgrade() right after its only caller and limit it to unattended upgrades to match where/how the timer is started. OK afresh1
Diffstat (limited to 'distrib')
-rw-r--r--distrib/miniroot/install.sub18
1 files changed, 12 insertions, 6 deletions
diff --git a/distrib/miniroot/install.sub b/distrib/miniroot/install.sub
index e48da58532b..676334faf12 100644
--- a/distrib/miniroot/install.sub
+++ b/distrib/miniroot/install.sub
@@ -1,5 +1,5 @@
#!/bin/ksh
-# $OpenBSD: install.sub,v 1.1261 2024/03/05 19:47:58 kn Exp $
+# $OpenBSD: install.sub,v 1.1262 2024/03/15 16:29:32 kn Exp $
#
# Copyright (c) 1997-2015 Todd Miller, Theo de Raadt, Ken Westerback
# Copyright (c) 2015, Robert Peichaer <rpe@openbsd.org>
@@ -3477,11 +3477,6 @@ do_upgrade() {
# Perform final steps common to both an install and an upgrade.
finish_up
- if [ -f /tmp/wdpid ]; then
- kill -KILL "$(</tmp/wdpid)" 2>/dev/null
- # do not bother waiting
- rm -f /tmp/wdpid
- fi
}
check_unattendedupgrade() {
@@ -3528,6 +3523,15 @@ start_watchdog() {
set +m
}
+# Stop the background timer.
+stop_watchdog() {
+ if [ -f /tmp/wdpid ]; then
+ kill -KILL "$(</tmp/wdpid)" 2>/dev/null
+ # do not bother waiting
+ rm -f /tmp/wdpid
+ fi
+}
+
# return if we only want internal functions
[[ -n $FUNCS_ONLY ]] && return
@@ -3708,6 +3712,8 @@ install) do_install;;
upgrade) do_upgrade;;
esac
+$UU && stop_watchdog
+
# In case of autoinstall, this is a second process of install.sub.
# Exiting here returns to the original process, which handles the
# automatic reboot in do_autoinstall().