From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: from mp2.migadu.com ([2001:41d0:403:4876::]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits)) by ms13.migadu.com with LMTPS id wLmKHoyVs2YjGQEAe85BDQ:P1 (envelope-from ) for ; Wed, 07 Aug 2024 15:41:00 +0000 Received: from aspmx1.migadu.com ([2001:41d0:403:4876::]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits)) by mp2.migadu.com with LMTPS id wLmKHoyVs2YjGQEAe85BDQ (envelope-from ) for ; Wed, 07 Aug 2024 17:41:00 +0200 X-Envelope-To: larch@yhetil.org Authentication-Results: aspmx1.migadu.com; dkim=pass header.d=debbugs.gnu.org header.s=debbugs-gnu-org header.b=ckqgn8no; dkim=fail ("headers rsa verify failed") header.d=cyberdimension.org header.s=dkim header.b=GDtZGMcI; spf=pass (aspmx1.migadu.com: domain of "guix-patches-bounces+larch=yhetil.org@gnu.org" designates 209.51.188.17 as permitted sender) smtp.mailfrom="guix-patches-bounces+larch=yhetil.org@gnu.org"; dmarc=none ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=yhetil.org; s=key1; t=1723045260; 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: content-transfer-encoding:content-transfer-encoding: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=ftZu8O/qtDd1VbTGKcoN8Wiy96LjWd8GT7pIVDyRPxs=; b=WqEkkQNeSdCtzh+pFaHb8pWSa1YPL1ksHCGRD9AgR8VzRcB9SWqMxH2Yl8d/IIweGlRH45 0+CoiXVcOrYHWhYcZ/OCGFFyhlV/16CyY3Kt9unngoYnIqfog6SnjTH6pjmhtMjDHCoEJi Btf2AhWIeyTIwbvPppmg+DuSgtYSb0wNEHN7O/kiUQQn+Bp9Y1h2oEtk+v/KDVUiet9HM0 U7fLNgVoBu4CVcmoyIlQcq30fQdKKG8dPP276VeONMiFbiTl/NofTOJZS4l2rMhnwIfpI5 OtgkKmo+NC5OF5CFTHCPrPYYl7OvFZ963H1LTAnltKXbp6J76ysw6TW1j06W0g== ARC-Authentication-Results: i=1; aspmx1.migadu.com; dkim=pass header.d=debbugs.gnu.org header.s=debbugs-gnu-org header.b=ckqgn8no; dkim=fail ("headers rsa verify failed") header.d=cyberdimension.org header.s=dkim header.b=GDtZGMcI; spf=pass (aspmx1.migadu.com: domain of "guix-patches-bounces+larch=yhetil.org@gnu.org" designates 209.51.188.17 as permitted sender) smtp.mailfrom="guix-patches-bounces+larch=yhetil.org@gnu.org"; dmarc=none ARC-Seal: i=1; s=key1; d=yhetil.org; t=1723045260; a=rsa-sha256; cv=none; b=SvrzmpTLPKUHB+T2hZuB4MMuYzVMQu+dYeK+uRAIx1M0ezv6WDzw0fHvvhvIgZpwbG/bBK RhsJG7onUrKGkWIhvWORsPwBwAHRqvmEl+6hY3/FqpOKNLPaNip8PkYil6kh6iG8dQyAQt al2iORTdU7n1Y06JtxWlcTRK20OsTdMRFPqpfrL/z1QH0zZwUh1dbA7L9p2xBn/4/VwON2 m4iWvDSfG17Bpu9alK82wdXu2KulHX2Pljrh+41cMidKU9vPkP9AWFqneuYllsbeTBEohL mwsBTnWAXt9QIyXY9x9yON8z2UV29BuzR8pnRjX6G1XNQF9VacCSdPtyre6aBA== 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 2CDE021D42 for ; Wed, 7 Aug 2024 17:41:00 +0200 (CEST) Received: from localhost ([::1] helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1sbimG-0007XU-Vq; Wed, 07 Aug 2024 11:40:41 -0400 Received: from eggs.gnu.org ([2001:470:142:3::10]) by lists.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1sbimE-0007X9-6E for guix-patches@gnu.org; Wed, 07 Aug 2024 11:40:38 -0400 Received: from debbugs.gnu.org ([2001:470:142:5::43]) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_128_GCM_SHA256:128) (Exim 4.90_1) (envelope-from ) id 1sbimD-0006As-Sw for guix-patches@gnu.org; Wed, 07 Aug 2024 11:40:37 -0400 DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=debbugs.gnu.org; s=debbugs-gnu-org; h=MIME-Version:References:In-Reply-To:Date:From:To:Subject; bh=ftZu8O/qtDd1VbTGKcoN8Wiy96LjWd8GT7pIVDyRPxs=; b=ckqgn8nofIu72+hNXl9wRntvOVkNVmOLyCKE3C75+xB3O1W/TNnoUDmXnF+k27jo7Hdl+VIP1K7lLtmlFVjbprIJivRUO2ng6uFfWvEzKmIrdKBOVqapEha2Ad1qsaUJltLWPKqdWANkjnheFUQduEXCewnRpn/O+woKpl1Co5aPQIyg35hThJepwg2Ib1chH0/BHB0QHwO87MmhR7A/T61tn23QK67DvnbfgzNs9WyCKSeH47H8580qPDmmiV5dIb3PKMA1aPkFn6bzHUfJov5SWBkEVpf9IvFT03SvC/jMP5w3tSLGzbh3TCPsQaqM1w0ELafPgt63D64nQtTnLw==; Received: from Debian-debbugs by debbugs.gnu.org with local (Exim 4.84_2) (envelope-from ) id 1sbimd-0002Yu-41 for guix-patches@gnu.org; Wed, 07 Aug 2024 11:41:03 -0400 X-Loop: help-debbugs@gnu.org Subject: [bug#72514] [PATCH v1 2/2] guix-install.sh: Support perp. Resent-From: Denis 'GNUtoo' Carikli Original-Sender: "Debbugs-submit" Resent-CC: , guix-patches@gnu.org Resent-Date: Wed, 07 Aug 2024 15:41:03 +0000 Resent-Message-ID: Resent-Sender: help-debbugs@gnu.org X-GNU-PR-Message: followup 72514 X-GNU-PR-Package: guix-patches X-GNU-PR-Keywords: patch To: 72514@debbugs.gnu.org, =?UTF-8?Q?Mat=C3=ADas?= Fonzo Cc: Denis 'GNUtoo' Carikli , ( , Christopher Baines , Ludovic =?UTF-8?Q?Court=C3=A8s?= , Mathieu Othacehe , Simon Tournier , Tobias Geerinckx-Rice , jgart X-Debbugs-Original-Xcc: ( , Christopher Baines , Ludovic =?UTF-8?Q?Court=C3=A8s?= , Mathieu Othacehe , Simon Tournier , Tobias Geerinckx-Rice , jgart Received: via spool by 72514-submit@debbugs.gnu.org id=B72514.17230452189747 (code B ref 72514); Wed, 07 Aug 2024 15:41:03 +0000 Received: (at 72514) by debbugs.gnu.org; 7 Aug 2024 15:40:18 +0000 Received: from localhost ([127.0.0.1]:34948 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1sbilu-0002X9-4J for submit@debbugs.gnu.org; Wed, 07 Aug 2024 11:40:18 -0400 Received: from cyberdimension.org ([79.143.250.36]:53774 helo=rockpro64.cyberdimension.org) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1sbilq-0002Wc-TH for 72514@debbugs.gnu.org; Wed, 07 Aug 2024 11:40:16 -0400 DKIM-Signature: v=1; a=rsa-sha256; c=simple/simple; s=dkim; bh=JWykyVKxDT+F4GQ ULmDoN9nytmlcvXrRkgP4YwCftww=; h=references:in-reply-to:date:subject: cc:to:from; d=cyberdimension.org; b=GDtZGMcI/0Ggxr73mUtnMqdpdjap1Emixc BGb/VUUM3y9Cgt2zW2eVYV6qPVGN4j7vHtgwWlk7S5u5ppYNcYn3PnVwFrpB6sZdAcZvw6 X7TMeO7Q/dKum3660BrQYMHbKHFFigxdlVrgHAYMzYJUQjcVHHdlsj5diOIA2AssCGQOdi AkUIr+3nlvGlau5INjxgeL6OF6Rm5gqRsO5eZDYZp1K3jP2/col8qCx6JgcGbEa7uWF0t0 4E1ze2KHEa2wY5YOWQhD9MckreyTFgT4ZUWviGd36mmySgkWslTsS5mRQyVhH2cjKuSN17 YLxcPuQqd2tQ9ETFH7+bxJqZ+W9w== Received: from localhost.localdomain (localhost [127.0.0.1]) by rockpro64.cyberdimension.org (OpenSMTPD) with ESMTP id fc83aafb; Wed, 7 Aug 2024 15:39:46 +0000 (UTC) From: Denis 'GNUtoo' Carikli Date: Wed, 7 Aug 2024 17:39:19 +0200 Message-ID: X-Mailer: git-send-email 2.45.2 In-Reply-To: References: MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: debbugs-submit@debbugs.gnu.org X-Mailman-Version: 2.1.18 Precedence: list X-BeenThere: guix-patches@gnu.org List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: guix-patches-bounces+larch=yhetil.org@gnu.org Sender: guix-patches-bounces+larch=yhetil.org@gnu.org X-Migadu-Country: US X-Migadu-Flow: FLOW_IN X-Spam-Score: -7.98 X-Migadu-Queue-Id: 2CDE021D42 X-Migadu-Scanner: mx10.migadu.com X-Migadu-Spam-Score: -7.98 X-TUID: 8K4UMgshDKZJ Without this patch, it is possible to install Guix on Dragora, but then no init system is detected and so the Guix daemon isn't started. Thanks a lot for the help from selk on #dragora on Libera Chat for the help. * etc/guix-install.sh (chk_init_sys): Detect perp. (sys_enable_guix_daemon): Install, configure, enable and start the perp service. (sys_delete_guix_daemon): Stop and remove the perp service. * etc/perp/rc.log.in: New file. * etc/perp/rc.main.in: New file. * nix/local.mk: Add build rules. * .gitignore: Ignore generated etc/perp/rc.log and etc/perp/rc.main. Change-Id: I15a5229fee69ebd41ac538b25a3e68793c563144 Signed-off-by: Denis 'GNUtoo' Carikli --- .gitignore | 2 ++ etc/guix-install.sh | 25 +++++++++++++++++++++++++ etc/perp/rc.log.in | 24 ++++++++++++++++++++++++ etc/perp/rc.main.in | 45 +++++++++++++++++++++++++++++++++++++++++++++ nix/local.mk | 17 ++++++++++++++++- 5 files changed, 112 insertions(+), 1 deletion(-) create mode 100644 etc/perp/rc.log.in create mode 100644 etc/perp/rc.main.in diff --git a/.gitignore b/.gitignore index 0f74b5da3d..11f99e32db 100644 --- a/.gitignore +++ b/.gitignore @@ -77,6 +77,8 @@ /etc/guix-gc.service /etc/init.d/guix-daemon /etc/openrc/guix-daemon +/etc/perp/rc.log +/etc/perp/rc.main /guix-* /guix/config.scm /libformat.a diff --git a/etc/guix-install.sh b/etc/guix-install.sh index 9d9c294d75..4a0b326ffa 100755 --- a/etc/guix-install.sh +++ b/etc/guix-install.sh @@ -232,6 +232,10 @@ chk_init_sys() _msg "${INF}init system is: systemd" INIT_SYS="systemd" return 0 + elif [[ $(perpboot -V 2>&1) =~ perpboot ]]; then + _msg "${INF}init system is: perp" + INIT_SYS="perp" + return 0 elif [[ -f /etc/init.d/cron && ! -h /etc/init.d/cron ]]; then _msg "${INF}init system is: sysv-init" INIT_SYS="sysv-init" @@ -505,6 +509,20 @@ sys_enable_guix_daemon() systemctl start guix-daemon; } && _msg "${PAS}enabled Guix daemon via systemd" ;; + perp) + { mkdir -p /etc/perp/guix-daemon/; + cp ~root/.config/guix/current/etc/perp/rc.log \ + /etc/perp/guix-daemon/rc.log; + cp ~root/.config/guix/current/etc/perp/rc.main \ + /etc/perp/guix-daemon/rc.main; + chmod 775 /etc/perp/guix-daemon/rc.log; + chmod 775 /etc/perp/guix-daemon/rc.main; + + configure_substitute_discovery /etc/perp/guix-daemon/rc.main + + perpctl A guix-daemon; } && + _msg "${PAS}enabled Guix daemon via perp" + ;; sysv-init) { mkdir -p /etc/init.d; cp ~root/.config/guix/current/etc/init.d/guix-daemon \ @@ -587,6 +605,13 @@ sys_delete_guix_daemon() systemctl daemon-reload ;; + perp) + _msg "${INF}stopping and disabling guix-daemon" + perpctl X guix-daemon + _msg "${INF}removing guix-daemon" + rm -rf /etc/perp/guix-daemon + ;; + sysv-init) update-rc.d guix-daemon disable service guix-daemon stop diff --git a/etc/perp/rc.log.in b/etc/perp/rc.log.in new file mode 100644 index 0000000000..11c3ab490e --- /dev/null +++ b/etc/perp/rc.log.in @@ -0,0 +1,24 @@ +#!/bin/sh +# GNU Guix --- Functional package management for GNU +# Copyright © 2024 Denis 'GNUtoo' Carikli +# +# This file is part of GNU Guix. +# +# GNU Guix is free software; you can redistribute it and/or modify it +# under the terms of the GNU General Public License as published by +# the Free Software Foundation; either version 3 of the License, or (at +# your option) any later version. +# +# GNU Guix is distributed in the hope that it will be useful, but +# WITHOUT ANY WARRANTY; without even the implied warranty of +# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the +# GNU General Public License for more details. +# +# You should have received a copy of the GNU General Public License +# along with GNU Guix. If not, see . + +if [ "${1}" = "start" ] ; then + exec tinylog_run "${2}" +fi + +exit 0 diff --git a/etc/perp/rc.main.in b/etc/perp/rc.main.in new file mode 100644 index 0000000000..cdf92763eb --- /dev/null +++ b/etc/perp/rc.main.in @@ -0,0 +1,45 @@ +#! /bin/sh +# GNU Guix --- Functional package management for GNU +# Copyright © 2024 Denis 'GNUtoo' Carikli +# +# This file is part of GNU Guix. +# +# GNU Guix is free software; you can redistribute it and/or modify it +# under the terms of the GNU General Public License as published by +# the Free Software Foundation; either version 3 of the License, or (at +# your option) any later version. +# +# GNU Guix is distributed in the hope that it will be useful, but +# WITHOUT ANY WARRANTY; without even the implied warranty of +# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the +# GNU General Public License for more details. +# +# You should have received a copy of the GNU General Public License +# along with GNU Guix. If not, see . + +start() { + echo "*** ${SVNAME}: starting Guix daemon..." + + export GUIX_LOCPATH=@localstatedir@/guix/profiles/per-user/root/guix-profile/lib/locale + export LC_ALL=en_US.utf8 + exec @localstatedir@/guix/profiles/per-user/root/current-guix/bin/guix-daemon \ + --build-users-group=guixbuild --discover=no \ + --substitute-urls='https://bordeaux.guix.gnu.org https://ci.guix.gnu.org' 2>&1 +} + +reset() { + case $3 in + "exit" ) + echo "*** ${SVNAME}: exited status $4" + ;; + "signal" ) + echo "*** ${SVNAME}: killed on signal $5" + ;; + * ) + echo "*** ${SVNAME}: stopped ($3)" + ;; + esac + exit 0 +} + +eval ${TARGET} "$@" diff --git a/nix/local.mk b/nix/local.mk index 8a2b2b88e8..ffc57185cf 100644 --- a/nix/local.mk +++ b/nix/local.mk @@ -194,6 +194,18 @@ etc/openrc/guix-daemon: etc/openrc/guix-daemon.in \ "$<" > "$@.tmp"; \ mv "$@.tmp" "$@" +# The service script for perp. +perpservicedir = $(sysconfdir)/perp +nodist_perpservice_DATA = etc/perp/rc.log etc/perp/rc.main + +etc/perp/rc.%: etc/perp/rc.%.in \ + $(top_builddir)/config.status + $(AM_V_GEN)$(MKDIR_P) "`dirname $@`"; \ + $(SED) -e 's|@''localstatedir''@|$(localstatedir)|' \ + -e 's|@''GUIX_SUBSTITUTE_URLS''@|$(GUIX_SUBSTITUTE_URLS)|' \ + < "$<" > "$@.tmp"; \ + mv "$@.tmp" "$@" + # The '.conf' jobs for Upstart. upstartjobdir = $(libdir)/upstart/system nodist_upstartjob_DATA = etc/guix-daemon.conf etc/guix-publish.conf @@ -210,6 +222,7 @@ CLEANFILES += \ $(nodist_systemdservice_DATA) \ $(nodist_upstartjob_DATA) \ $(nodist_sysvinitservice_DATA) \ + $(nodist_perpservice_DATA) \ $(nodist_openrcservice_DATA) EXTRA_DIST += \ @@ -223,7 +236,9 @@ EXTRA_DIST += \ etc/guix-gc.service.in \ etc/guix-gc.timer \ etc/init.d/guix-daemon.in \ - etc/openrc/guix-daemon.in + etc/openrc/guix-daemon.in \ + etc/perp/rc.log.in \ + etc/perp/rc.main.in if CAN_RUN_TESTS -- 2.45.2