[systemd-devel] dev-root.device is not active, results in an umount spree
martin.pitt at ubuntu.com
Mon May 18 05:37:42 PDT 2015
Lennart Poettering [2015-05-18 14:10 +0200]:
> I don't really grok what the problem you are experencing is supposed
> to be: note that a device showing up in /proc/self/mountinfo means it
> will be set to "tentative" state, and thus will not resolve in an
> unmount. What more do you need?
Exactly, that's what these patches do.
> The whole point of the "tentative" state is that devices showing up in
> /proc/self/mountinfo but not in /sys are put in it. Are you saying
> that does not work?
Right. As I said, the problem is that when /mountinfo is being read,
.device units (with state tentative/found == MOUNT) are not actually
being created, despite the comment saying so. They are created later,
rather unintentionally, in unit_add_node_link() which calls
manager_load_unit(); but the latter always just creates stubs with
state "dead", and never sets any proper state.
> Generally, dependencies should not be generated depending on state.
> Dependencies should be static as much as possible, and sometimes
> augmented as we load in more units, but the very clear focus needs
> to be to keep them as static as possible. Acting on them should be
> dynamic however, and hence our state engines for the units should be
> optimized to reflect the unit state as fine-grained as necessary.
> I don't understand your patch I must say, but from what I grok it
> appears to make deps dynamic, based on state, and that's something I
> really don't like.
No, it just fixes the creation of the .device units to happen at the
right and intended time (when we actually have a proper state), and
thus have the intended state "tentative" instead of "dead".
Martin Pitt | http://www.piware.de
Ubuntu Developer (www.ubuntu.com) | Debian Developer (www.debian.org)
More information about the systemd-devel