I finally understand what's going on. This started a few weeks ago when
we got lxcfs. What happens:

 - lxcfs' upstart job and systemd unit have this gem:
     sed -i "/^lxcfs \/var\/lib\/lxcfs fuse.lxcfs/d" /etc/mtab
  
   This will turn /etc/mtab into a file if it was a symlink to /proc/mounts. 
But these days we actually want it to be a symlink, as /etc/mtab as a static 
file is just a braindead and broken concept.

 - When systemd starts up, it parses existing mounts (via /etc/mtab) and
creates mounts for them. This will include all the old mounts from the
previous boot due to the previous issue. That's what triggers all these
"dead -> mounted" transitions for all mounts right at the beginning of
boot. But as the backing devices of them aren't discovered/there yet,
but a mount unit is always bound to its underlying device unit, systemd
cleans them up, i. e. stops them. This is usually meant for cleaning
stale mounts from unplugged devices; it also makes sense here as these
mounts indeed are not mounted at the moment.

 - Later on, the fstab generated mounts are actually being executed. But
this races with the async mount cleanup handler from above, so depending
on the particular machine, installed services, and current wind speed it
may happen at a harmless (before the fstab mounts) or at a bad time
(after the fstab mounts).

 - Even later, our debian-fixup.service transitions /etc/mtab from a
file to a symlink. This is supposed to be an one-time migration, but
lxcfs always reverts that during shutdown.

** Also affects: lxcfs (Ubuntu)
   Importance: Undecided
       Status: New

** Changed in: lxcfs (Ubuntu)
   Importance: Undecided => High

** Changed in: lxcfs (Ubuntu)
       Status: New => Triaged

** Changed in: lxcfs (Ubuntu)
     Assignee: (unassigned) => Martin Pitt (pitti)

** Changed in: systemd (Ubuntu)
       Status: Confirmed => In Progress

** Changed in: lxcfs (Ubuntu)
       Status: Triaged => In Progress

** Summary changed:

- systemd unmounts partitions from fstab
+ systemd unmounts partitions from fstab when lxcfs is installed

** Summary changed:

- systemd unmounts partitions from fstab when lxcfs is installed
+ systemd unmounts mounted filesystems when lxcfs is installed

-- 
You received this bug notification because you are a member of Ubuntu
Bugs, which is subscribed to Ubuntu.
https://bugs.launchpad.net/bugs/1419623

Title:
  systemd unmounts mounted filesystems when lxcfs is installed

To manage notifications about this bug go to:
https://bugs.launchpad.net/ubuntu/+source/lxcfs/+bug/1419623/+subscriptions

-- 
ubuntu-bugs mailing list
[email protected]
https://lists.ubuntu.com/mailman/listinfo/ubuntu-bugs

Reply via email to