Comment 11 for bug 48517

Revision history for this message
Adomas Paltanavičius (admp) wrote :

Binary package hint: initscripts

When turning off my computer, I noticed one `failed' status line. It was:
  * Unmounting local filesystems [fail]
Followed by:
  * Deactivating swap [ok]

Since I use ordinary files instead of dedicated partitions for swap, I found that very natural. I also think it is more than just a valid usage pattern (no problems with resizing partitions etc) and with regards to that, suggest the following patch to /etc/init.d/umountfs:

20,40c20
< # List all mounts, deepest mount point first
< LANG=C sort -r -k 2 /etc/mtab |
< (
< DIRS=""
< while read DEV DIR TYPE REST ; do
< if [ "x$TYPE" == "xtmpfs"]; then
< DIRS="$DIRS $DIR" # Unmount tmpfs before turning off swap
< fi
< done
< umount -r -d $DIRS
< )
<
< # Make sure tmpfs file systems are umounted before turning off
< # swap, to avoid running out of memory if the tmpfs filesystems
< # use a lot of space.
< log_action_begin_msg "Deactivating swap"
< swapoff -a
< log_action_end_msg $?
<
< # Umount all filesystems now
---
> # Umount all filesystems except root and the virtual ones
63a44,50
>
> # Make sure tmpfs file systems are umounted before turning off
> # swap, to avoid running out of memory if the tmpfs filesystems
> # use a lot of space.
> log_action_begin_msg "Deactivating swap"
> swapoff -a
> log_action_end_msg $?

It firstly unmounts tmpfs, then deactivas swap and remaining
filesystems lastly. I'd like to hear if there are any reasons for not
applying this patch, if any.