]> xenbits.xensource.com Git - libvirt.git/commitdiff
libvirt-guests: Fix dependency ordering in service file
authorMartin Kletzander <mkletzan@redhat.com>
Tue, 30 Aug 2022 06:29:53 +0000 (08:29 +0200)
committerMartin Kletzander <mkletzan@redhat.com>
Mon, 26 Sep 2022 11:04:48 +0000 (13:04 +0200)
After some debugging and discussion with systemd team it turns out we
are misusing the ordering in libvirt-guests.service.  That happened
because we want to support both monolithic and modular daemon setups and
on top of that we also want to support socket activation and services
without socket activation.  Unfortunately this is impossible to express
in the unit file because of how transactions are handled in systemd when
dependencies are resolved and multiple actions (jobs) are queued.  For
explanation from Michal Sekletar see comment #7 in the BZ this patch is
fixing:

https://bugzilla.redhat.com/show_bug.cgi?id=1964855#c7

In order to support all the scenarios this patch also amends the
manpages so that users that are changing the default can also read how
to correct the dependency ordering in libvirt-guests unit file.

Ideally we would also keep the existing configuration during upgrade,
but due to our huge support matrix this seems hardly feasible as it
could introduce even more problems.

Signed-off-by: Martin Kletzander <mkletzan@redhat.com>
Reviewed-by: Michal Privoznik <mprivozn@redhat.com>
docs/manpages/libvirtd.rst
docs/manpages/virtlxcd.rst
docs/manpages/virtqemud.rst
docs/manpages/virtvboxd.rst
docs/manpages/virtvzd.rst
docs/manpages/virtxend.rst
tools/libvirt-guests.service.in

index ee72f08382217bd09d3d16a4e18a3bf30505263a..1347b9b210424055b870bb277b74d9b92aaffee7 100644 (file)
@@ -79,6 +79,20 @@ unit files must be masked:
    $ systemctl mask libvirtd.socket libvirtd-ro.socket \
       libvirtd-admin.socket libvirtd-tls.socket libvirtd-tcp.socket
 
+If using libvirt-guests service then the ordering for that service needs to be
+adapted so that it is ordered after the service unit instead of the socket unit.
+Since dependencies and ordering cannot be changed with drop-in overrides, the
+whole libvirt-guests unit file needs to be changed.  In order to preserve such
+change copy the installed ``/usr/lib/systemd/system/libvirt-guests.service`` to
+``/etc/systemd/system/libvirt-guests.service`` and make the change there,
+specifically make sure the ``After=`` ordering mentions ``libvirtd.service`` and
+not ``libvirtd.socket``:
+
+::
+
+   [Unit]
+   After=libvirtd.service
+
 
 OPTIONS
 =======
index 2e9d8fd14bbbb734bb735af0467ff79fdb48e9b0..aebc8adb5822c12e820c91fe07ce924c185f2716 100644 (file)
@@ -60,6 +60,20 @@ unit files must be masked:
    $ systemctl mask virtlxcd.socket virtlxcd-ro.socket \
       virtlxcd-admin.socket
 
+If using libvirt-guests service then the ordering for that service needs to be
+adapted so that it is ordered after the service unit instead of the socket unit.
+Since dependencies and ordering cannot be changed with drop-in overrides, the
+whole libvirt-guests unit file needs to be changed.  In order to preserve such
+change copy the installed ``/usr/lib/systemd/system/libvirt-guests.service`` to
+``/etc/systemd/system/libvirt-guests.service`` and make the change there,
+specifically make sure the ``After=`` ordering mentions ``virtlxcd.service`` and
+not ``virtlxcd.socket``:
+
+::
+
+   [Unit]
+   After=virtlxcd.service
+
 
 OPTIONS
 =======
index ea8d6e3105db0174b7816ede819081327c1542fd..fa9a6ce3755c7db26459c08cc19950e513a6b228 100644 (file)
@@ -60,6 +60,20 @@ unit files must be masked:
    $ systemctl mask virtqemud.socket virtqemud-ro.socket \
       virtqemud-admin.socket
 
