From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: from mp0.migadu.com ([2001:41d0:303:e16b::]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits)) by ms13.migadu.com with LMTPS id yPFCCDnXQ2cEaQEAqHPOHw:P1 (envelope-from ) for ; Mon, 25 Nov 2024 01:47:37 +0000 Received: from aspmx1.migadu.com ([2001:41d0:303:e16b::]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits)) by mp0.migadu.com with LMTPS id yPFCCDnXQ2cEaQEAqHPOHw (envelope-from ) for ; Mon, 25 Nov 2024 02:47:37 +0100 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=gHb5bE1t; dkim=fail ("headers rsa verify failed") header.d=gmail.com header.s=20230601 header.b=nr3Gk5mI; dmarc=fail reason="SPF not aligned (relaxed), DKIM not aligned (relaxed)" header.from=gmail.com (policy=none); 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" ARC-Seal: i=1; s=key1; d=yhetil.org; t=1732499256; a=rsa-sha256; cv=none; b=IM2kBID5a4zPP3pU26ujRyAC/yb4IEMNMDvUnbakoNy4kg/NGkIzHkZTVd5IYc5lxOdH9e a1ta7l1w0IrAuorMCjyd7yw+RdRANUzfKgpn7mNP0B/GUfkM/n5FRtSW2xcFvy7yfyGaUO qEb69NqxGUFlCqcfz2nW0Sc+yGO0jB0UHJ+k5scRDRR/fP/pwnaB2wZlkvhTdO4yWKtm/S YtWBgcyyHDGtSyRSZ1dG1Wm1jsnKcsGtZZv+6x+WdN0AJYURiD50foBcVrtt7ra9JRtKzR EYG7y9r+Ir/W5FgfAQBXY5oEZVNHNoOJvwgr9SHOfUaXWKAPsqS5qxCwrikjpw== ARC-Authentication-Results: i=1; aspmx1.migadu.com; dkim=pass header.d=debbugs.gnu.org header.s=debbugs-gnu-org header.b=gHb5bE1t; dkim=fail ("headers rsa verify failed") header.d=gmail.com header.s=20230601 header.b=nr3Gk5mI; dmarc=fail reason="SPF not aligned (relaxed), DKIM not aligned (relaxed)" header.from=gmail.com (policy=none); 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" ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=yhetil.org; s=key1; t=1732499256; 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=wifBJKUxPtqYTDGQtDaGF3WYT39zCXduvDxnXa4vsgs=; b=fFEBqRzQ7lBcG2YL0zUnNTZIFVXnmFFGqJdJTkameLJGhM0rSqIe4r5yK/ycqr/cz9ddPX vRk1t0YWNPOP2B321L1GJTGwhrzxGx5Bsv3FCo1cpkmx1hivQLd+1Bp0EXkt/Y2PQ4fpRZ ad1TxmRNNK6CGbxvq7mJrCRKKy+Ih9mVHyAJqszEVX2GeY07LcBX44jw/NtUgXyNAdPfrW GJA8bNaiQbItqVuGOidQ2trT81VYrPKH7rSUhIKEpt1eUVvORubcC54djidqvLNCXM6AX6 GdZqCM1xgPkv571Gk8/OcjhCCdOci3j/Js5pEmXbSmVN0tcVQTxGV/Jz3PbILA== 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 AA8B45ECCE for ; Mon, 25 Nov 2024 02:47:36 +0100 (CET) Received: from localhost ([::1] helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1tFOBx-0002RO-Ti; Sun, 24 Nov 2024 20:47:09 -0500 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 1tFOBr-0002R6-N7 for guix-patches@gnu.org; Sun, 24 Nov 2024 20:47:03 -0500 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 1tFOBq-0003SL-ON for guix-patches@gnu.org; Sun, 24 Nov 2024 20:47:03 -0500 DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=debbugs.gnu.org; s=debbugs-gnu-org; h=MIME-Version:Date:References:In-Reply-To:From:To:Subject; bh=wifBJKUxPtqYTDGQtDaGF3WYT39zCXduvDxnXa4vsgs=; b=gHb5bE1t4nObQr9p1/9XllQadFNKsVprzKR81HzuGK86Y269Fkve2ZiGbrwgITEwqNBcC7IZm1NRezgavCUEu15BSkvu+gdaZ6xzXoDsKDCXMTHKadCnJoxO1rcyLvHnUMl+1U3ZOBNHZDlzTQ7KVoTdLfj2CVHh9ISlhU2LA1fs9iwyc6WKH7P+wARrn9HMhvxUVgZ5nAkjSAxNzgjv1X/ZiGOCerQJ/KFa7JeO27iYsLxisfyi26gH4ejUblxUl0cObLDn9b5TNv61fnESrucXPUSqxyqEhc9WcFvoYUQv1JO98W4AKeSTsl8ncfEcjWE5tfLFK66Mo3lkP/BJyQ==; Received: from Debian-debbugs by debbugs.gnu.org with local (Exim 4.84_2) (envelope-from ) id 1tFOBq-00084E-Bu for guix-patches@gnu.org; Sun, 24 Nov 2024 20:47:02 -0500 X-Loop: help-debbugs@gnu.org Subject: [bug#74508] [PATCH 1/2] services: mingetty: Add additional configuration options. Resent-From: Maxim Cournoyer Original-Sender: "Debbugs-submit" Resent-CC: guix-patches@gnu.org Resent-Date: Mon, 25 Nov 2024 01:47:02 +0000 Resent-Message-ID: Resent-Sender: help-debbugs@gnu.org X-GNU-PR-Message: followup 74508 X-GNU-PR-Package: guix-patches X-GNU-PR-Keywords: patch To: Tomas Volf <~@wolfsden.cz> Cc: 74508@debbugs.gnu.org, Ludovic =?UTF-8?Q?Court=C3=A8s?= Received: via spool by 74508-submit@debbugs.gnu.org id=B74508.173249919830973 (code B ref 74508); Mon, 25 Nov 2024 01:47:02 +0000 Received: (at 74508) by debbugs.gnu.org; 25 Nov 2024 01:46:38 +0000 Received: from localhost ([127.0.0.1]:36636 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1tFOBR-00083V-PF for submit@debbugs.gnu.org; Sun, 24 Nov 2024 20:46:38 -0500 Received: from mail-oi1-f178.google.com ([209.85.167.178]:53307) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1tFOBO-00083M-KM for 74508@debbugs.gnu.org; Sun, 24 Nov 2024 20:46:35 -0500 Received: by mail-oi1-f178.google.com with SMTP id 5614622812f47-3ea48624a2aso197000b6e.2 for <74508@debbugs.gnu.org>; Sun, 24 Nov 2024 17:46:34 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20230601; t=1732499134; x=1733103934; darn=debbugs.gnu.org; h=mime-version:user-agent:message-id:date:references:in-reply-to :subject:cc:to:from:from:to:cc:subject:date:message-id:reply-to; bh=wifBJKUxPtqYTDGQtDaGF3WYT39zCXduvDxnXa4vsgs=; b=nr3Gk5mIdn/SmxPNYw6djZF9kEJzzsuJN+uWewoeVJ4V1F0Woy7PaxoK+G/2pe7E+2 GXhBqsOYkFl16HEqHiPwe5AOKDWpazkqpUcxlPHTqq5QV2bmCxCKNNHiJz/u14OR7K6l kMYccrIUNJKs272oN6qhZThQmAYY3x8MCuN/cNaSY04wyJ2VUxxMdhdhJRhNOIsWREEL +p40AfMt6uJvwdp5eudZDa1btTNQbrCy9GSn6oJ9OFBCw1IyGoJsMm1DRheer98nVNE5 Lq5y1zP/+TCXEEnCSb/J3azePscuiSggYf13eVjcsjXju0Mox2Oqa8i47+HskFs8Kn0S 949w== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1732499134; x=1733103934; h=mime-version:user-agent:message-id:date:references:in-reply-to :subject:cc:to:from:x-gm-message-state:from:to:cc:subject:date :message-id:reply-to; bh=wifBJKUxPtqYTDGQtDaGF3WYT39zCXduvDxnXa4vsgs=; b=dzn/JG2Ny6v2MXtDmEbu7PRtNn3hP7IGInQ+pFht3rb+mAjFe5w3bavMJaHFbn4URx lzAqUObNjVJR7+q4YNvXUaoBcQHYTPvYdvm4howGYyNr7xljEfjy4SZsP5YuOKb90sjd Jv2ovP+tRaBljYM8ywm3FDImzKl08oGKSOrZyFeVyercOu2Mo+VtkZ41GhN3ZLoOKuxN dqwlvqno1An9C7Xpr+2sKkShBhoehiTx6i7Cpff42/27RKSnoXOLZgzj/M4jZ/l2cca6 DVgy0Mjifh3PaHbYaLSsHbCza4r6sutZvKTXiLLuq3oDhWaMLYS4J0fwf8m7yTXkBrLn 3bJg== X-Gm-Message-State: AOJu0YwaWsgVtsGTmC1LkCDtO9X8YCIPvilbm/xNK0PFH+T7w0LysDcv /TioESYFQ7nBvIbMzkTylTGHFvCADv2PByttfERhqTFrnO+cjGyT X-Gm-Gg: ASbGnctPTw9+jfwFe+b/brsqZNlloYbOJa9tdT82qhezijJvJrFWWmnyLf4jHe8ML1i KAaK/XzMovfpqgjV4otxbvWaHIKuAUPEZW2O9+Xw356OG+aN1qiexI1YaHT4Z6JXCek/OxF7FgF 0Y2j3S44pgXfMm5zbJHPWplJIV4Z/v4fkgqvqmFFQRUaGjNyZnqtiKaK3utxTaRZ/ucXLP2JWU3 HEp46K5pGMNSjc5MBZ2EKKwcg0a5A22X+6+4uxr+OZGNhQ= X-Google-Smtp-Source: AGHT+IEjbcuB1FXDI+lTQQB6Q2uALRH7lrDTmIe6JTkjI8oIKB2OLcsj7if5yzXi60LWYouBK6Tm4g== X-Received: by 2002:a05:6808:1921:b0:3e6:65f8:8f28 with SMTP id 5614622812f47-3e915875613mr9176006b6e.21.1732499133756; Sun, 24 Nov 2024 17:45:33 -0800 (PST) Received: from terra ([2405:6586:be0:0:c8ff:1707:9b9:af89]) by smtp.gmail.com with ESMTPSA id 41be03b00d2f7-7fbcc3fb34dsm5410922a12.78.2024.11.24.17.45.32 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Sun, 24 Nov 2024 17:45:33 -0800 (PST) From: Maxim Cournoyer In-Reply-To: (Tomas Volf's message of "Sun, 24 Nov 2024 15:31:32 +0100") References: Date: Mon, 25 Nov 2024 10:45:24 +0900 Message-ID: <87jzcsnl1n.fsf@gmail.com> User-Agent: Gnus/5.13 (Gnus v5.13) MIME-Version: 1.0 Content-Type: text/plain 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-Flow: FLOW_IN X-Migadu-Country: US X-Migadu-Queue-Id: AA8B45ECCE X-Migadu-Scanner: mx13.migadu.com X-Migadu-Spam-Score: -8.29 X-Spam-Score: -8.29 X-TUID: wMW4mgMBaJOd Hello, Tomas Volf <~@wolfsden.cz> writes: > Not all aspects of mingetty were configurable, so this commit adds the > additional configuration fields to support that. > > It also renames the accessors for all fields except `tty'. They were named > just `mingetty-$FIELD', instead of `mingetty-configuration-$FIELD'. However > the renaming *is* backwards compatible, since in the define-module's #:export > argument the correct (`mingetty-configuration-$FIELD') were used already. > Hence, until now, there was no way to access anything except the `tty' field. Fun, good catch! I find it odd that Guile doesn't warn or error when exporting a symbol that isn't defined; I was bit by that recently myself. Personally I'd have effected that correction in a distinct commit, to keep your new functionality diff to its bare minimum (clearer/easier to review). > * gnu/services/base.scm (): Add delay, print-issue, > print-hostname, nice, chdir, chroot fields. Rename accessors for auto-login, > login-program, login-pause?, clear-on-logout?. Are all these expected to be functional on Guix, e.g., the 'chroot' option? > (mingetty-shepherd-service): Use the new fields. > (define-module)<#:export>: Export the new accessors. > * doc/guix.texi (Base Services): Document the > additional field. > > Change-Id: I4557a82498805ade0b341feda9d33eccc305690f > --- > doc/guix.texi | 27 ++++++++++++++++++- > gnu/services/base.scm | 62 ++++++++++++++++++++++++++++++++++++------- > 2 files changed, 79 insertions(+), 10 deletions(-) > > diff --git a/doc/guix.texi b/doc/guix.texi > index 1c39628ffa..d689711e80 100644 > --- a/doc/guix.texi > +++ b/doc/guix.texi > @@ -19285,7 +19285,32 @@ Base Services > will have to press a key before the log-in shell is launched. > > @item @code{clear-on-logout?} (default: @code{#t}) > -When set to @code{#t}, the screen will be cleared after logout. > +When set to @code{#t}, the screen will be cleared before showing the > +login prompt. The field name is bit unfortunate, since it controls > +clearing also before the initial login, not just after a logout. > + > +@item @code{delay} (default: @code{#f}) > +When set to a number, sleep that many seconds after startup. > + > +@item @code{print-issue} (default: @code{#t}) > +When set to @code{#t}, write out a new line and the content of > +@file{/etc/issue}. Value of @code{'no-nl} can be used to suppress the > +new line. This sounds useful. Could it be used in place of a 'motd', such as in our hydra/berlin.scm conf (from the Guix maintenance repo), which is currently relying on PAM to work (and doesn't currently seem to do anything, at least on berlin, for unknown reason). > +@item @code{print-hostname} (default: @code{#t}) > +When set to @code{#t}, print the host name before the login prompt. The > +host name is printed up to the first dot. Can be set to @code{'long} to > +print the full host name. > + > +@item @code{nice} (default: @code{#f}) > +When set to a number, change the process priority using @code{nice}. > + > +@item @code{chdir} (default: @code{#f}) > +When set to a string, change into that directory before calling the > +login program. > + > +@item @code{chroot} (default: @code{#f}) > +When set to a string, call @code{chroot} with that directory. > > @item @code{mingetty} (default: @var{mingetty}) > The Mingetty package to use. > diff --git a/gnu/services/base.scm b/gnu/services/base.scm > index 6473e1a91a..b3d3553091 100644 > --- a/gnu/services/base.scm > +++ b/gnu/services/base.scm > @@ -186,7 +186,12 @@ (define-module (gnu services base) > mingetty-configuration-login-program > mingetty-configuration-login-pause? > mingetty-configuration-clear-on-logout? > - mingetty-configuration-mingetty Why is the above accessor removed? > + mingetty-configuration-delay > + mingetty-configuration-print-issue > + mingetty-configuration-print-hostname > + mingetty-configuration-nice > + mingetty-configuration-chdir > + mingetty-configuration-chroot > mingetty-configuration? > mingetty-service ; deprecated > mingetty-service-type > @@ -1242,20 +1247,33 @@ (define-record-type* > mingetty-configuration? > (mingetty mingetty-configuration-mingetty ;file-like > (default mingetty)) > - (tty mingetty-configuration-tty) ;string > - (auto-login mingetty-auto-login ;string | #f > + (tty mingetty-configuration-tty) ;string > + (auto-login mingetty-configuration-auto-login ;string | #f > (default #f)) > - (login-program mingetty-login-program ;gexp > + (login-program mingetty-configuration-login-program ;gexp > (default #f)) > - (login-pause? mingetty-login-pause? ;Boolean > + (login-pause? mingetty-configuration-login-pause? ;Boolean > (default #f)) > - (clear-on-logout? mingetty-clear-on-logout? ;Boolean > - (default #t))) > + (clear-on-logout? mingetty-configuration-clear-on-logout? ;Boolean > + (default #t)) > + (delay mingetty-configuration-delay ;Integer | #f > + (default #f)) > + (print-issue mingetty-configuration-print-issue ;Boolean | Symbol > + (default #t)) > + (print-hostname mingetty-configuration-print-hostname ;Boolean | Symbol > + (default #t)) > + (nice mingetty-configuration-nice ;Integer | #f > + (default #f)) > + (chdir mingetty-configuration-chdir ;String | #f > + (default #f)) > + (chroot mingetty-configuration-chroot ;String | #f > + (default #f))) > > (define (mingetty-shepherd-service config) > (match-record config > - (mingetty tty auto-login login-program > - login-pause? clear-on-logout?) > + (mingetty tty auto-login login-program > + login-pause? clear-on-logout? delay > + print-issue print-hostname nice chdir chroot) > (list > (shepherd-service > (documentation "Run mingetty on an tty.") > @@ -1286,6 +1304,32 @@ (define (mingetty-shepherd-service config) > #~()) > #$@(if login-pause? > #~("--loginpause") > + #~()) > + #$@(if delay > + #~("--delay" #$(number->string delay)) > + #~()) > + #$@(match print-issue > + (#t > + #~()) > + ('no-nl > + #~("--nonewline")) > + (#f > + #~("--noissue"))) > + #$@(match print-hostname > + (#t > + #~()) > + ('long > + #~("--long-hostname")) > + (#f > + #~("--nohostname"))) > + #$@(if nice > + #~("--nice" #$(number->string nice)) > + #~()) > + #$@(if chdir > + #~("--chdir" #$chdir) > + #~()) > + #$@(if chroot > + #~("--chroot" #$chroot) > #~())))) > (stop #~(make-kill-destructor)))))) Neatly crafted. Could you please send a v2 with my small comments above addressed, such as splitting in two commits, and not removing the 'mingetty-configuration-mingetty' accessor? Other than that, LGTM. -- Thanks, Maxim