make snappy's /etc/mtab symlink agree to tmpfiles.d/debian.conf

Bug #1547033 reported by Oliver Grawert
6
This bug affects 1 person
Affects Status Importance Assigned to Milestone
Snappy
Fix Released
Medium
Unassigned
livecd-rootfs (Ubuntu)
Fix Released
Medium
Oliver Grawert
systemd (Ubuntu)
Invalid
Medium
Unassigned

Bug Description

booting a snappy system which comes with a readonly file system that carries /etc/mtab as pre-created link in the readonly area of the fs (pointing to /proc/mounts), we always get an error message on boot when systemd-tmpfiles tries to re-create the mtab link.

systemd-tmpfiles should instead check if /etc/mtab is already there, is a link and points to the desired target. in this case it should just skip the creation attempt gracefully without error.

Feb 17 18:56:51 localhost systemd[1]: Starting Create Volatile Files and Directories...
Feb 17 18:56:51 localhost systemd-tmpfiles[631]: [/usr/lib/tmpfiles.d/var.conf:14] Duplicate line for path "/var/log"
, ignoring.
Feb 17 18:56:51 localhost systemd-tmpfiles[631]: symlink(../proc/self/mounts, /etc/mtab) failed: Read-only file syste
m
Feb 17 18:56:51 localhost systemd[1]: systemd-tmpfiles-setup.service: Main process exited, code=exited, status=1/FAIL
URE

Oliver Grawert (ogra)
affects: systemd → snappy
Changed in snappy:
importance: Undecided → Medium
Changed in systemd (Ubuntu):
importance: Undecided → Medium
Revision history for this message
Martin Pitt (pitti) wrote :

tmpfiles already checks if the symlink is the same if it already exists. However, in this case it's not literally the same: your's points to /proc/mounts while /usr/lib/tmpfiles.d/debian.conf makes it point to ../proc/self/mounts. If these were the same, this error would disappear.

Now, /etc/mtab → /proc/mounts is a waste as /proc/mounts is already a symlink to self/mounts, so you need to resolve symlinks twice. The "../" is so that this works with different --root arguments, i. e. if you want to do things with such an image when you mount it somewhere.

Can I convince you to change the snappy image to have /etc/mtab → ../proc/self/mounts ? If not, could we at least agree to → /proc/self/mounts to avoid the double resolution?

summary: - please allow /etc/mtab to be a pre-existing link on readonly filesystems
+ make snappy's /etc/mtab symlink agree to tmpfiles.d/debian.conf
Changed in systemd (Ubuntu):
status: New → Incomplete
Revision history for this message
Oliver Grawert (ogra) wrote :

sadly even with making the link point to /proc/self7mounts it still happens:

Mar 23 11:55:12 localhost systemd-tmpfiles[628]: [/usr/lib/tmpfiles.d/var.conf:14] Duplicate line for path "/var/log", ignoring.
Mar 23 11:55:12 localhost systemd-tmpfiles[628]: symlink(../proc/self/mounts, /etc/mtab) failed: Read-only file system
Mar 23 11:55:12 localhost systemd[1]: systemd-tmpfiles-setup.service: Main process exited, code=exited, status=1/FAILURE

Changed in systemd (Ubuntu):
status: Incomplete → Confirmed
Revision history for this message
Oliver Grawert (ogra) wrote :

hmm, i just noticed the symlink in debian.conf is relative, not absolute ... so trying that again with two dots in front :)

Revision history for this message
Martin Pitt (pitti) wrote :

> /proc/self7mounts

The current config file says ../proc/self/mounts, did you try that?

Revision history for this message
Oliver Grawert (ogra) wrote :

yes, uploaded that this morning, i can check with tomorrows image if livecd-rootfs makes it out of the beta queue before (currently in "needs approval" state)

Revision history for this message
Oliver Grawert (ogra) wrote :

seems to work fine now ... closing

Changed in systemd (Ubuntu):
status: Confirmed → Invalid
Changed in snappy:
status: New → Fix Released
Changed in livecd-rootfs (Ubuntu):
status: New → Fix Released
importance: Undecided → Medium
assignee: nobody → Oliver Grawert (ogra)
To post a comment you must log in.
This report contains Public information  
Everyone can see this information.

Other bug subscribers

Remote bug watches

Bug watches keep track of this bug in other bug trackers.