From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: from mp1.migadu.com ([2001:41d0:303:e224::]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits)) by ms13.migadu.com with LMTPS id II/qLnEoGWcGCAAA62LTzQ:P1 (envelope-from ) for ; Wed, 23 Oct 2024 16:46:41 +0000 Received: from aspmx1.migadu.com ([2001:41d0:303:e224::]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits)) by mp1.migadu.com with LMTPS id II/qLnEoGWcGCAAA62LTzQ (envelope-from ) for ; Wed, 23 Oct 2024 18:46:41 +0200 X-Envelope-To: larch@yhetil.org Authentication-Results: aspmx1.migadu.com; dkim=pass header.d=gnu.org header.s=fencepost-gnu-org header.b=hsIJP+j7; dmarc=pass (policy=none) header.from=gnu.org; spf=pass (aspmx1.migadu.com: domain of "guix-devel-bounces+larch=yhetil.org@gnu.org" designates 209.51.188.17 as permitted sender) smtp.mailfrom="guix-devel-bounces+larch=yhetil.org@gnu.org" ARC-Seal: i=1; s=key1; d=yhetil.org; t=1729702001; a=rsa-sha256; cv=none; b=XHIaiy22CJXudul2MZnUDLAaH8V8aogtte6gmk3eJk1bWk0GeUiEJDgUapk9POr640jVAi 3wLxeJo9svpDdyE6IdvcyjRPyEK9k4y2Kij16MLItNiky8m9inn5LOokaHSgTV4R666YXn S19F2jVWTqJpxbTCCW0CeL7ChVMiY6LK7g/gJRRc8rz92OvZM3Q68fC0fGDMHlA9dDB4hN /6n3vyyq5+IhPyblRK3MSykidt+qCT4gP21YMq9QY9eUa5O8iLg4UJqtESuchi6mJYeSSj AZet9mArsKD5BL2G2GDOFvWMAD/d06JU/stuCT54vKnfAtydc/sy5N+yRQpVoQ== ARC-Authentication-Results: i=1; aspmx1.migadu.com; dkim=pass header.d=gnu.org header.s=fencepost-gnu-org header.b=hsIJP+j7; dmarc=pass (policy=none) header.from=gnu.org; spf=pass (aspmx1.migadu.com: domain of "guix-devel-bounces+larch=yhetil.org@gnu.org" designates 209.51.188.17 as permitted sender) smtp.mailfrom="guix-devel-bounces+larch=yhetil.org@gnu.org" ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=yhetil.org; s=key1; t=1729702001; 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: in-reply-to:in-reply-to:references:references:list-id:list-help: list-unsubscribe:list-subscribe:list-post:dkim-signature; bh=w+4eoop1J0pPxs96cB4ktbd2ce19tlr0WhYnV8e5w18=; b=AUXDajZdl1EK7f2OC4/kYyfIMtop6+bBw1Q5EiekJHqf50upFk28IiZMI64YsXCASFtHCX mrTuo5EP6LHb34PvJnntyNj67lL8ZTjCztsyiy8U0xI+hU9nW2NhrwAzMSac1FO9fkp4GY 3xdlijhHuKXOZhrKNJ5tjRxQd28/ICRwSj1N/JQGhsf/zPbTAg6LjEqdRgqLfozivv5j+f i+lz/Aekg2Bmbo8HZLMRs88fDrPwat19DyTNzWnOlH0esazmLYDLWEXP/MyFiEPJH33rAB CDgA7cu+828j+jpyVsAT/Bw9a9wMwtbTXEqCZ6r6Vv4zAZP/IyXXYmyPwrd4Lg== 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 E7A38636E7 for ; Wed, 23 Oct 2024 18:46:40 +0200 (CEST) Received: from localhost ([::1] helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1t3eUZ-00056T-7P; Wed, 23 Oct 2024 12:45:51 -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 1t3eUW-00055x-80 for guix-devel@gnu.org; Wed, 23 Oct 2024 12:45:48 -0400 Received: from fencepost.gnu.org ([2001:470:142:3::e]) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1t3eUV-00019s-Ct; Wed, 23 Oct 2024 12:45:47 -0400 DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=gnu.org; s=fencepost-gnu-org; h=MIME-Version:Date:References:In-Reply-To:Subject:To: From; bh=w+4eoop1J0pPxs96cB4ktbd2ce19tlr0WhYnV8e5w18=; b=hsIJP+j7EB/wvp/fiBxd oIanUZ/xWT80n+/e+gQuu+1EFDNQemL1SncC0P9oODG1GizdUmPZ33wSjUTooofDINcJmJaaIE3FB ftJ39DTQnrZxu0sNsP3CkYIh8A7Nf/meGx+eAJZyUhNbz1y0JYh/RDbc77N2S2BexGs1s8WICeBjg bYgXXNknf6NbwfDkrb8v1juCXZTHemjXAQFr2H80hdz6hTPqxM7Fj+rnDv+f6RqrdxUza3aKNqZpQ 2Yun89FzbYR0WQpsty/80qU4W0A+o46OtWlQmF0iWgoVhjM+L5bl88U14CSAHg/E8XO3QOH3u/Kjo Cbb+oeU0Jm+3bA==; From: =?utf-8?Q?Ludovic_Court=C3=A8s?= To: Jakob Kirsch Cc: guix-devel@gnu.org Subject: Re: [PATCH v1] shepherd: add support for kexec In-Reply-To: <20241002170111.17526-2-jakob.kirsch@web.de> (Jakob Kirsch's message of "Wed, 2 Oct 2024 19:01:12 +0200") References: <20241002170111.17526-2-jakob.kirsch@web.de> X-URL: http://www.fdn.fr/~lcourtes/ X-Revolutionary-Date: Duodi 2 Brumaire an 233 de la =?utf-8?Q?R=C3=A9volut?= =?utf-8?Q?ion=2C?= jour du =?utf-8?Q?C=C3=A9leri?= X-PGP-Key-ID: 0x090B11993D9AEBB5 X-PGP-Key: http://www.fdn.fr/~lcourtes/ludovic.asc X-PGP-Fingerprint: 3CE4 6455 8A84 FDC6 9DB4 0CFB 090B 1199 3D9A EBB5 X-OS: x86_64-pc-linux-gnu Date: Wed, 23 Oct 2024 18:45:44 +0200 Message-ID: <87r0864vk7.fsf@gnu.org> User-Agent: Gnus/5.13 (Gnus v5.13) MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: quoted-printable X-BeenThere: guix-devel@gnu.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: "Development of GNU Guix and the GNU System distribution." List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: guix-devel-bounces+larch=yhetil.org@gnu.org Sender: guix-devel-bounces+larch=yhetil.org@gnu.org X-Migadu-Flow: FLOW_IN X-Migadu-Country: US X-Migadu-Spam-Score: -1.52 X-Spam-Score: -1.52 X-Migadu-Queue-Id: E7A38636E7 X-Migadu-Scanner: mx12.migadu.com X-TUID: 2ydoYbINguv0 Hi Jakob, Jakob Kirsch skribis: > This patch adds preliminary support for rebooting into kexec using `reboo= t -k` or `reboot --do-kexec`. Nice! That sounds useful. Some comments inline below. In the future, could you send patches to guix-patches@gnu.org, with =E2=80=9CShepherd=E2=80=9D in the subject? > --- a/configure.ac > +++ b/configure.ac > @@ -104,6 +104,7 @@ case "$host_os" in > AC_COMPUTE_INT([RB_DISABLE_CAD], [RB_DISABLE_CAD], [#include ]) > AC_COMPUTE_INT([RB_POWER_OFF], [RB_POWER_OFF], [#include ]) > AC_COMPUTE_INT([RB_SW_SUSPEND], [RB_SW_SUSPEND], [#include ]) > + AC_COMPUTE_INT([RB_KEXEC], [RB_KEXEC], [#include ]) > ;; > gnu*) > # On GNU/Hurd, the Mach-derived reboot.h uses different names, and Please also handle the Hurd case, similar to how =E2=80=98RB_DISABLE_CAD=E2= =80=99 is handled. > +++ b/modules/shepherd/scripts/reboot.scm > @@ -30,6 +30,8 @@ > (define (main . args) > (initialize-cli) > > + (define reboot-action 'stop) Or just =E2=80=98action=E2=80=99? > + #:action (lambda () (set! reboot-action 'reboot-ke= xec)) =E2=80=A6 and just =E2=80=98kexec=E2=80=99? > + (reboot-kexec > + "Reboot the system and run kexec." Likewise, I=E2=80=99d call it just =E2=80=98kexec=E2=80=99. Could you expand the docstring a bit to give an overview of what =E2=80=9Ck= exec=E2=80=9D does for users not familiar with it? > +(define (reboot-kexec) > + "Execute kernel loaded with 'kexec -l' now. Return #f on failure." =E2=80=9CExecute the Linux kernel previously loaded with 'kexec -l'. Throw= an exception on failure.=E2=80=9D > + (%libc-reboot RB_KEXEC)) Please address the case where RB_KEXEC is #f by doing something like: (throw 'system-error 'kexec "~A" (list (strerror ENOSYS)) (list ENOSYS)) Could you also update =E2=80=98doc/shepherd.texi=E2=80=99, specifically the= reference of the =E2=80=98reboot=E2=80=99 command and the list of actions of the =E2=80= =98root=E2=80=99 service? Thanks for this work! Ludo=E2=80=99.