summary refs log tree commit diff
path: root/shutdown.d
diff options
context:
space:
mode:
Diffstat (limited to 'shutdown.d')
-rw-r--r--shutdown.d/90-kexec.sh5
1 files changed, 4 insertions, 1 deletions
diff --git a/shutdown.d/90-kexec.sh b/shutdown.d/90-kexec.sh
index 62487f9..b5c8ad0 100644
--- a/shutdown.d/90-kexec.sh
+++ b/shutdown.d/90-kexec.sh
@@ -1,5 +1,8 @@
 if [ -z "$VIRTUALIZATION" ]; then
-    if [ -x /run/runit/reboot ] && command -v kexec >/dev/null; then
+    # test -x returns false on a noexec mount, hence using find to detect x bit
+    if [ -n "$(find /run/runit/reboot -perm -u+x 2>/dev/null)" ] &&
+        command -v kexec >/dev/null
+    then
         msg "Triggering kexec..."
         kexec -e 2>/dev/null
         # not reached when kexec was successful.