From nobody Sun May 5 09:17:27 2024 Delivered-To: importer@patchew.org Received-SPF: pass (zohomail.com: domain of redhat.com designates 170.10.133.124 as permitted sender) client-ip=170.10.133.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.133.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=1642516760; cv=none; d=zohomail.com; s=zohoarc; b=F0r5ubsbKmOlwxTOui3m2bD8Q7rhwUSgg6TAFV4sjIe3JAMZLuLuS9UlimYEIPJipT0RVlLhjiGQCEKkTCmCGPfwOvg5hdZubsB0RVZUnaOidRT3aesW0v+2QK3/GtlALOA1q0lI+AgJuzFiWGMRzRz93GOjtGyBUY7sUYd5QHg= ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=zohomail.com; s=zohoarc; t=1642516760; h=Content-Type:Content-Transfer-Encoding:Date:From:List-Subscribe:List-Post:List-Id:List-Archive:List-Help:List-Unsubscribe:MIME-Version:Message-ID:Sender:Subject:To; bh=JzfLDZ0y9N+kfMDfWS+MyUMIt0LE4DGqqpHiRFPYUeY=; b=ncCfbS2YkoLOjd2JY1T0pyvavQ2hlJHhJMXAviS7fWSeTZQWu/pBGLN4+6Cd3DLQOTI0k5WarQXn7uk3vyl24+hUyEAzsMD1dAAx4olQTnj091Hme4q9lWQv1oQeZ0ZSROE6s+XBTZIdxzymCkLfHGldXsdKPnrBmINqTrTXVxg= ARC-Authentication-Results: i=1; mx.zohomail.com; dkim=pass; spf=pass (zohomail.com: domain of redhat.com designates 170.10.133.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.133.124]) by mx.zohomail.com with SMTPS id 164251676097314.539869554678035; Tue, 18 Jan 2022 06:39:20 -0800 (PST) Received: from mimecast-mx01.redhat.com (mimecast-mx01.redhat.com [209.132.183.4]) by relay.mimecast.com with ESMTP with STARTTLS (version=TLSv1.2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id us-mta-422-cRz5KMOWP7-nxHtN0nlrNA-1; Tue, 18 Jan 2022 09:39:18 -0500 Received: from smtp.corp.redhat.com (int-mx05.intmail.prod.int.phx2.redhat.com [10.5.11.15]) (using TLSv1.2 with cipher AECDH-AES256-SHA (256/256 bits)) (No client certificate requested) by mimecast-mx01.redhat.com (Postfix) with ESMTPS id 9D31A63AD5; Tue, 18 Jan 2022 14:39:12 +0000 (UTC) Received: from colo-mx.corp.redhat.com (colo-mx02.intmail.prod.int.phx2.redhat.com [10.5.11.21]) by smtp.corp.redhat.com (Postfix) with ESMTPS id 8080F5AB4B; Tue, 18 Jan 2022 14:39:12 +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 4FA284A700; Tue, 18 Jan 2022 14:39:12 +0000 (UTC) Received: from smtp.corp.redhat.com (int-mx02.intmail.prod.int.phx2.redhat.com [10.5.11.12]) by lists01.pubmisc.prod.ext.phx2.redhat.com (8.13.8/8.13.8) with ESMTP id 20IEcRYq016807 for ; Tue, 18 Jan 2022 09:38:27 -0500 Received: by smtp.corp.redhat.com (Postfix) id D70047E12C; Tue, 18 Jan 2022 14:38:27 +0000 (UTC) Received: from speedmetal.redhat.com (unknown [10.40.208.7]) by smtp.corp.redhat.com (Postfix) with ESMTP id 436ED7E2F6 for ; Tue, 18 Jan 2022 14:38:26 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=redhat.com; s=mimecast20190719; t=1642516759; h=from:from:sender:sender:reply-to:subject:subject:date:date: message-id:message-id:to:to: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=JzfLDZ0y9N+kfMDfWS+MyUMIt0LE4DGqqpHiRFPYUeY=; b=i5NvAYHgK7d8ZUmwchaH1J60IEBVYv3WAujQlHbtvpnweDn3IfIlxsmb27IHNYPTJZVkUx pRNjkygkvnAbb75tsfwBtw/NoHbARE1Jn66vZkUovbdZwU1YgSYrmr7XhYi63FgIE5Ibi7 9YIBamDw/nZ15jCtH0/o+7yPgD6nXpA= X-MC-Unique: cRz5KMOWP7-nxHtN0nlrNA-1 From: Peter Krempa To: libvir-list@redhat.com Subject: [PATCH] remote: systemd: Remove unix sockets from filesystem when disabling a '.socket' unit Date: Tue, 18 Jan 2022 15:38:26 +0100 Message-Id: MIME-Version: 1.0 X-Scanned-By: MIMEDefang 2.79 on 10.5.11.12 X-loop: libvir-list@redhat.com 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: , Sender: libvir-list-bounces@redhat.com Errors-To: libvir-list-bounces@redhat.com X-Scanned-By: MIMEDefang 2.79 on 10.5.11.15 Authentication-Results: relay.mimecast.com; auth=pass smtp.auth=CUSA124A263 smtp.mailfrom=libvir-list-bounces@redhat.com 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: 1642516762241100005 Content-Type: text/plain; charset="utf-8" The existence of the unix socket path is used by the remote driver to determine whether modular daemons are in use, so if the socket file stays behind and the user decided to switch from modular to monolithic daemon which was socket activated, the remote driver will insist on picking '/var/run/libvirt/virtqemud-sock', even when it's no longer in use: # systemctl start libvirtd.service # virsh list Id Name State -------------------- # systemctl stop libvirtd.service Warning: Stopping libvirtd.service, but it can still be activated by: libvirtd.socket libvirtd-ro.socket libvirtd-admin.socket # systemctl start virtqemud.socket # virsh list Id Name State -------------------- # systemctl stop virtqemud.socket # systemctl start libvirtd.service # virsh list error: failed to connect to the hypervisor error: Failed to connect socket to '/var/run/libvirt/virtqemud-sock': Conn= ection refused # virsh -c 'qemu:///system?socket=3D/var/run/libvirt/libvirt-sock' list Id Name State -------------------- Fix this by instructing systemd to delete the socket file when deactivating the unit file for the socket. Signed-off-by: Peter Krempa Reviewed-by: Ani Sinha Reviewed-by: Michal Privoznik --- src/remote/libvirtd.socket.in | 1 + 1 file changed, 1 insertion(+) diff --git a/src/remote/libvirtd.socket.in b/src/remote/libvirtd.socket.in index 85b4aa800a..0f349656f5 100644 --- a/src/remote/libvirtd.socket.in +++ b/src/remote/libvirtd.socket.in @@ -9,6 +9,7 @@ Before=3D@service@.service ListenStream=3D@runstatedir@/libvirt/@sockprefix@-sock Service=3D@service@.service SocketMode=3D@mode@ +RemoveOnStop=3Dyes [Install] WantedBy=3Dsockets.target --=20 2.34.1