From nobody Sat May 18 06:50:40 2024 Delivered-To: importer@patchew.org Received-SPF: pass (zohomail.com: domain of redhat.com designates 170.10.129.124 as permitted sender) client-ip=170.10.129.124; envelope-from=libvir-list-bounces@redhat.com; helo=us-smtp-delivery-124.mimecast.com; Authentication-Results: mx.zohomail.com; dkim=pass; spf=pass (zohomail.com: domain of redhat.com designates 170.10.129.124 as permitted sender) smtp.mailfrom=libvir-list-bounces@redhat.com; dmarc=pass(p=none dis=none) header.from=redhat.com ARC-Seal: i=1; a=rsa-sha256; t=1661841875; cv=none; d=zohomail.com; s=zohoarc; b=F9vFJVkMSEq/DrwQLoHN9sMPJcFLQkH9fvDkxTLohVLC+z0z5bGufvv4/rz1R35+W+26eQRMkXIQk/FESY0K4Vs/9T5qbFRRFw//z4PA57CCPnMZKEqUN4BUukmXEOJer7196ePIIuTiSrVGwuG/4q83jtBJ89w+aorvFi8r0CU= ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=zohomail.com; s=zohoarc; t=1661841875; h=Content-Type:Content-Transfer-Encoding:Cc:Date:From:List-Subscribe:List-Post:List-Id:List-Archive:List-Help:List-Unsubscribe:MIME-Version:Message-ID:Sender:Subject:To; bh=XkDzJeuAVYGYVMHG0omBryhchARAdXBvbUmZbaLqlgs=; b=CUwcOMHvw4PDim6SSLBKOV/D9VdMPAnbqtQUzd35eBT+HbncYalsVSR7gXaiTH8fyeCzFEMuny7rQxzazl4nOaJBkbITSTTfwN8qHG4mhx5bcWBjWcrZOhGISPe/flwl0sabCB9U225BeiBA23y2Ip7Ms8sZ/VwNQa5YxPfTPlI= ARC-Authentication-Results: i=1; mx.zohomail.com; dkim=pass; spf=pass (zohomail.com: domain of redhat.com designates 170.10.129.124 as permitted sender) smtp.mailfrom=libvir-list-bounces@redhat.com; dmarc=pass header.from= (p=none dis=none) Return-Path: Received: from us-smtp-delivery-124.mimecast.com (us-smtp-delivery-124.mimecast.com [170.10.129.124]) by mx.zohomail.com with SMTPS id 1661841875771260.54567506577393; Mon, 29 Aug 2022 23:44:35 -0700 (PDT) Received: from mimecast-mx02.redhat.com (mx3-rdu2.redhat.com [66.187.233.73]) by relay.mimecast.com with ESMTP with STARTTLS (version=TLSv1.2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id us-mta-655-HqntL58oOyq3shJ-foamjg-1; Tue, 30 Aug 2022 02:44:33 -0400 Received: from smtp.corp.redhat.com (int-mx10.intmail.prod.int.rdu2.redhat.com [10.11.54.10]) (using TLSv1.2 with cipher AECDH-AES256-SHA (256/256 bits)) (No client certificate requested) by mimecast-mx02.redhat.com (Postfix) with ESMTPS id DFFA72999B45; Tue, 30 Aug 2022 06:44:30 +0000 (UTC) Received: from mm-prod-listman-01.mail-001.prod.us-east-1.aws.redhat.com (unknown [10.30.29.100]) by smtp.corp.redhat.com (Postfix) with ESMTP id 24A71492C3B; Tue, 30 Aug 2022 06:44:29 +0000 (UTC) Received: from mm-prod-listman-01.mail-001.prod.us-east-1.aws.redhat.com (localhost [IPv6:::1]) by mm-prod-listman-01.mail-001.prod.us-east-1.aws.redhat.com (Postfix) with ESMTP id F2C891946A42; Tue, 30 Aug 2022 06:44:28 +0000 (UTC) Received: from smtp.corp.redhat.com (int-mx10.intmail.prod.int.rdu2.redhat.com [10.11.54.10]) by mm-prod-listman-01.mail-001.prod.us-east-1.aws.redhat.com (Postfix) with ESMTP id 7FB1A1946A40 for ; Tue, 30 Aug 2022 06:44:28 +0000 (UTC) Received: by smtp.corp.redhat.com (Postfix) id 22767401473; Tue, 30 Aug 2022 06:44:28 +0000 (UTC) Received: from mimecast-mx02.redhat.com (mimecast07.extmail.prod.ext.rdu2.redhat.com [10.11.55.23]) by smtp.corp.redhat.com (Postfix) with ESMTPS id 1E6FE492C3B for ; Tue, 30 Aug 2022 06:44:28 +0000 (UTC) Received: from us-smtp-1.mimecast.com (us-smtp-delivery-1.mimecast.com [205.139.110.120]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by mimecast-mx02.redhat.com (Postfix) with ESMTPS id 053D83C1022D for ; Tue, 30 Aug 2022 06:44:28 +0000 (UTC) Received: from mail-ed1-f71.google.com (mail-ed1-f71.google.com [209.85.208.71]) by relay.mimecast.com with ESMTP with STARTTLS (version=TLSv1.3, cipher=TLS_AES_128_GCM_SHA256) id us-mta-618-DmwRzviQPFmRITKviFsSrQ-1; Tue, 30 Aug 2022 02:44:26 -0400 Received: by mail-ed1-f71.google.com with SMTP id p4-20020a056402500400b00447e8b6f62bso6817179eda.17 for ; Mon, 29 Aug 2022 23:44:26 -0700 (PDT) Received: from wheatley.localdomain (nat-pool-brq-t.redhat.com. [213.175.37.10]) by smtp.gmail.com with ESMTPSA id g2-20020a17090604c200b00731803d4d04sm5301142eja.82.2022.08.29.23.44.24 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Mon, 29 Aug 2022 23:44:24 -0700 (PDT) Received: from wheatley.redhat.com (wheatley.k8r.cz [127.0.0.1]) by wheatley.localdomain (Postfix) with ESMTP id 1F94891DE7DF; Tue, 30 Aug 2022 08:44:24 +0200 (CEST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=redhat.com; s=mimecast20190719; t=1661841874; h=from:from:sender:sender:reply-to:subject:subject:date:date: message-id:message-id:to:to:cc:cc:mime-version:mime-version: content-type:content-type: content-transfer-encoding:content-transfer-encoding:list-id:list-help: list-unsubscribe:list-subscribe:list-post; bh=XkDzJeuAVYGYVMHG0omBryhchARAdXBvbUmZbaLqlgs=; b=KWUIpSiv18yWlUQeIisVaoV/4gY4iB6loJZU0njJdZ+IXnt60W/tGY14W+1mBZnmtz9k7E 3pkx/ZVjQDH1cYIzoeNqlppT/DblQ6udUHbMNCrGgfDXd+k4x23elxFfI4jxyg3dqlC+FN m+hU4cV85TBUmlNlXXiAqXapngaemOo= X-MC-Unique: HqntL58oOyq3shJ-foamjg-1 X-Original-To: libvir-list@listman.corp.redhat.com X-MC-Unique: DmwRzviQPFmRITKviFsSrQ-1 X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20210112; h=content-transfer-encoding:mime-version:message-id:date:subject:cc :to:from:x-gm-message-state:from:to:cc; bh=XkDzJeuAVYGYVMHG0omBryhchARAdXBvbUmZbaLqlgs=; b=lVPybRhWngi3L/1/pTX8sc5uHMybK2QrYPR8pnyvF2ByIIqGRy75nE7voOS/YNOzkr H8ua0pFGvRrLxWOvpfu3OlOMfguvoIH5hPYpExsxAGY5wP8tnJwcDFH9xmY7wLcJeoKi QMBboUckMwMnTg5uqB/N/AXPiJkF4TtlZoLTw1D4FRz1ec5iLaw+ODTUiY6ck4EMyC9a IfzldJ5re/sMwn81+t2X7XxQJT3wAv2wUdv861ayHX+VDi7DO5AMLg+Cd0iq1/5C9Zyh 6cpw9kNRwNHnDdFQ4Zd8UtWUDAu+qx5H1c6cdnrQidenG1P0JcxIBkTawb9Aug4RxrIV Z0eA== X-Gm-Message-State: ACgBeo0R+YAtzpOYyGN4atmgg3p/+C083DfxRaCj1eWCoky45jj+zS+1 TjjIOiloaccp8CkbTr3KV4JLeMGLHcN7syqBqlqfz8XEhYZ8i68fRRjfezSVGumHuHW/rUSEHUs 91M1V4Ml4xKT6jupJmsTMkePjmptVTBltKYiecBdVU85IQiL7s1jPyXLTNJW/4zWesujtEkY= X-Received: by 2002:aa7:cdcc:0:b0:447:bac0:4c20 with SMTP id h12-20020aa7cdcc000000b00447bac04c20mr18284538edw.183.1661841865638; Mon, 29 Aug 2022 23:44:25 -0700 (PDT) X-Google-Smtp-Source: AA6agR6rkNWJ7eeRMB7z5DUg+UYL2+7JYUzG6/UjTr4g5Qd2cTPyBUIVmkLH42ywzlXQdlmK6CyqAQ== X-Received: by 2002:aa7:cdcc:0:b0:447:bac0:4c20 with SMTP id h12-20020aa7cdcc000000b00447bac04c20mr18284521edw.183.1661841865300; Mon, 29 Aug 2022 23:44:25 -0700 (PDT) From: Martin Kletzander To: libvir-list@redhat.com Subject: [PATCH] libvirt-guests: Fix dependency ordering in service file Date: Tue, 30 Aug 2022 08:43:47 +0200 Message-Id: MIME-Version: 1.0 X-Scanned-By: MIMEDefang 2.85 on 10.11.54.10 X-BeenThere: libvir-list@redhat.com X-Mailman-Version: 2.1.29 Precedence: list List-Id: Development discussions about the libvirt library & tools List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Cc: msekleta@redhat.com Errors-To: libvir-list-bounces@redhat.com Sender: "libvir-list" X-Scanned-By: MIMEDefang 2.85 on 10.11.54.10 X-Mimecast-Spam-Score: 0 X-Mimecast-Originator: redhat.com Content-Transfer-Encoding: quoted-printable X-ZohoMail-DKIM: pass (identity @redhat.com) X-ZM-MESSAGEID: 1661841876047100001 Content-Type: text/plain; charset="utf-8"; x-default="true" 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=3D1964855#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 Reviewed-by: Michal Privoznik --- docs/manpages/libvirtd.rst | 14 ++++++++++++++ docs/manpages/virtlxcd.rst | 14 ++++++++++++++ docs/manpages/virtqemud.rst | 14 ++++++++++++++ docs/manpages/virtvboxd.rst | 14 ++++++++++++++ docs/manpages/virtvzd.rst | 14 ++++++++++++++ docs/manpages/virtxend.rst | 14 ++++++++++++++ tools/libvirt-guests.service.in | 6 ------ 7 files changed, 84 insertions(+), 6 deletions(-) diff --git a/docs/manpages/libvirtd.rst b/docs/manpages/libvirtd.rst index ee72f0838221..1347b9b21042 100644 --- a/docs/manpages/libvirtd.rst +++ b/docs/manpages/libvirtd.rst @@ -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 =20 +If using libvirt-guests service then the ordering for that service needs t= o 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=3D`` ordering mentions ``libvirtd.servi= ce`` and +not ``libvirtd.socket``: + +:: + + [Unit] + After=3Dlibvirtd.service + =20 OPTIONS =3D=3D=3D=3D=3D=3D=3D diff --git a/docs/manpages/virtlxcd.rst b/docs/manpages/virtlxcd.rst index 2e9d8fd14bbb..aebc8adb5822 100644 --- a/docs/manpages/virtlxcd.rst +++ b/docs/manpages/virtlxcd.rst @@ -60,6 +60,20 @@ unit files must be masked: $ systemctl mask virtlxcd.socket virtlxcd-ro.socket \ virtlxcd-admin.socket =20 +If using libvirt-guests service then the ordering for that service needs t= o 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=3D`` ordering mentions ``virtlxcd.servi= ce`` and +not ``virtlxcd.socket``: + +:: + + [Unit] + After=3Dvirtlxcd.service + =20 OPTIONS =3D=3D=3D=3D=3D=3D=3D diff --git a/docs/manpages/virtqemud.rst b/docs/manpages/virtqemud.rst index ea8d6e3105db..fa9a6ce3755c 100644 --- a/docs/manpages/virtqemud.rst +++ b/docs/manpages/virtqemud.rst @@ -60,6 +60,20 @@ unit files must be masked: $ systemctl mask virtqemud.socket virtqemud-ro.socket \ virtqemud-admin.socket =20 +If using libvirt-guests service then the ordering for that service needs t= o 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=3D`` ordering mentions ``virtqemud.serv= ice`` and +not ``virtqemud.socket``: + +:: + + [Unit] + After=3Dvirtqemud.service + =20 OPTIONS =3D=3D=3D=3D=3D=3D=3D diff --git a/docs/manpages/virtvboxd.rst b/docs/manpages/virtvboxd.rst index d7339d99f22b..f90de3451d8d 100644 --- a/docs/manpages/virtvboxd.rst +++ b/docs/manpages/virtvboxd.rst @@ -58,6 +58,20 @@ unit files must be masked: $ systemctl mask virtvboxd.socket virtvboxd-ro.socket \ virtvboxd-admin.socket =20 +If using libvirt-guests service then the ordering for that service needs t= o 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=3D`` ordering mentions ``virtvboxd.serv= ice`` and +not ``virtvboxd.socket``: + +:: + + [Unit] + After=3Dvirtvboxd.service + =20 OPTIONS =3D=3D=3D=3D=3D=3D=3D diff --git a/docs/manpages/virtvzd.rst b/docs/manpages/virtvzd.rst index 42dfa263e450..970719aac1d5 100644 --- a/docs/manpages/virtvzd.rst +++ b/docs/manpages/virtvzd.rst @@ -60,6 +60,20 @@ unit files must be masked: $ systemctl mask virtvzd.socket virtvzd-ro.socket \ virtvzd-admin.socket =20 +If using libvirt-guests service then the ordering for that service needs t= o 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=3D`` ordering mentions ``virtvzd.servic= e`` and +not ``virtvzd.socket``: + +:: + + [Unit] + After=3Dvirtvzd.service + =20 OPTIONS =3D=3D=3D=3D=3D=3D=3D diff --git a/docs/manpages/virtxend.rst b/docs/manpages/virtxend.rst index b08346b489d2..cf7685ecc0e6 100644 --- a/docs/manpages/virtxend.rst +++ b/docs/manpages/virtxend.rst @@ -60,6 +60,20 @@ unit files must be masked: $ systemctl mask virtxend.socket virtxend-ro.socket \ virtxend-admin.socket =20 +If using libvirt-guests service then the ordering for that service needs t= o 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=3D`` ordering mentions ``virtxend.servi= ce`` and +not ``virtxend.socket``: + +:: + + [Unit] + After=3Dvirtxend.service + =20 OPTIONS =3D=3D=3D=3D=3D=3D=3D diff --git a/tools/libvirt-guests.service.in b/tools/libvirt-guests.service= .in index 3cf647619612..1c569c320dfd 100644 --- a/tools/libvirt-guests.service.in +++ b/tools/libvirt-guests.service.in @@ -9,12 +9,6 @@ After=3Dvirtlxcd.socket After=3Dvirtvboxd.socket After=3Dvirtvzd.socket After=3Dvirtxend.socket -After=3Dlibvirtd.service -After=3Dvirtqemud.service -After=3Dvirtlxcd.service -After=3Dvirtvboxd.service -After=3Dvirtvzd.service -After=3Dvirtxend.service After=3Dvirt-guest-shutdown.target Documentation=3Dman:libvirt-guests(8) Documentation=3Dhttps://libvirt.org --=20 2.37.2