From nobody Sun Feb 8 16:50:16 2026 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=1637768729; cv=none; d=zohomail.com; s=zohoarc; b=JFWTpilCON3M/omWc/PtYFxqdJnrwx3Vr87wpJZL+BgU27JHudXnvHiuksiUADzEaC1Mq5dJ1bnkA3L9lRYWdIUPTgMVIlOlnRHFNe0sDSjBQ7e7JfnJFhhHYa2zED88CwuG/wIMMw4Lsw1sfMQKEUbGDTEkKoh2Udn9E5IuGoc= ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=zohomail.com; s=zohoarc; t=1637768729; 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; bh=PqfDiTDMZbl7oYlDImroCZNMow4ErrtM0/Az0MukeRI=; b=ZLuavEWiSG7uQ0K4vDs/13fQ0qNtao6aa9IGOvxdXcle78o76w5gpLIRERh3fUn0K6QCjHRNiYfUWYE2yn2YaDknQsRv7XDQwDVAqMBakAJTL0DuP5rdhG5B60hXIjMKPcnBRQNz/REpGfgMZv8YNdaP7P1BENuzPYjjWQgIsoI= 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 1637768729517124.96111280110927; Wed, 24 Nov 2021 07:45:29 -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-464-GeFgz45fPCeL76OZSTmX9Q-1; Wed, 24 Nov 2021 10:45:24 -0500 Received: from smtp.corp.redhat.com (int-mx06.intmail.prod.int.phx2.redhat.com [10.5.11.16]) (using TLSv1.2 with cipher AECDH-AES256-SHA (256/256 bits)) (No client certificate requested) by mimecast-mx01.redhat.com (Postfix) with ESMTPS id B1ADD81EE9A; Wed, 24 Nov 2021 15:45:18 +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 25BC8794B1; Wed, 24 Nov 2021 15:45:18 +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 E48164A705; Wed, 24 Nov 2021 15:45:17 +0000 (UTC) Received: from smtp.corp.redhat.com (int-mx06.intmail.prod.int.phx2.redhat.com [10.5.11.16]) by lists01.pubmisc.prod.ext.phx2.redhat.com (8.13.8/8.13.8) with ESMTP id 1AOFjGms028531 for ; Wed, 24 Nov 2021 10:45:16 -0500 Received: by smtp.corp.redhat.com (Postfix) id 3CE08794A9; Wed, 24 Nov 2021 15:45:16 +0000 (UTC) Received: from localhost.localdomain.com (unknown [10.33.36.199]) by smtp.corp.redhat.com (Postfix) with ESMTP id 741E879454; Wed, 24 Nov 2021 15:44:42 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=redhat.com; s=mimecast20190719; t=1637768728; 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: in-reply-to:in-reply-to:references:references:list-id:list-help: list-unsubscribe:list-subscribe:list-post; bh=PqfDiTDMZbl7oYlDImroCZNMow4ErrtM0/Az0MukeRI=; b=eQN7nEXxaOToMCylJwqsK2f0GS5zQ3MxKd5dgr/C1pAdAPmm/6W4i2ypgM42rI4oV2i+g2 s+9T1MV2OGQWBfgqND5RAYuXzVuqMyRBKaYY2ncYXZeMdstRYiXgwpBswGHpFz15h0ju/K jH1vrtUPrljTvjYRPXI8Ipp5h3YMBgY= X-MC-Unique: GeFgz45fPCeL76OZSTmX9Q-1 From: =?UTF-8?q?Daniel=20P=2E=20Berrang=C3=A9?= To: libvir-list@redhat.com Subject: [libvirt PATCH v2 12/12] run: detect daemons when run via wrapper commands Date: Wed, 24 Nov 2021 15:44:16 +0000 Message-Id: <20211124154416.369770-13-berrange@redhat.com> In-Reply-To: <20211124154416.369770-1-berrange@redhat.com> References: <20211124154416.369770-1-berrange@redhat.com> MIME-Version: 1.0 X-Scanned-By: MIMEDefang 2.79 on 10.5.11.16 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.16 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-Type: text/plain; charset="utf-8" Content-Transfer-Encoding: quoted-printable X-ZohoMail-DKIM: pass (identity @redhat.com) X-ZM-MESSAGEID: 1637768730910100003 The run script tries to detect when a daemon is being run in order to shutdown other systemd unit files that clash. As implemented this only works if the daemon name is the first argument. This won't be the case if running via GDB or strace eg ./run strace -e trace=3Dopenat ./build/src/virtqemud We need to check all argv to find which might be a daemon path/name. Signed-off-by: Daniel P. Berrang=C3=A9 --- run.in | 22 +++++++++++----------- 1 file changed, 11 insertions(+), 11 deletions(-) diff --git a/run.in b/run.in index 64f99751fe..174b191675 100644 --- a/run.in +++ b/run.in @@ -130,18 +130,18 @@ def change_unit(name, action): =20 try_stop_units =3D [] if is_systemd_host(): - name =3D os.path.basename(prog) - maybe_stopped_units =3D [] - if is_modular_daemon(name): - # Only need to stop libvirtd or this specific modular unit - maybe_stopped_units +=3D daemon_units("libvirtd") - maybe_stopped_units +=3D daemon_units(name) - elif is_monolithic_daemon(name): - # Need to stop libvirtd and/or all modular units - maybe_stopped_units +=3D daemon_units("libvirtd") - for entry in modular_daemons: - maybe_stopped_units +=3D daemon_units(entry) + for arg in sys.argv: + name =3D os.path.basename(arg) + if is_modular_daemon(name): + # Only need to stop libvirtd or this specific modular unit + maybe_stopped_units +=3D daemon_units("libvirtd") + maybe_stopped_units +=3D daemon_units(name) + elif is_monolithic_daemon(name): + # Need to stop libvirtd and/or all modular units + maybe_stopped_units +=3D daemon_units("libvirtd") + for entry in modular_daemons: + maybe_stopped_units +=3D daemon_units(entry) =20 for unit in maybe_stopped_units: if is_unit_active(unit): --=20 2.33.1