From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: from mp1 ([2001:41d0:2:4a6f::]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) by ms0.migadu.com with LMTPS id HUKFKf6Lb2BkmAAAgWs5BA (envelope-from ) for ; Fri, 09 Apr 2021 01:04:30 +0200 Received: from aspmx1.migadu.com ([2001:41d0:2:4a6f::]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits)) by mp1 with LMTPS id wJzrIP6Lb2AmYgAAbx9fmQ (envelope-from ) for ; Thu, 08 Apr 2021 23:04:30 +0000 Received: from lists.gnu.org (lists.gnu.org [209.51.188.17]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by aspmx1.migadu.com (Postfix) with ESMTPS id D439B14C03 for ; Fri, 9 Apr 2021 01:04:29 +0200 (CEST) Received: from localhost ([::1]:51166 helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1lUdhM-0006hT-MF for larch@yhetil.org; Thu, 08 Apr 2021 19:04:28 -0400 Received: from eggs.gnu.org ([2001:470:142:3::10]:60588) by lists.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1lUdgw-0006gu-EQ for bug-guix@gnu.org; Thu, 08 Apr 2021 19:04:02 -0400 Received: from debbugs.gnu.org ([209.51.188.43]:36955) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_128_GCM_SHA256:128) (Exim 4.90_1) (envelope-from ) id 1lUdgw-0002gm-62 for bug-guix@gnu.org; Thu, 08 Apr 2021 19:04:02 -0400 Received: from Debian-debbugs by debbugs.gnu.org with local (Exim 4.84_2) (envelope-from ) id 1lUdgw-00056d-25 for bug-guix@gnu.org; Thu, 08 Apr 2021 19:04:02 -0400 X-Loop: help-debbugs@gnu.org Subject: bug#42129: guix-install.sh does not add build users to kvm group Resent-From: Leo Famulari Original-Sender: "Debbugs-submit" Resent-CC: bug-guix@gnu.org Resent-Date: Thu, 08 Apr 2021 23:04:02 +0000 Resent-Message-ID: Resent-Sender: help-debbugs@gnu.org X-GNU-PR-Message: followup 42129 X-GNU-PR-Package: guix X-GNU-PR-Keywords: easy To: Marius Bakke Received: via spool by 42129-submit@debbugs.gnu.org id=B42129.161792302019599 (code B ref 42129); Thu, 08 Apr 2021 23:04:02 +0000 Received: (at 42129) by debbugs.gnu.org; 8 Apr 2021 23:03:40 +0000 Received: from localhost ([127.0.0.1]:48501 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1lUdgZ-000562-SL for submit@debbugs.gnu.org; Thu, 08 Apr 2021 19:03:40 -0400 Received: from out4-smtp.messagingengine.com ([66.111.4.28]:37775) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1lUdgU-00055n-Kc for 42129@debbugs.gnu.org; Thu, 08 Apr 2021 19:03:38 -0400 Received: from compute3.internal (compute3.nyi.internal [10.202.2.43]) by mailout.nyi.internal (Postfix) with ESMTP id 6B79A5C0110; Thu, 8 Apr 2021 19:03:29 -0400 (EDT) Received: from mailfrontend2 ([10.202.2.163]) by compute3.internal (MEProxy); Thu, 08 Apr 2021 19:03:29 -0400 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=famulari.name; h=date:from:to:cc:subject:message-id:references:mime-version :content-type:in-reply-to; s=mesmtp; bh=AtioJLFirfruDsaF51rtPesw 9/+rZMmYzQjEoAhqkiw=; b=iiVZx63nBkle4TITkPYC7MfxEicfXnna9r6KxGTE /9xun1TaBPSOnmh7VhVV/Xxoh6xNdhZJab2hTKmUCyQmjEdujKmgbI7PfK+NVY27 U/FhVkxnDJQjme2hWyZ9EyZfEmUR7mE8EN6mwrltJUiqYWUVKy7Ku1zT3tSBd23k mv8= DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d= messagingengine.com; h=cc:content-type:date:from:in-reply-to :message-id:mime-version:references:subject:to:x-me-proxy :x-me-proxy:x-me-sender:x-me-sender:x-sasl-enc; s=fm2; bh=AtioJL FirfruDsaF51rtPesw9/+rZMmYzQjEoAhqkiw=; b=jr6MjJf08h69x5x41ZpOLK TlQqOaM9WvHEqAT19iyJL1jEpwBbSv+43AkD5Gn/aHzKyv15skBWXhxibNPDqIhd zwZX5uq3nphbEQfg5mgzBbDfwjiP0JOURc4gNAKtYR1/YrMZqhqb9e6MTBwsl+Gs ERpDX/qAsqIWzb/xV23iRgUOxaAoz2KD0yZL0AgjMwM+gglHwT8aEDOMrLS5z44V 7kOnLWXqwS7/AoSFIlqp+D4VbRv0gPTmqh4us8ZqKr8CzEC8NFMFwXYntnKuwhum E9mC/PdSRS0T9yIZCOqMx9d6JMJsooTrsRNQG7jGRWxjoqoIQ6dvKwlCYbLmFWsA == X-ME-Sender: X-ME-Proxy-Cause: gggruggvucftvghtrhhoucdtuddrgeduledrudektddgudehucetufdoteggodetrfdotf fvucfrrhhofhhilhgvmecuhfgrshhtofgrihhlpdfqfgfvpdfurfetoffkrfgpnffqhgen uceurghilhhouhhtmecufedttdenucesvcftvggtihhpihgvnhhtshculddquddttddmne cujfgurhepfffhvffukfhfgggtuggjsehgtderredttddvnecuhfhrohhmpefnvghoucfh rghmuhhlrghrihcuoehlvghosehfrghmuhhlrghrihdrnhgrmhgvqeenucggtffrrghtth gvrhhnpedukeevgeetkeeltefgiedtjefgjeekffduteehvdfhueekudelieekjeefheff teenucfkphepuddttddruddurdduieelrdduudeknecuvehluhhsthgvrhfuihiivgeptd enucfrrghrrghmpehmrghilhhfrhhomheplhgvohesfhgrmhhulhgrrhhirdhnrghmvg X-ME-Proxy: Received: from localhost (pool-100-11-169-118.phlapa.fios.verizon.net [100.11.169.118]) by mail.messagingengine.com (Postfix) with ESMTPA id C3AED1080054; Thu, 8 Apr 2021 19:03:28 -0400 (EDT) Date: Thu, 8 Apr 2021 19:03:26 -0400 From: Leo Famulari Message-ID: References: <875zb91w0d.fsf@gnu.org> MIME-Version: 1.0 Content-Type: multipart/signed; micalg=pgp-sha256; protocol="application/pgp-signature"; boundary="8KmPfIRurEaBZdlT" Content-Disposition: inline In-Reply-To: X-BeenThere: debbugs-submit@debbugs.gnu.org X-Mailman-Version: 2.1.18 Precedence: list X-BeenThere: bug-guix@gnu.org List-Id: Bug reports for GNU Guix List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Cc: 42129@debbugs.gnu.org Errors-To: bug-guix-bounces+larch=yhetil.org@gnu.org Sender: "bug-Guix" X-Migadu-Flow: FLOW_IN ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=yhetil.org; s=key1; t=1617923070; 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:resent-cc:resent-from:resent-sender: resent-message-id:in-reply-to:in-reply-to:references:references: list-id:list-help:list-unsubscribe:list-subscribe:list-post: dkim-signature; bh=AtioJLFirfruDsaF51rtPesw9/+rZMmYzQjEoAhqkiw=; b=PayslktwkXlaqalJKF7DVdkPFLNDbRfuZtFNMY7gArbCleXDajogQE8gjv9wx47j1HQwb8 6fiXmUoDKXlpkokM0pnY6ZA8yU3AKLxuxZzyWAoM6NEv2ekEUhcR9BJREZt4GZ8lxZTU7e /z3ZR6CzuK4lPTemqsQVDmquILJQE7xb7GsjTg2ZYJIrWTHBQ6vMGT2JqV2gExvE7aey59 Z1vIhkQPvUuyM6r6HZoNlrFpEjq0V8cPwhpivYipaF81VvQEMRoRANIBQmb9GbzM0CRFQi nF/yiHqM/wDb7S31nfyK1OpW4lUtHfk21uR9Qh9wygM/2YzspSRTd99Ws3Y+OQ== ARC-Seal: i=1; s=key1; d=yhetil.org; t=1617923070; a=rsa-sha256; cv=none; b=QBWpdi7YYDbrLKkaiLFmESF5BFKM8hu1IEyq+09eJFNKwe0Ufhgk3QA9ggPTM6yCpCo06x KHyitKF4KnyZKLgf5YRG/SFw461qPkw2MGTvTHUA2l6p4CuDuvoR1EalGRgdvNILertPYP fygq/tObRD30AiE7SpbQh4ONsvLtn79Epq++34bRauH12fTfiFjSV7t5mCxd1VnEw+rv0G UKbpaPj++83dmuev6pcM2oGUzlYsH4qgn5wW546eCBBC+/CGARFu/SlzCtuIUcuME78M6p xvnfFCyIYGEoRFjEToceszqWJLB1mjgMhaTXunxamDGPVE048LNDY7FzRKLqyQ== ARC-Authentication-Results: i=1; aspmx1.migadu.com; dkim=fail ("headers rsa verify failed") header.d=famulari.name header.s=mesmtp header.b=iiVZx63n; dkim=fail ("headers rsa verify failed") header.d=messagingengine.com header.s=fm2 header.b=jr6MjJf0; spf=pass (aspmx1.migadu.com: domain of bug-guix-bounces@gnu.org designates 209.51.188.17 as permitted sender) smtp.mailfrom=bug-guix-bounces@gnu.org X-Migadu-Spam-Score: -2.04 Authentication-Results: aspmx1.migadu.com; dkim=fail ("headers rsa verify failed") header.d=famulari.name header.s=mesmtp header.b=iiVZx63n; dkim=fail ("headers rsa verify failed") header.d=messagingengine.com header.s=fm2 header.b=jr6MjJf0; dmarc=none; spf=pass (aspmx1.migadu.com: domain of bug-guix-bounces@gnu.org designates 209.51.188.17 as permitted sender) smtp.mailfrom=bug-guix-bounces@gnu.org X-Migadu-Queue-Id: D439B14C03 X-Spam-Score: -2.04 X-Migadu-Scanner: scn0.migadu.com X-TUID: wJP4Va7IByz/ --8KmPfIRurEaBZdlT Content-Type: multipart/mixed; boundary="Ya3vWrCHcsQLbnTX" Content-Disposition: inline --Ya3vWrCHcsQLbnTX Content-Type: text/plain; charset=us-ascii Content-Disposition: inline Content-Transfer-Encoding: quoted-printable On Thu, Apr 08, 2021 at 06:38:59PM -0400, Leo Famulari wrote: > On Mon, Jun 29, 2020 at 10:01:54PM +0200, Marius Bakke wrote: > > guix-install.sh should add the build users to the 'kvm' group if present > > so that commands that require use of KVM can succeed. >=20 > Here is a patch (untested) that makes sure a 'kvm' group exists and adds > it to the guixbuilders' groups. I realized that you specified that the build users should be added to the kvm group 'if' it is present. So, here is a revised patch. --Ya3vWrCHcsQLbnTX Content-Type: text/plain; charset=us-ascii Content-Disposition: attachment; filename="v2-0001-guix-install.sh-Add-the-build-users-to-the-kvm-gr.patch" Content-Transfer-Encoding: quoted-printable =46rom 1a9fd7decd843f21c36d8ec4d1e218f478b983cf Mon Sep 17 00:00:00 2001 =46rom: Leo Famulari Date: Thu, 8 Apr 2021 18:34:43 -0400 Subject: [PATCH v2] guix-install.sh: Add the build users to the 'kvm' group. * etc/guix-install.sh (sys_create_build_user): If a 'kvm' group exists, add it to the guixbuilders' lists of supplementary groups. --- etc/guix-install.sh | 9 +++++++-- 1 file changed, 7 insertions(+), 2 deletions(-) diff --git a/etc/guix-install.sh b/etc/guix-install.sh index c84e7b7577..f3fcbf5d05 100755 --- a/etc/guix-install.sh +++ b/etc/guix-install.sh @@ -330,15 +330,20 @@ sys_create_build_user() _msg "${PAS}group created" fi =20 + if [ $(getent group kvm) ]; then + _msg "${INF}group kvm exists and build users will be added to it" + local KVMGROUP=3D,kvm + fi + for i in $(seq -w 1 10); do if id "guixbuilder${i}" &>/dev/null; then _msg "${INF}user is already in the system, reset" - usermod -g guixbuild -G guixbuild \ + usermod -g guixbuild -G guixbuild{$KVMGROUP} \ -d /var/empty -s "$(which nologin)" \ -c "Guix build user $i" \ "guixbuilder${i}"; else - useradd -g guixbuild -G guixbuild \ + useradd -g guixbuild -G guixbuild{$KVMGROUP} \ -d /var/empty -s "$(which nologin)" \ -c "Guix build user $i" --system \ "guixbuilder${i}"; --=20 2.31.1 --Ya3vWrCHcsQLbnTX-- --8KmPfIRurEaBZdlT Content-Type: application/pgp-signature; name="signature.asc" -----BEGIN PGP SIGNATURE----- iQIzBAABCAAdFiEEsFFZSPHn08G5gDigJkb6MLrKfwgFAmBvi74ACgkQJkb6MLrK fwhpxQ//dyXoDK/WMy2lEeEB7UlUt7ImGZkj3TMh+sxJnwmMyNykC6mxxxUQuiwR y2ziqdNcUI/WdxLj3oTeZ17BLqrsKHLawJFNSqH8qVFksPHkljssfSFrYMCElIMc GnjQ72iVe/jg/iYfyl22A/qYibuH8c2JGbxpOxD2WUHInOIwsNXaizpIQYJgw6tb F5cXPn4rMW/JtwcOe5pYgWic/z5eCE81+RjMqpMlYrpESiZ4CReSt1aCJlL3rmoT /ERSezNAcnASlt6KTUfe6DJHAKtdQf9siywe8Jt/m5junZMr4VA98Y1AJVyUvysf Z8ixZlSLiSpGlQIHYeTM3SqWmjpJbGYmjJtoqX0zBViRhpii9pYGqG6kW/yp4UaP ZZPZ971LkZKiEbPdN3QjGqqPjoMN3AcibnAiyoHasLbVOypS0zbCa49KIl0UEvgg MOON/0LemIme2LzltpOlCxk7+e3izYbTq4vE1np3lffX+y+iEqAA5TE9L+eWGHnP AC7tWuGT6Rfyl4lp38/g/8FXh9i40nVmrgZT9VidL4J4lkjCdVEHGoQwhAWa2ui7 lLh+U+A8yNJHCZYPd2+NaWrnduZiB3ze9dmjRIq7MVrqA3L1BEkLSavwBqEKqh/X cI2gn/bPf9zoYnNHCbeB97rOuIfa4oPw5+RVCrXWK+iBWJlYTVE= =e4ui -----END PGP SIGNATURE----- --8KmPfIRurEaBZdlT--