Bug#955483: Alphanumeric ordering of depending sockets breaks restart

Christian Ehrhardt christian.ehrhardt at canonical.com
Thu Apr 2 11:45:00 BST 2020


On Thu, Apr 2, 2020 at 10:54 AM Michael Biebl <biebl at debian.org> wrote:
>
> I don't think this is going to work.
>
> You'll need to restart both the service and socket in the correct order,

@Michael:
I have tried "systemctl restart service socket socket" before and it works.
But I was wondering if it might work just by accident, due to the service being
not yet fully up when the sockets restart. And I was unsure if this
could be racy.
Are you saying this is "the right order" and this way around systemd
will take care
that service and sockets won't collide in a bad way?

> i.e.
>
> systemctl restart libvirtd.service libvirtd.socket
>

In that case - as initially suggested when I filed against debhelper -
at least the
ordering of dh_installsystemd would need to ensure that it does not order
everything alphabetically but instead start with the service followed by all th
rest it picks up.

Today:
$ grep Also /lib/systemd/system/libvirtd.service
Also=virtlockd.socket
Also=virtlogd.socket
Also=libvirtd.socket
Also=libvirtd-ro.socket

And due to that

   dh_installsystemd -p libvirt-daemon-system --restart-after-upgrade
libvirtd.service

Gets generated into postinst as:

deb-systemd-invoke $_dh_action 'libvirtd-ro.socket' 'libvirtd.service'
'libvirtd.socket' 'virtlockd.socket' 'virtlogd.socket'

Triggering exactly that issue that we discuss here.

If it would generate the following it would work (I tried)
deb-systemd-invoke $_dh_action 'libvirtd.service' 'libvirtd-ro.socket'
'libvirtd.socket' 'virtlockd.socket' 'virtlogd.socket'

@Michael:
- would you agree that due to the issues in discussion
dh_installsystem should change the order to always start with the
service?



More information about the Pkg-systemd-maintainers mailing list