summaryrefslogtreecommitdiff
path: root/usr.sbin/syspatch/syspatch.sh
diff options
context:
space:
mode:
authorAntoine Jacoutot <ajacoutot@cvs.openbsd.org>2017-12-29 18:56:37 +0000
committerAntoine Jacoutot <ajacoutot@cvs.openbsd.org>2017-12-29 18:56:37 +0000
commit732ec12e1176c775f5378c4f03fdc88e8473bf3e (patch)
tree5be2d5feb31e09a8752e70bd0aa4c1797db44643 /usr.sbin/syspatch/syspatch.sh
parentb88dc1e019612053ab1eabc8cd686c4c651e932f (diff)
Prevent syspatch from running and throw an error out if reorder_kernel is
running. This is to prevent syspatch from installing new kernel object files while reordering is in progress (typically after an install/upgrade on slow machines). req. by and OK sthen@
Diffstat (limited to 'usr.sbin/syspatch/syspatch.sh')
-rw-r--r--usr.sbin/syspatch/syspatch.sh4
1 files changed, 3 insertions, 1 deletions
diff --git a/usr.sbin/syspatch/syspatch.sh b/usr.sbin/syspatch/syspatch.sh
index 3b5cc4b8ab0..9c4f5c54252 100644
--- a/usr.sbin/syspatch/syspatch.sh
+++ b/usr.sbin/syspatch/syspatch.sh
@@ -1,6 +1,6 @@
#!/bin/ksh
#
-# $OpenBSD: syspatch.sh,v 1.133 2017/11/09 14:59:07 ajacoutot Exp $
+# $OpenBSD: syspatch.sh,v 1.134 2017/12/29 18:56:36 ajacoutot Exp $
#
# Copyright (c) 2016, 2017 Antoine Jacoutot <ajacoutot@openbsd.org>
#
@@ -251,6 +251,8 @@ unpriv()
[[ $@ == @(|-[[:alpha:]]) ]] || usage; [[ $@ == @(|-(c|R|r)) ]] &&
(($(id -u) != 0)) && sp_err "${0##*/}: need root privileges"
+[[ $@ == @(|-(R|r)) ]] && pgrep -qxf '/bin/ksh .*reorder_kernel' &&
+ sp_err "${0##*/}: cannot apply patches while reorder_kernel is running"
# only run on release (not -current nor -stable)
set -A _KERNV -- $(sysctl -n kern.version |