[systemd-devel] Is there a reason to forcefully create /etc/mtab?

Lennart Poettering lennart at poettering.net
Sun Jul 6 12:12:42 PDT 2014


On Sun, 06.07.14 13:44, Leonid Isaev (lisaev at umail.iu.edu) wrote:

> > > I think the path matching is a little naive; Using a simple string
> > > comparison, "/proc/self/mounts" != "../proc/self/mounts" even though
> > > both paths refer to the same object.
> > 
> > No, they aren't referring to the same object. This makes a difference
> > when you mount a "foreign" system image for maintainance.
> 
> Cool :(
> 
> So... the solution would be for distro packages to ship mtab as a symlink to
> "../proc" instead of "/proc"?

Well, it's slightly nicer to use relative symlinks for things like this,
since this means that if you install an OS hierarchy into some
subdirectory somewhere the symlinks will always point to files inside of
the hierarchy, and not into the host's OS hierarchy, if you follow what
I mean.

I figure we should fix tmpfiles to understand that relative and absolute
symlinks are both OK, even though it should probably create only
relative symlinks.

Lennart

-- 
Lennart Poettering, Red Hat


More information about the systemd-devel mailing list