From nobody Sun Feb 8 14:12:32 2026 Delivered-To: importer@patchew.org Received-SPF: pass (zoho.com: domain of redhat.com designates 209.132.183.28 as permitted sender) client-ip=209.132.183.28; envelope-from=libvir-list-bounces@redhat.com; helo=mx1.redhat.com; Authentication-Results: mx.zohomail.com; spf=pass (zoho.com: domain of redhat.com designates 209.132.183.28 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=1566573119; cv=none; d=zoho.com; s=zohoarc; b=YmKKckydYbazrKngStBokABT3hfu2/ccTc3xSOattBg3tvlxKDzup8E2P26GLqKiApNHO8Q3L6dp9j94Httk3usqqJ0VpoOyp1EEUYvceREluny6e4VP5ZITNOUZlDgfO6a/SX+rH3ijZqykAsrmtUoCs4kckaPg9p8ig/Wdjxs= ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=zoho.com; s=zohoarc; t=1566573119; h=Content-Type:Content-Transfer-Encoding:Date:From:In-Reply-To:List-Subscribe:List-Post:List-Id:List-Archive:List-Help:List-Unsubscribe:MIME-Version:Message-ID:References:Sender:Subject:To:ARC-Authentication-Results; bh=91irL9DhageRxZoev3DjNlOp00INgpFNY+fbq+ZBOmY=; b=J0WmkR2xXICLEyJaxXMZ3b4ssKPzN2UeNRgHvGykz72pP24IOcTxGO7qiHtVtwX9Vp+Tuk6l2XVBPScQ0HS+qou5h7+G1eGVddrj+l17WbCo9Sq7lUlWHtQuWMuxsArf+LOeyxDBdphYXy7vCvMxzkQltg4i6F9D18/mInoyRMM= ARC-Authentication-Results: i=1; mx.zoho.com; spf=pass (zoho.com: domain of redhat.com designates 209.132.183.28 as permitted sender) smtp.mailfrom=libvir-list-bounces@redhat.com; dmarc=pass header.from= (p=none dis=none) header.from= Return-Path: Received: from mx1.redhat.com (mx1.redhat.com [209.132.183.28]) by mx.zohomail.com with SMTPS id 1566573119275966.104617798235; Fri, 23 Aug 2019 08:11:59 -0700 (PDT) Received: from smtp.corp.redhat.com (int-mx02.intmail.prod.int.phx2.redhat.com [10.5.11.12]) (using TLSv1.2 with cipher AECDH-AES256-SHA (256/256 bits)) (No client certificate requested) by mx1.redhat.com (Postfix) with ESMTPS id D3960301662E; Fri, 23 Aug 2019 15:11:57 +0000 (UTC) Received: from colo-mx.corp.redhat.com (colo-mx01.intmail.prod.int.phx2.redhat.com [10.5.11.20]) by smtp.corp.redhat.com (Postfix) with ESMTPS id AE2F370582; Fri, 23 Aug 2019 15:11:57 +0000 (UTC) Received: from lists01.pubmisc.prod.ext.phx2.redhat.com (lists01.pubmisc.prod.ext.phx2.redhat.com [10.5.19.33]) by colo-mx.corp.redhat.com (Postfix) with ESMTP id 69375180B536; Fri, 23 Aug 2019 15:11:57 +0000 (UTC) Received: from smtp.corp.redhat.com (int-mx08.intmail.prod.int.phx2.redhat.com [10.5.11.23]) by lists01.pubmisc.prod.ext.phx2.redhat.com (8.13.8/8.13.8) with ESMTP id x7NFBtd2003594 for ; Fri, 23 Aug 2019 11:11:55 -0400 Received: by smtp.corp.redhat.com (Postfix) id AC12B26329; Fri, 23 Aug 2019 15:11:55 +0000 (UTC) Received: from localhost.localdomain.com (ovpn-112-60.ams2.redhat.com [10.36.112.60]) by smtp.corp.redhat.com (Postfix) with ESMTP id C384019C78; Fri, 23 Aug 2019 15:11:54 +0000 (UTC) From: =?UTF-8?q?Daniel=20P=2E=20Berrang=C3=A9?= To: libvir-list@redhat.com Date: Fri, 23 Aug 2019 16:11:43 +0100 Message-Id: <20190823151143.31787-5-berrange@redhat.com> In-Reply-To: <20190823151143.31787-1-berrange@redhat.com> References: <20190823151143.31787-1-berrange@redhat.com> MIME-Version: 1.0 X-Scanned-By: MIMEDefang 2.84 on 10.5.11.23 X-loop: libvir-list@redhat.com Subject: [libvirt] [PATCH 4/4] rpm: don't enable socket activation in upgrade if --listen present X-BeenThere: libvir-list@redhat.com X-Mailman-Version: 2.1.12 Precedence: junk List-Id: Development discussions about the libvirt library & tools List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Content-Type: text/plain; charset="utf-8" Content-Transfer-Encoding: quoted-printable Sender: libvir-list-bounces@redhat.com Errors-To: libvir-list-bounces@redhat.com X-Scanned-By: MIMEDefang 2.79 on 10.5.11.12 X-Greylist: Sender IP whitelisted, not delayed by milter-greylist-4.5.16 (mx1.redhat.com [10.5.110.42]); Fri, 23 Aug 2019 15:11:58 +0000 (UTC) Currently during RPM upgrade we restart libvirtd and unconditionally enable use of systemd socket activation for the UNIX sockets. If the user had previously given the --listen arg to libvirtd though, this will no longer be honoured if socket activation is used. We could start libvirtd-tcp.socket or libvirtd-tls.socket for this, but mgmt tools like puppet/ansible might not be expecting this. So for now we silently disable socket activation if we see --listen was previously set on the host. Signed-off-by: Daniel P. Berrang=C3=A9 Reviewed-by: J=C3=A1n Tomko --- libvirt.spec.in | 44 +++++++++++++++++++++++++++++++------------- 1 file changed, 31 insertions(+), 13 deletions(-) diff --git a/libvirt.spec.in b/libvirt.spec.in index ee4b408510..e6c85a706b 100644 --- a/libvirt.spec.in +++ b/libvirt.spec.in @@ -1379,19 +1379,37 @@ fi =20 %posttrans daemon if [ -f %{_localstatedir}/lib/rpm-state/libvirt/restart ]; then - # Old libvirtd owns the sockets and will delete them on - # shutdown. Can't use a try-restart as libvirtd will simply - # own the sockets again when it comes back up. Thus we must - # do this particular ordering - /bin/systemctl is-active libvirtd.service 1>/dev/null 2>&1 - if test $? =3D 0 ; then - /bin/systemctl stop libvirtd.service >/dev/null 2>&1 || : - - /bin/systemctl try-restart libvirtd.socket >/dev/null 2>&1 || : - /bin/systemctl try-restart libvirtd-ro.socket >/dev/null 2>&1 || : - /bin/systemctl try-restart libvirtd-admin.socket >/dev/null 2>&1 |= | : - - /bin/systemctl start libvirtd.service >/dev/null 2>&1 || : + # See if user has previously modified their install to + # tell libvirtd to use --listen + grep -E '^LIBVIRTD_ARGS=3D.*--listen' /etc/sysconfig/libvirtd 1>/dev/n= ull 2>&1 + if test $? =3D 0 + then + # Then lets keep honouring --listen and *not* use + # systemd socket activation, because switching things + # might confuse mgmt tool like puppet/ansible that + # expect the old style libvirtd + /bin/systemctl mask libvirtd.socket >/dev/null 2>&1 || : + /bin/systemctl mask libvirtd-ro.socket >/dev/null 2>&1 || : + /bin/systemctl mask libvirtd-admin.socket >/dev/null 2>&1 || : + /bin/systemctl mask libvirtd-tls.socket >/dev/null 2>&1 || : + /bin/systemctl mask libvirtd-tcp.socket >/dev/null 2>&1 || : + else + # Old libvirtd owns the sockets and will delete them on + # shutdown. Can't use a try-restart as libvirtd will simply + # own the sockets again when it comes back up. Thus we must + # do this particular ordering, so that we get libvirtd + # running with socket activation in use + /bin/systemctl is-active libvirtd.service 1>/dev/null 2>&1 + if test $? =3D 0 + then + /bin/systemctl stop libvirtd.service >/dev/null 2>&1 || : + + /bin/systemctl try-restart libvirtd.socket >/dev/null 2>&1 || : + /bin/systemctl try-restart libvirtd-ro.socket >/dev/null 2>&1 = || : + /bin/systemctl try-restart libvirtd-admin.socket >/dev/null 2>= &1 || : + + /bin/systemctl start libvirtd.service >/dev/null 2>&1 || : + fi fi fi rm -rf %{_localstatedir}/lib/rpm-state/libvirt || : --=20 2.21.0 -- libvir-list mailing list libvir-list@redhat.com https://www.redhat.com/mailman/listinfo/libvir-list