On Mon, Oct 14, 2013 at 4:03 PM, David Leverton <[email protected]> wrote: > So to work around that limitation we insist that everyone change how their > systems are set up, and still have to reintroduce mtab under a different > name ("utab", hidden away under /run) because /proc/self/mounts *doesn't* > contain everything that's supposed to be in mtab after all?
The whole design of /etc/mtab is broken. It isn't a list of everything that is mounted - it is a list of everything done by the mount command (the command - not the system call). The handbook even has a line about having to manually populate it before running grub since it is flat-out wrong when you're in a chroot. There are lots of things that can cause it to get out-of-sync. Perhaps there are edge cases where the symlink isn't sufficient - that's what this thread is all about. However, I've never liked the design of mtab. It isn't surprising to me that distros are largely ditching it. > /etc/resolv.conf As Mike already pointed out, resolution is actually a userspace function entirely (I'm not sure if I were designing things from scratch that I'd put it in the C library, but...). However, if you want to know the hostname, you should be calling uname and not looking around for /etc/hostname or whatever. The kernel will tell you the truth as it applies to your process, not what you think should be the truth based on what amounts to a logfile. Rich
