From fa7765e8b4da8be0da0fdcdf61fe86e524bc998c Mon Sep 17 00:00:00 2001 From: Miloslav Trmac Date: Fri, 3 Feb 2006 05:08:22 +0000 Subject: Try to unmount tmpfs filesystems before swapoff (#174000) --- rc.d/init.d/halt | 5 +++++ 1 file changed, 5 insertions(+) diff --git a/rc.d/init.d/halt b/rc.d/init.d/halt index 0afe13b4..44d4eaaf 100755 --- a/rc.d/init.d/halt +++ b/rc.d/init.d/halt @@ -119,6 +119,11 @@ esac runcmd $"Syncing hardware clock to system time" /sbin/hwclock $CLOCKFLAGS +# Try to unmount tmpfs filesystems to avoid swapping them in. Ignore failures. +tmpfs=$(awk '$2 ~ /^\/($|proc|dev)/ { next; } + $3 == "tmpfs" { print $2; }' /proc/mounts | sort -r) +[ -n "$tmpfs" ] && umount $tmpfs 2>/dev/null + # Turn off swap, then unmount file systems. [ -f /proc/swaps ] && SWAPS=`awk '! /^Filename/ { print $1 }' /proc/swaps` [ -n "$SWAPS" ] && runcmd $"Turning off swap: " swapoff $SWAPS -- cgit v1.2.1