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,

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.

$ grep Also /lib/systemd/system/libvirtd.service

And due to that

   dh_installsystemd -p libvirt-daemon-system --restart-after-upgrade

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'

- would you agree that due to the issues in discussion
dh_installsystem should change the order to always start with the

More information about the Pkg-systemd-maintainers mailing list