Gentoo Websites Logo
Go to: Gentoo Home Documentation Forums Lists Bugs Planet Store Wiki Get Gentoo!

Bug 51160

Summary: fuser -k "umounting filesystems" during shutdown kills the shutdown script itself
Product: Gentoo Linux Reporter: Ryan Lortie <desrt>
Component: [OLD] Core systemAssignee: Gentoo's Team for Core System packages <base-system>
Status: RESOLVED WORKSFORME    
Severity: normal CC: sireyessire
Priority: High    
Version: 2004.1   
Hardware: All   
OS: All   
Whiteboard:
Package list:
Runtime testing required: ---

Description Ryan Lortie 2004-05-15 15:14:51 UTC
This is a regression introduced by the fix for bug 13599

If you have your 'mount' reading its mtab off of a tmpfs, then tmpfs is now unmounted by the shutdown scripts. (ie: i have /etc/mtab symlinked to /var/run/mtab which is on a tmpfs)

The code to do "Unmounting Filesystems" uses 'mount' to establish a list of filesystems to *not* unmount then uses 'cat /proc/mounts' to determine the list of filesystems to unmount.

The problem is that /proc/mounts always works and 'mount' fails to work after the tmpfs containing mtab is blown away.  This means that '/' isn't in the list of filesystems to skip unmounting.  fuser -km / is then called, and of course the shutdown script is using the root filesystem, so gets killed.

Possible solutions:
(1) Instead of using `mount | awk '{ $1 / $3 / $5 } print $3'` use `awk { $1 / $2 / $3 } print $2 /proc/mounts` (this is how I've fixed my system)
(2) (same as the alternative option suggested by the author of bug 13599)  Delay the unmounting of swap until *just before* poweroff/reboot and skip the tmpfs unmount until then.
(3) You probably have some better ideas than this.

Thanks
Comment 1 SpanKY gentoo-dev 2004-12-18 21:59:18 UTC
re-open in 1.11.8 doesnt handle this correctly