nbd-client and systemd

Felipe Sateler fsateler at debian.org
Wed Jul 15 14:00:07 BST 2015


On 15 July 2015 at 04:34, Wouter Verhelst <wouter at debian.org> wrote:
> Hi folks,
>
> nbd-client ships with an init script that does two things:
> - If we're doing root-on-NBD, write the correct sysvinit sendsigs.omit.d file
>   so that the nbd-client process serving the root filesystem doesn't get killed
>   from under us at shutdown
> - Connect nbd devices based on configuration in /etc/nbd-client.
>
> The former just needs to happen at some time before shutdown, so it
> doesn't really matter when this happens. Also, for systemd this isn't
> required, instead we need to change our argv[0] to get the same
> functionality, which has already happened for nbd-client in 1:3.8-2.

I think systemd units should in general do one thing each. So if there
is still 1. to be done (its not clear to me what you mean by happened
already), it should be done in a unit separate from the nbd-client
units.

>
> The latter requires that it at a point before mountnfs.sh (since we set
> the option _netdev), so that we just need to deal with connecting (and
> mountnfs.sh will deal with mounting). This requires nbd-client to be an
> rcS.d script.
>
> I talked to systemd upstream a while back, and they suggested that I
> create an nbd unit generator thingamajing, which would work similarly to
> fstab-generator. I've been looking into this, but it hasn't happened
> yet, mainly due to lack of time. However, recently I found out about the
> systemd-no-service-for-init-rcS-script lintian error, which triggers for
> nbd-client. I'm afraid that if I create such a unit generator, this
> would still trigger.

Yes, it would still trigger, and the warning would be correct: you
would be running nbd init setup twice! Once for the nbd-generator and
once for the init script.


> Is that correct? If so, is there another way in which I can ship an
> nbd-client initscript for the benefit of !systemd installations, while
> still not using it for systemd installations? Dropping that init script
> is not something I wish to do.

As Ansgar mentioned, just ship a symlink to /dev/null named
/lib/systemd/system/$name.service. If the lintian error is not
silenced, please file a bug so that it is fixed. Feel free to CC me on
that bug since I wrote the rcS test.

-- 

Saludos,
Felipe Sateler




More information about the Pkg-systemd-maintainers mailing list