aboutsummaryrefslogtreecommitdiff
path: root/rc.shutdown
diff options
context:
space:
mode:
authorTom Gundersen <teg@jklm.no>2011-10-29 17:26:26 +0200
committerTom Gundersen <teg@jklm.no>2011-11-04 22:49:34 +0100
commit34714bf34e5928479e5ec4367e5e79902876dfa3 (patch)
tree61a7340d18fed727ff292b5094baa93590e1e940 /rc.shutdown
parent3fd0222be7868096e9ed6d97ccee1b3c1ae4d394 (diff)
downloadinitscripts-34714bf34e5928479e5ec4367e5e79902876dfa3.tar.xz
swapoff: umount swap-backed fs before switching off swap
Factor out umounting. Explicitly skip umounting API directories, rather than matching on fs type. This allows us to e.g. unmount all tmpfs but leaving /run and /dev/shm alone. v3: fixed some regressions in v2, made 'API filesystems' less general v2: new umount_all implementation based on proposal by Dave and input from Anthony. Also, ignore ramfs as it is not backed by swap. Cc: Dave Reisner <d@falconindy.com> Cc: C Anthony Risinger <anthony@xtfx.me> Signed-off-by: Tom Gundersen <teg@jklm.no>
Diffstat (limited to 'rc.shutdown')
-rwxr-xr-xrc.shutdown9
1 files changed, 4 insertions, 5 deletions
diff --git a/rc.shutdown b/rc.shutdown
index 1946068..86ff799 100755
--- a/rc.shutdown
+++ b/rc.shutdown
@@ -50,16 +50,15 @@ kill_all
run_hook shutdown_postkillall
-# TODO: unmount any non-api partitions that are backed by swap, we don't want to
-# move their contents into memory (waste of time and might caues OOM).
+# unmount any non-api partitions that are backed by swap, we don't want to
+# move their contents into memory (waste of time and might caues OOM).
+status "Unmounting Swap-backed Filesystems" umount_all "tmpfs"
# almost everything is dead now, so the swap should hopefully be relatively
# empty, and quick to switch off
status "Deactivating Swap" swapoff -a
-# if we don't have devtmpfs support, /dev is mounted as tmpfs, so don't unmount it
-status "Unmounting Filesystems" \
- umount -a -r -t nodevtmpfs,notmpfs,nosysfs,noproc,nodevpts -O no_netdev
+status "Unmounting Non-API Filesystems" umount_all
run_hook shutdown_postumount