Bug#868450: Make usage of fstab-decode optional

Wouter Verhelst w at uter.be
Mon Jul 17 11:21:39 BST 2017


On Sat, Jul 15, 2017 at 11:10:22PM +0200, Michael Biebl wrote:
> Hi Christian,
> 
> thanks a lot for your detailed reply!
> 
> I've CCed the pkg-systemd-maintainers m-l and Wouter, as the maintainer
> of nbd.

Right, thanks.

I had gotten nbd working properly in combination with systemd in stretch
during dc16, but somehow it stopped working before the release (and I
only found out like a week or so before the release, way too late to fix
it).

As chance would have it, I was on an airplane yesterday and spent some
time debugging things. I managed to get things to almost work on a VM
(the block device gets yanked away at the wrong time during shutdown
still, and there's another issue for which you must just have seen a bug
report appear), but at least it's almost back to functional now.

What I found works is that nbd at .service has this:

(...)
[Unit]
After=network-online.target
DefaultDependencies=no
Conflicts=shutdown.target
[Install]
RequiredBy=dev-%i.device
RequiredBy=dev-%ip1.device
RequiredBy=dev-%ip2.device
(... etc, for fifteen partitions ...)

It *should* also need a "Before=dev-%i.device", which *used* to work
(back at dc16), but stopped working some time between then and now.

However, that only supports nbd devices that are configured in fstab and
nbdtab. Things that are configured manually don't work that way.

I agree that it is necessary to make systemd be aware of the connection
that exists between some block devices and the user setup that is
necessary for them to appear. Currently it doesn't, and I managed to
somewhat get it to work before, but essentially that was just a hack.
This support would be necessary for AoE devices too, btw.

Ideally, the link between the userspace setup and the block device would
be something that could be discovered by udev and signalled to systemd
by way of a variable there (like, say, the SYSTEMD_READY thing that is
set on unconnected nbd devices now). That way, you could set a udev rule
declaring the link between a service and a device, and it would work
regardless of whether the mount is done manually.

> You raise some good points. Maybe this is something you could bring up
> on the upstream mailing list? It seems like it should be discussed there
> and it would be really helpful if someone knowledgeable in this area has
> this conversation there.

I was actually considering doing something like this myself, since as
per the above I'd come to a similar conclusion. Systemd currently
doesn't seem to understand that it is necessary, and that's a problem.
Thanks for bringing it up first.

(actually, I was also hoping to catch you during dc17 in Montreal, if
you're going, so we can possibly discuss this in person)

-- 
Could you people please use IRC like normal people?!?

  -- Amaya Rodrigo Sastre, trying to quiet down the buzz in the DebConf 2008
     Hacklab




More information about the Pkg-systemd-maintainers mailing list