aboutsummaryrefslogtreecommitdiffstats
path: root/rc.d
diff options
context:
space:
mode:
authorMiloslav Trmac <mitr@volny.cz>2006-02-03 05:08:22 +0000
committerMiloslav Trmac <mitr@volny.cz>2006-02-03 05:08:22 +0000
commitfa7765e8b4da8be0da0fdcdf61fe86e524bc998c (patch)
tree3109835898672fc7db5c8618aaf763e01e76c608 /rc.d
parentc55b2e598242eb05229b7a702504518ffa101af6 (diff)
downloadinitscripts-fa7765e8b4da8be0da0fdcdf61fe86e524bc998c.tar
initscripts-fa7765e8b4da8be0da0fdcdf61fe86e524bc998c.tar.gz
initscripts-fa7765e8b4da8be0da0fdcdf61fe86e524bc998c.tar.bz2
initscripts-fa7765e8b4da8be0da0fdcdf61fe86e524bc998c.tar.xz
initscripts-fa7765e8b4da8be0da0fdcdf61fe86e524bc998c.zip
Try to unmount tmpfs filesystems before swapoff (#174000)
Diffstat (limited to 'rc.d')
-rwxr-xr-xrc.d/init.d/halt5
1 files changed, 5 insertions, 0 deletions
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