Gentoo Websites Logo
Go to: Gentoo Home Documentation Forums Lists Bugs Planet Store Wiki Get Gentoo!
Bug 121827 - splash-functions.sh + checkroot = stale /etc/mtab entry
Summary: splash-functions.sh + checkroot = stale /etc/mtab entry
Status: RESOLVED FIXED
Alias: None
Product: Gentoo Linux
Classification: Unclassified
Component: Current packages (show other bugs)
Hardware: All Linux
: High minor
Assignee: Michal Januszewski (RETIRED)
URL:
Whiteboard: fixed in git
Keywords:
Depends on:
Blocks:
 
Reported: 2006-02-06 06:44 UTC by TGL
Modified: 2006-07-14 17:17 UTC (History)
0 users

See Also:
Package list:
Runtime testing required: ---


Attachments
splash-functions_mtab_cleanup.patch (splash-functions_mtab_cleanup.patch,538 bytes, patch)
2006-02-06 06:44 UTC, TGL
Details | Diff

Note You need to log in before you can comment on or make changes to this bug.
Description TGL 2006-02-06 06:44:11 UTC
Hi,

The way "/sbin/splash-functions.sh" plays with mounting/moving of ${spl_tmpdir} and ${spl_cachedir}, combined with the "checkroot" init script, leads to a stale entry in /etc/mtab at the end of the boot sequence. What happen is the following:

 1) splash_cache_prep() mounts ${spl_tmpdir}, and moves it to ${spl_cachedir}. /etc/mtab is not modified because of the "-n" mount option.

 2) /etc/init.d/checkroot starts, and fill /etc/mtab with /proc/mounts entries (including ${spl_cachedir}).

 3) splash_cache_cleanup() moves ${spl_cachedir} back to ${spl_tmpdir}, with the "-n" option again. From here, the /etc/mtab entry about ${spl_cachedir} is wrong.

 4) splash_cache_cleanup() unmount ${spl_tmpdir}, which sure doesn't remove the wrong /etc/mtab entry about ${spl_cachedir}.


It's not a big issue to have this stale mtab entry, but it's sometimes annoying, like for instance in "df" output where it adds an extra line:
% df -h
...
cachedir               15G  9,5G  4,3G  70% /lib/splash/cache
...
(the reported sizes are actually those of my / partition)


I suggest you simply remove the "-n" option from the "mount --move" in splash_cache_cleanup (i will attach a patch), because:
 - during a normal boot sequence, the FS is mounted rw at this step (at least, that's what happens on my system)
 - even if it was not, it wouldn't prevent mount to do his job and to properly move the mount point: i've just made some tests with / (and thus /etc) remounted ro, and mount didn't complain at all. It didn't even return the error code 16 documented in the man page... Weird, but a good news from the POV of this bug :)

And if you're not confident with completly removing the "-n" option, you can still use something like "mount --move ... || move -n --move ...".


Note: I'm using media-gfx/splashutils-1.1.9.10, but iirc, this bug has been there for a long time, and thus in some previous versions too.
Comment 1 TGL 2006-02-06 06:44:43 UTC
Created attachment 79026 [details, diff]
splash-functions_mtab_cleanup.patch
Comment 2 Michal Januszewski (RETIRED) gentoo-dev 2006-07-14 17:17:20 UTC
Fixed in splashutils-1.3. Thanks for the patch :)