summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorHarald Hoyer <harald@redhat.com>2013-08-14 10:33:19 +0200
committerHarald Hoyer <harald@redhat.com>2013-08-14 15:04:05 +0200
commit3605b485084d5ebaabcafff55963942d7a0d488b (patch)
treef88f96a43c808ef4c1224b708cef59ef3c8997f9
parent4fe1bdd406602922a55ef4f7d6a13e13dfd1b87f (diff)
downloaddracut-3605b485084d5ebaabcafff55963942d7a0d488b.tar.gz
dracut-3605b485084d5ebaabcafff55963942d7a0d488b.tar.bz2
dracut-3605b485084d5ebaabcafff55963942d7a0d488b.zip
shutdown: fixed killall_proc_mountpoint()
-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