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

Zbigniew Jędrzejewski-Szmek zbyszek at in.waw.pl
Sun Jul 6 11:13:56 PDT 2014


On Sun, Jul 06, 2014 at 01:44:05PM -0400, Leonid Isaev wrote:
> On Sun, Jul 06, 2014 at 09:15:28PM +0400, Ivan Shapovalov wrote:
> > On Sunday 06 July 2014 at 13:13:55, Mike Gilbert wrote:	
> > > On Sun, Jul 6, 2014 at 1:08 PM, Ivan Shapovalov <intelfx100 at gmail.com> wrote:
> > > > On Sunday 06 July 2014 at 13:01:22, Leonid Isaev wrote:
> > > >> Hi,
> > > >>
> > > >>       I have a read-only / filesystem and /etc/mtab points to
> > > >> /proc/self/mounts as it should.
> > > >>       So, in systemd-215 tmpfile.d fails to create a symbolic link /etc/mtab
> > > >> because /usr/lib/tmpfiles.d/etc.conf contains is a line "L+ /etc/mtab - - - -
> > > >> ../proc/self/mounts".
> > > >>       Is this intentional? Besides failing on ro /, it is also confusing
> > > >> because /etc/mtab can be supplied by a package (in archlinux, the 'filesystem'
> > > >> package), so why tmpfiles instead of including this symlink with systemd?
> > > >>       The same question applies to the entire etc.conf: why does tmpfiles
> > > >> touch /etc at all, especially if /etc is already properly set up?
> > > >>
> > > >> Thanks,
> > > >>
> > > >
> > > > L+ (as well as any other "+" directives) only force-overwrite files if this is
> > > > needed, e. g. if a symlink points to the wrong desination.
> > > >
> > > 
> > > Right.
> > > 
> > > 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"?
No, the latter is fine, or even better. The solution is for systmed-tmpfiles
to stop complaining when the fs is readonly.

Zbyszek


More information about the systemd-devel mailing list