+If using libvirt-guests service then the ordering for that service needs to be
+adapted so that it is ordered after the service unit instead of the socket unit.
+Since dependencies and ordering cannot be changed with drop-in overrides, the
+whole libvirt-guests unit file needs to be changed.  In order to preserve such
+change copy the installed ``/usr/lib/systemd/system/libvirt-guests.service`` to
+``/etc/systemd/system/libvirt-guests.service`` and make the change there,
+specifically make sure the ``After=`` ordering mentions ``virtqemud.service`` and
+not ``virtqemud.socket``:
+
+::
+
+   [Unit]
+   After=virtqemud.service
+
 
 OPTIONS
 =======
index d7339d99f22bf759f8c263b97a5455933ec7ec71..f90de3451d8dab2dca044142fc7d50239cc67602 100644 (file)
@@ -58,6 +58,20 @@ unit files must be masked:
    $ systemctl mask virtvboxd.socket virtvboxd-ro.socket \
       virtvboxd-admin.socket
 
+If using libvirt-guests service then the ordering for that service needs to be
+adapted so that it is ordered after the service unit instead of the socket unit.
+Since dependencies and ordering cannot be changed with drop-in overrides, the
+whole libvirt-guests unit file needs to be changed.  In order to preserve such
+change copy the installed ``/usr/lib/systemd/system/libvirt-guests.service`` to
+``/etc/systemd/system/libvirt-guests.service`` and make the change there,
+specifically make sure the ``After=`` ordering mentions ``virtvboxd.service`` and
+not ``virtvboxd.socket``:
+
+::
+
+   [Unit]
+   After=virtvboxd.service
+
 
 OPTIONS
 =======
index 42dfa263e450f39fc219787b6276c0836a2871da..970719aac1d5181b302adfb4dd122e34b8137ca2 100644 (file)
@@ -60,6 +60,20 @@ unit files must be masked:
    $ systemctl mask virtvzd.socket virtvzd-ro.socket \
       virtvzd-admin.socket
 
+If using libvirt-guests service then the ordering for that service needs to be
+adapted so that it is ordered after the service unit instead of the socket unit.
+Since dependencies and ordering cannot be changed with drop-in overrides, the
+whole libvirt-guests unit file needs to be changed.  In order to preserve such
+change copy the installed ``/usr/lib/systemd/system/libvirt-guests.service`` to
+``/etc/systemd/system/libvirt-guests.service`` and make the change there,
+specifically make sure the ``After=`` ordering mentions ``virtvzd.service`` and
+not ``virtvzd.socket``:
+
+::
+
+   [Unit]
+   After=virtvzd.service
+
 
 OPTIONS
 =======
index b08346b489d2518b1c9ef83e63872e4973e7e12f..cf7685ecc0e66632392ea64a82444ab71914b431 100644 (file)
@@ -60,6 +60,20 @@ unit files must be masked:
    $ systemctl mask virtxend.socket virtxend-ro.socket \
       virtxend-admin.socket
 
+If using libvirt-guests service then the ordering for that service needs to be
+adapted so that it is ordered after the service unit instead of the socket unit.
+Since dependencies and ordering cannot be changed with drop-in overrides, the
+whole libvirt-guests unit file needs to be changed.  In order to preserve such
+change copy the installed ``/usr/lib/systemd/system/libvirt-guests.service`` to
+``/etc/systemd/system/libvirt-guests.service`` and make the change there,
+specifically make sure the ``After=`` ordering mentions ``virtxend.service`` and
+not ``virtxend.socket``:
+
+::
+
+   [Unit]
+   After=virtxend.service
+
 
 OPTIONS
 =======
index 3cf6476196126bc879bc4b1fbe5714711006b2c0..1c569c320dfdf9351e1345d9a9af9bb1be8d2fb1 100644 (file)
@@ -9,12 +9,6 @@ After=virtlxcd.socket
 After=virtvboxd.socket
 After=virtvzd.socket
 After=virtxend.socket
-After=libvirtd.service
-After=virtqemud.service
-After=virtlxcd.service
-After=virtvboxd.service
-After=virtvzd.service
-After=virtxend.service
 After=virt-guest-shutdown.target
 Documentation=man:libvirt-guests(8)
 Documentation=https://libvirt.org