xenial: Watch out for boot failures due to /etc/mtab file

Martin Pitt martin.pitt at ubuntu.com
Thu Oct 29 14:45:35 UTC 2015


Oliver Grawert [2015-10-29 15:36 +0100]:
> i have been wondering for years why does it have to exist at all, if it
> is only a symlink anyway, why cant apps/services not directly
> use /proc/self/mounts ? could we perhaps get completely rid of mtab and
> all the pain it brings along ? (i know this would be a huge project
> indeed, but it seems a lot cleaner as an end-result)

That would indeed be nice, but this is rather deeply entrenched API.
As it stands, as long as glibc still defines _PATH_MOUNTED  as
/etc/mtab, tons of software gets compiled with this path. So I hope
that https://sourceware.org/bugzilla/show_bug.cgi?id=19108 gets fixed,
and in a few years when software gets rebuilt we might indeed be able
to drop it completely.

But there's also still a lot of stuff which hardcodes /etc/mtab:
http://codesearch.debian.net/results/%2Fetc%2Fmtab/page_0 (most of it
should be noise, but there's some actual hits)

So, yay for the legacy of many decades of a Unix misdesign :-/

Our own plumbing stuff should be fairly okay now. util-linux 2.27.1
will disregard /etc/mtab completely, systemd doesn't care, udisks etc.
also don't. But the world is bigger than that.

Martin

-- 
Martin Pitt                        | http://www.piware.de
Ubuntu Developer (www.ubuntu.com)  | Debian Developer  (www.debian.org)



More information about the ubuntu-devel mailing list