From nobody Sun Apr 28 03:57:22 2024 Delivered-To: importer@patchew.org Received-SPF: pass (zohomail.com: domain of redhat.com designates 63.128.21.124 as permitted sender) client-ip=63.128.21.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 63.128.21.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=1598859957; cv=none; d=zohomail.com; s=zohoarc; b=TxIlTsD0wlWS0+V29OCFtiFwblk8pJVKaMNN1opOCA7LxoMn6Y0MocSs4hYN5LCVyMS9kF2cS1HMsIgmsw7+TM2fICSwDZ2gJq8XbycGyinVIOolliABGrzLHqLdbmHNezb8vb2TYWN7GwwdAlKSAzDGmSwUoQmeDBD3BepOYaE= ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=zohomail.com; s=zohoarc; t=1598859957; 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=6T04qW0YJcgAZrH5DSAiFyYNfxiuEf6fZItNnADLIfA=; b=FcnDY4dc8/Pt9BIQi7AkiXfDkpmy+uOQ8gWbwCrVwaFWghi0dUshRUUxZnTa6CM8yRcviFdzF2J1+3lmr54L0YVjKs+OmS3FBMpaOBr/Taf5ppdOi2HcGZSJVl73rVwKavaexNMmh4Jw5UOSZDsh8tYQnckcm78rw5+9tgvziWY= ARC-Authentication-Results: i=1; mx.zohomail.com; dkim=pass; spf=pass (zohomail.com: domain of redhat.com designates 63.128.21.124 as permitted sender) smtp.mailfrom=libvir-list-bounces@redhat.com; dmarc=pass header.from= (p=none dis=none) header.from= Return-Path: Received: from us-smtp-delivery-124.mimecast.com (us-smtp-delivery-124.mimecast.com [63.128.21.124]) by mx.zohomail.com with SMTPS id 1598859957610439.24001960416047; Mon, 31 Aug 2020 00:45:57 -0700 (PDT) Received: from mimecast-mx01.redhat.com (mimecast-mx01.redhat.com [209.132.183.4]) (Using TLS) by relay.mimecast.com with ESMTP id us-mta-538-ZZORwozmMpaBHvm9fbUVeQ-1; Mon, 31 Aug 2020 03:45:53 -0400 Received: from smtp.corp.redhat.com (int-mx03.intmail.prod.int.phx2.redhat.com [10.5.11.13]) (using TLSv1.2 with cipher AECDH-AES256-SHA (256/256 bits)) (No client certificate requested) by mimecast-mx01.redhat.com (Postfix) with ESMTPS id B4B9A18A2242; Mon, 31 Aug 2020 07:45:46 +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 94BA37838E; Mon, 31 Aug 2020 07:45:46 +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 5EE3FA2213; Mon, 31 Aug 2020 07:45:46 +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 07V7jMAe015711 for ; Mon, 31 Aug 2020 03:45:22 -0400 Received: by smtp.corp.redhat.com (Postfix) id 90CA75C22A; Mon, 31 Aug 2020 07:45:22 +0000 (UTC) Received: from sequioa.redhat.com (unknown [10.40.194.203]) by smtp.corp.redhat.com (Postfix) with ESMTP id C10775C225 for ; Mon, 31 Aug 2020 07:45:21 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=redhat.com; s=mimecast20190719; t=1598859956; 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=6T04qW0YJcgAZrH5DSAiFyYNfxiuEf6fZItNnADLIfA=; b=i/aPaDAhCBskAce8lEKgmbl3gnC1h0RbnddzLNAWitsmtYvH3i4pAoX64l4Vjlz6B6jMr1 YLsUmMQ3Q6Gau5dUok6W9s2UOj8pvA0b2AY1+TvcEKiKfTTMUQXVPq7JePfLVmvfs2XDFl J5vQfTSlBsqFGPIBKyEu+I9gUHnvgZw= X-MC-Unique: ZZORwozmMpaBHvm9fbUVeQ-1 From: Katerina Koukiou To: libvir-list@redhat.com Subject: [PATCH libvirt-dbus 1/2] meson: generate systemd unit file for libvirt-dbus Date: Mon, 31 Aug 2020 09:45:15 +0200 Message-Id: <20200831074516.15669-2-kkoukiou@redhat.com> In-Reply-To: <20200831074516.15669-1-kkoukiou@redhat.com> References: <20200831074516.15669-1-kkoukiou@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.13 Authentication-Results: relay.mimecast.com; auth=pass smtp.auth=CUSA124A263 smtp.mailfrom=libvir-list-bounces@redhat.com X-Mimecast-Spam-Score: 0.001 X-Mimecast-Originator: redhat.com Content-Transfer-Encoding: quoted-printable X-ZohoMail-DKIM: pass (identity @redhat.com) Content-Type: text/plain; charset="utf-8" Signed-off-by: Katerina Koukiou --- data/system/libvirt-dbus.service.in | 21 +++++++++++++++ data/system/meson.build | 30 +++++++++++++++++----- data/system/org.libvirt-systemd.service.in | 5 ++++ libvirt-dbus.spec.in | 4 ++- meson.build | 12 +++++++++ meson_options.txt | 1 + 6 files changed, 66 insertions(+), 7 deletions(-) create mode 100644 data/system/libvirt-dbus.service.in create mode 100644 data/system/org.libvirt-systemd.service.in diff --git data/system/libvirt-dbus.service.in data/system/libvirt-dbus.ser= vice.in new file mode 100644 index 0000000..862a366 --- /dev/null +++ data/system/libvirt-dbus.service.in @@ -0,0 +1,21 @@ +# SPDX-License-Identifier: LGPL-2.1+ +# +# This file is part of systemd. +# +# systemd is free software; you can redistribute it and/or modify it +# under the terms of the GNU Lesser General Public License as published by +# the Free Software Foundation; either version 2.1 of the License, or +# (at your option) any later version. + +[Unit] +Description=3DLibvirt DBus Service + +[Service] +BusName=3Dorg.libvirt +DynamicUser=3Dyes +User=3D@SYSTEM_USER@ +Group=3D@SYSTEM_USER@ +ExecStart=3D@sbindir@/libvirt-dbus --system + +[Install] +Alias=3Dorg.libvirt.service diff --git data/system/meson.build data/system/meson.build index 74f1949..67657d4 100644 --- data/system/meson.build +++ data/system/meson.build @@ -1,9 +1,18 @@ -configure_file( - configuration: conf, - input: 'org.libvirt.service.in', - output: 'org.libvirt.service', - install_dir: dbus_system_services_dir, -) +if init_script =3D=3D 'systemd' + configure_file( + configuration: conf, + input: 'org.libvirt-systemd.service.in', + output: 'org.libvirt.service', + install_dir: dbus_system_services_dir, + ) +else + configure_file( + configuration: conf, + input: 'org.libvirt.service.in', + output: 'org.libvirt.service', + install_dir: dbus_system_services_dir, + ) +endif configure_file( configuration: conf, input: 'org.libvirt.conf.in', @@ -16,3 +25,12 @@ configure_file( output: 'libvirt-dbus.rules', install_dir: polkit_rules_dir, ) +if init_script =3D=3D 'systemd' + systemd_system_unit_dir =3D systemd_dep.get_pkgconfig_variable('system= dsystemunitdir') + configure_file( + configuration: conf, + input: 'libvirt-dbus.service.in', + output: 'libvirt-dbus.service', + install_dir: systemd_system_unit_dir, + ) +endif diff --git data/system/org.libvirt-systemd.service.in data/system/org.libvi= rt-systemd.service.in new file mode 100644 index 0000000..ba260b2 --- /dev/null +++ data/system/org.libvirt-systemd.service.in @@ -0,0 +1,5 @@ +[D-BUS Service] +Name=3Dorg.libvirt +Exec=3D/bin/false +User=3D@SYSTEM_USER@ +SystemdService=3Dlibvirt-dbus.service diff --git libvirt-dbus.spec.in libvirt-dbus.spec.in index 4e6ff85..8286609 100644 --- libvirt-dbus.spec.in +++ libvirt-dbus.spec.in @@ -40,7 +40,8 @@ This package provides D-Bus API for libvirt %autosetup =20 %build -%meson +%meson \ + -Dinit_script=3Dsystemd %meson_build =20 %install @@ -57,6 +58,7 @@ exit 0 %doc AUTHORS.rst NEWS.rst %license COPYING %{_sbindir}/libvirt-dbus +%{_unitdir}/libvirt-dbus.service %{_datadir}/dbus-1/services/org.libvirt.service %{_datadir}/dbus-1/system-services/org.libvirt.service %{_datadir}/dbus-1/system.d/org.libvirt.conf diff --git meson.build meson.build index e765ed6..c34c07d 100644 --- meson.build +++ meson.build @@ -12,6 +12,18 @@ project( prefix =3D get_option('prefix') datadir =3D prefix / get_option('datadir') sbindir =3D prefix / get_option('sbindir') +if get_option('init_script') =3D=3D 'check' + if find_program('systemctl', required: false).found() + init_script =3D 'systemd' + else + init_script =3D 'other' + endif +else + init_script =3D get_option('init_script') +endif +if init_script =3D=3D 'systemd' + systemd_dep =3D dependency('systemd') +endif =20 opt_dirs =3D [ 'dbus_interfaces', diff --git meson_options.txt meson_options.txt index 36e8065..41d348f 100644 --- meson_options.txt +++ meson_options.txt @@ -4,3 +4,4 @@ option('dbus_system_policies', type: 'string', value: 'dbus= -1/system.d', descrip option('dbus_interfaces', type: 'string', value: 'dbus-1/interfaces', desc= ription: 'D-Bus interfaces directory') option('polkit_rules', type: 'string', value: 'polkit-1/rules.d', descript= ion: 'polkit rules directory') option('system_user', type: 'string', value: 'libvirtdbus', description: '= username to run system instance as') +option('init_script', type: 'combo', choices: ['systemd', 'other', 'check'= ], value: 'check', description: 'Style of init script to install') --=20 2.26.2 From nobody Sun Apr 28 03:57:22 2024 Delivered-To: importer@patchew.org Received-SPF: pass (zohomail.com: domain of redhat.com designates 216.205.24.124 as permitted sender) client-ip=216.205.24.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 216.205.24.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=1598859940; cv=none; d=zohomail.com; s=zohoarc; b=Kch31HGrGr06QbVNgkWtCaCjxhf/KB/pu6R67Js0xhtBIGSkhYEikX63IUnDQiUn32UhzGFin483rBabqM5Zb1VbUXkVE0dsKBPHBTi2i78XZg6VgAkaBv3qEbMSwXrTJ0dZ2MYjBoFNPB5XFL/woNXnGcAVsCyPuQxVtPwfm9U= ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=zohomail.com; s=zohoarc; t=1598859940; 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=2ubALMa0QKTUgpMdvNPg+PB8VIkasChWnafJuh0GJeY=; b=RsFPVWy9HJfxIuL1TyMWTaqUO+9JyKww7XX4tCq1lkGZFelJmcNDmarEZyT3yPdHlRdKCQi0d/dO1bWK8dIHSV8YEqsjIVRkFf7+Vcj2UQuEja8fkxyWRtybgNCrScSBk525zJLMLI03/95UTRqJpDkHfK+uPP4L7dxXSz4lOrI= ARC-Authentication-Results: i=1; mx.zohomail.com; dkim=pass; spf=pass (zohomail.com: domain of redhat.com designates 216.205.24.124 as permitted sender) smtp.mailfrom=libvir-list-bounces@redhat.com; dmarc=pass header.from= (p=none dis=none) header.from= Return-Path: Received: from us-smtp-delivery-124.mimecast.com (us-smtp-delivery-124.mimecast.com [216.205.24.124]) by mx.zohomail.com with SMTPS id 1598859940744689.6018903854549; Mon, 31 Aug 2020 00:45:40 -0700 (PDT) Received: from mimecast-mx01.redhat.com (mimecast-mx01.redhat.com [209.132.183.4]) (Using TLS) by relay.mimecast.com with ESMTP id us-mta-287-llsOohDEPsOfK9q2HOMxAg-1; Mon, 31 Aug 2020 03:45:35 -0400 Received: from smtp.corp.redhat.com (int-mx03.intmail.prod.int.phx2.redhat.com [10.5.11.13]) (using TLSv1.2 with cipher AECDH-AES256-SHA (256/256 bits)) (No client certificate requested) by mimecast-mx01.redhat.com (Postfix) with ESMTPS id 764AF1DDEC; Mon, 31 Aug 2020 07:45:29 +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 741777838E; Mon, 31 Aug 2020 07:45:28 +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 5ADC97A31A; Mon, 31 Aug 2020 07:45:25 +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 07V7jNhm015722 for ; Mon, 31 Aug 2020 03:45:23 -0400 Received: by smtp.corp.redhat.com (Postfix) id CF5AB5C22A; Mon, 31 Aug 2020 07:45:23 +0000 (UTC) Received: from sequioa.redhat.com (unknown [10.40.194.203]) by smtp.corp.redhat.com (Postfix) with ESMTP id 151F45C225 for ; Mon, 31 Aug 2020 07:45:22 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=redhat.com; s=mimecast20190719; t=1598859939; 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=2ubALMa0QKTUgpMdvNPg+PB8VIkasChWnafJuh0GJeY=; b=EJPdpAtpJ8AV4b5SPRd3KVgnLAgEvacfpdK7a+G32CeoZH9qWPH/+ck910t0R3WmyUq1nq x8pS1X/blAzFF8E06hHtlCMHiGf51f3csddSKipzVv9qpVqkNDm57bO5DAl45dN1XUJT2u 2ppN4/5AL//p2p8HBwOMiTeTL7TYl1c= X-MC-Unique: llsOohDEPsOfK9q2HOMxAg-1 From: Katerina Koukiou To: libvir-list@redhat.com Subject: [PATCH libvirt-dbus 2/2] systemd: use SupplementaryGroups=libvirt so that ubuntu users can use the system connection Date: Mon, 31 Aug 2020 09:45:16 +0200 Message-Id: <20200831074516.15669-3-kkoukiou@redhat.com> In-Reply-To: <20200831074516.15669-1-kkoukiou@redhat.com> References: <20200831074516.15669-1-kkoukiou@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.13 Authentication-Results: relay.mimecast.com; auth=pass smtp.auth=CUSA124A263 smtp.mailfrom=libvir-list-bounces@redhat.com X-Mimecast-Spam-Score: 0.0 X-Mimecast-Originator: redhat.com Content-Transfer-Encoding: quoted-printable X-ZohoMail-DKIM: pass (identity @redhat.com) Content-Type: text/plain; charset="utf-8" See https://bugs.launchpad.net/ubuntu/+source/libvirt-dbus/+bug/1892756 Signed-off-by: Katerina Koukiou --- data/system/libvirt-dbus.service.in | 1 + 1 file changed, 1 insertion(+) diff --git data/system/libvirt-dbus.service.in data/system/libvirt-dbus.ser= vice.in index 862a366..aa46217 100644 --- data/system/libvirt-dbus.service.in +++ data/system/libvirt-dbus.service.in @@ -15,6 +15,7 @@ BusName=3Dorg.libvirt DynamicUser=3Dyes User=3D@SYSTEM_USER@ Group=3D@SYSTEM_USER@ +SupplementaryGroups=3Dlibvirt ExecStart=3D@sbindir@/libvirt-dbus --system =20 [Install] --=20 2.26.2