summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rwxr-xr-xmodules.d/99base/dracut-lib.sh2
-rwxr-xr-xmodules.d/99shutdown/shutdown.sh13
2 files changed, 10 insertions, 5 deletions
diff --git a/modules.d/99base/dracut-lib.sh b/modules.d/99base/dracut-lib.sh
index 248cc8eb..3084744f 100755
--- a/modules.d/99base/dracut-lib.sh
+++ b/modules.d/99base/dracut-lib.sh
@@ -56,7 +56,7 @@ killall_proc_mountpoint() {
esac
[ -e "/proc/$_pid/exe" ] || continue
[ -e "/proc/$_pid/root" ] || continue
- strstr "$(ls -l -- '/proc/$_pid' '/proc/$_pid/fd' 2>/dev/null)" "$1" && kill -9 "$_pid"
+ strstr "$(ls -l -- "/proc/$_pid" "/proc/$_pid/fd" 2>/dev/null)" "$1" && kill -9 "$_pid"
done
}
diff --git a/modules.d/99shutdown/shutdown.sh b/modules.d/99shutdown/shutdown.sh
index f0401397..162abcb9 100755
--- a/modules.d/99shutdown/shutdown.sh
+++ b/modules.d/99shutdown/shutdown.sh
@@ -68,14 +68,19 @@ if strstr "$(cat /proc/mounts)" "/oldroot"; then
case $_pid in
*[!0-9]*) continue;;
esac
- [ -e /proc/$_pid/exe ] || continue
- [ -e /proc/$_pid/root ] || continue
+ [ $_pid -eq $$ ] && continue
+
+ [ -e "/proc/$_pid/exe" ] || continue
+ [ -e "/proc/$_pid/root" ] || continue
+
if strstr "$(ls -l /proc/$_pid /proc/$_pid/fd 2>/dev/null)" "oldroot"; then
warn "Blocking umount of /oldroot [$_pid] $(cat /proc/$_pid/cmdline)"
- elif [ $_pid -ne $$ ]; then
+ else
warn "Still running [$_pid] $(cat /proc/$_pid/cmdline)"
fi
- ls -l /proc/$_pid/fd 2>&1 | vwarn
+
+ ls -l "/proc/$_pid/exe" 2>&1 | vwarn
+ ls -l "/proc/$_pid/fd" 2>&1 | vwarn
done
fi