From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: from mp2.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 oNe6EzQ5Q2ccLgEAe85BDQ:P1 (envelope-from ) for ; Sun, 24 Nov 2024 14:33:24 +0000 Received: from aspmx1.migadu.com ([2001:41d0:303:e16b::]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits)) by mp2.migadu.com with LMTPS id oNe6EzQ5Q2ccLgEAe85BDQ (envelope-from ) for ; Sun, 24 Nov 2024 15:33:24 +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=uhy7npnl; dkim=fail ("headers rsa verify failed") header.d=wolfsden.cz header.s=mail header.b=Y05XJ2gF; dkim=fail ("headers rsa verify failed") header.d=wolfsden.cz header.s=mail header.b=NR5t+S7p; dmarc=fail reason="SPF not aligned (relaxed), DKIM not aligned (relaxed)" header.from=wolfsden.cz (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=1732458804; a=rsa-sha256; cv=none; b=tlXOt2ss8c25gWT1XC0MZJPyqAO+jownKXnpjhHGZTiixhM3o5MpPFe16S0Qm6LvVmBsTj Fr+3/jujBYoCcBiFVV8U/SbhbOdjfdn/zHa6sugbApJN8GotoivOuvh1k1Nf+TO76j/4uZ FuhHZiMpcHWuq8L/mysZIpjM8uAmHrFO+1innRkAJ//K3TnlDf4Mu6cCSXH4XT3KUT8ZU/ 8cnCOlhsA6BeTIIaqw0fmQl9bwifU33wDFrYIGeh7M1m9au7CTPdeGl0fZtOOyZDiOl48b CWF9XC7lRJyp02m9dSx6cCbIdgcqtjhmBTxZoJZ3sBQcvZIIn0weAFtnHo2WXA== ARC-Authentication-Results: i=1; aspmx1.migadu.com; dkim=pass header.d=debbugs.gnu.org header.s=debbugs-gnu-org header.b=uhy7npnl; dkim=fail ("headers rsa verify failed") header.d=wolfsden.cz header.s=mail header.b=Y05XJ2gF; dkim=fail ("headers rsa verify failed") header.d=wolfsden.cz header.s=mail header.b=NR5t+S7p; dmarc=fail reason="SPF not aligned (relaxed), DKIM not aligned (relaxed)" header.from=wolfsden.cz (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=1732458804; h=from:from:sender:sender:reply-to:subject:subject:date:date: message-id:message-id:to:to:cc:cc:mime-version:mime-version: 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=CaLT4ddPN2ftUCf6eYYZfG7ScnohS33mCGV+DO4cCr0=; b=Iz0KQmLwdcuvih4wUO762UbG8SJcuSCdLFA1MOP8i324UVb64iMR40N5umZBk1UE6KT/ch xY/cs7SAWasOo/ReUcK4YD9J6y2j4nJihHyd8WF44TKVYOnGVxi42LzgPHzGGsjp03uEGY yxmJ6vHBapBnwT+NzDFBvTDxuufl4J9RgppKI6BaElDX2Axx8En6Eo0U3rAZK/I8M8ezPf odzaLavwCBs5QiJ1oJcI7JReJcN9TdgWYy5JQS4dcFdQGahSnie6GfPU2XQvW54xMV1aNV TzVVUX391eilp6M5YvmRCTq1PyyViPrJKbWhYp5KQM8PTLMzqvhEHyjyVBdJEA== 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 C580E4329 for ; Sun, 24 Nov 2024 15:33:22 +0100 (CET) Received: from localhost ([::1] helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1tFDff-0003YQ-Hh; Sun, 24 Nov 2024 09:33:07 -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 1tFDfb-0003Xi-Ox for guix-patches@gnu.org; Sun, 24 Nov 2024 09:33:04 -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 1tFDfb-0003zd-FN; Sun, 24 Nov 2024 09:33: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:References:In-Reply-To:Date:From:To:Subject; bh=CaLT4ddPN2ftUCf6eYYZfG7ScnohS33mCGV+DO4cCr0=; b=uhy7npnlMHL6k+uGFUaQmlltpdJ0xaom0iHBulauMdvvfvSQ9w5z9u78OWO78x+d+7Rwu3/DyOVDeZeT5OgwEvxr4icnjLZ+MRU64Fg+hnGqV6hD1WiZsEful+guCfb63mEg4X3uZFRbR+vojgPnga7vq+2dd1twa7+7zH9RTa2fsfUGEeikrOQUs6lBdL9PBaEeoostaBf+L7RAswUFfuw8KiBErr5Tawl3Xq/luQPTKKsRYMhnFafdnrD4MdbeR+Nypfhqxyd953kyHbu3yQParyDmPpJORRvyGRKynt8Jzzt2FvH/zkOI6LuWsZdeBjm5sOLVmh5H+d5pnyw9CQ==; Received: from Debian-debbugs by debbugs.gnu.org with local (Exim 4.84_2) (envelope-from ) id 1tFDfb-0007z4-7X; Sun, 24 Nov 2024 09:33:03 -0500 X-Loop: help-debbugs@gnu.org Subject: [bug#74508] [PATCH 1/2] services: mingetty: Add additional configuration options. Resent-From: Tomas Volf <~@wolfsden.cz> Original-Sender: "Debbugs-submit" Resent-CC: ludo@gnu.org, maxim.cournoyer@gmail.com, guix-patches@gnu.org Resent-Date: Sun, 24 Nov 2024 14:33:03 +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: 74508@debbugs.gnu.org Cc: Tomas Volf <~@wolfsden.cz>, Ludovic =?UTF-8?Q?Court=C3=A8s?= , Maxim Cournoyer X-Debbugs-Original-Xcc: Ludovic =?UTF-8?Q?Court=C3=A8s?= , Maxim Cournoyer Received: via spool by 74508-submit@debbugs.gnu.org id=B74508.173245872530536 (code B ref 74508); Sun, 24 Nov 2024 14:33:03 +0000 Received: (at 74508) by debbugs.gnu.org; 24 Nov 2024 14:32:05 +0000 Received: from localhost ([127.0.0.1]:33333 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1tFDed-0007wK-65 for submit@debbugs.gnu.org; Sun, 24 Nov 2024 09:32:04 -0500 Received: from wolfsden.cz ([37.205.8.62]:55148) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from <~@wolfsden.cz>) id 1tFDeZ-0007vr-6p for 74508@debbugs.gnu.org; Sun, 24 Nov 2024 09:32:00 -0500 Received: by wolfsden.cz (Postfix, from userid 104) id 53B4833FBCA; Sun, 24 Nov 2024 14:31:58 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=wolfsden.cz; s=mail; t=1732458718; bh=nVRPYe/2cNx/pgLkZgdPpl+GkPfj8rBQdN0LbpA82rg=; h=From:To:Cc:Subject:Date:In-Reply-To:References; b=Y05XJ2gFON3pLUW0Pq3zxWcIelKvpzA4bHHU6xWNFpr/RG9vwUBB4B6GigCIGlHeA gyMlXFU1H0w2HytF3twaXZ8sXr9xLPMkH6evcdPO3t0M3l/4G+FLWrlZ8zyEXBtLD8 ANw+gO7Ip5fvawWVJmUwXQtzCzi718GvhnfRgRK8c0uUldzZ/94NkTVgc6qgQgHnV+ xXaGxpdTYs6YI6u+cfT4R55224xM7HpCYdqJguzfOtm0K1NyRYuhmrxertchheAp5P KJDSughUplRm8xtZnaUi0yyNvhiU6RFMivAX925tgPLXJ7e/JtvurDxZOXhxx9Nldt dsOo9aMOoYsFVHjdRoEniNv+kU1aTLH7VgKAXUuLVdSAIMKZRLyRfzPiBKcCRnUuJS /2bP5Fp7cMQEQ7dmhEB7cLn8grBvof4SzASTn6eKICaOUbaZTLgNbv+U2Lg3dyfTKv +WScx9JZLBVsk7Pi/WDeu3S6oL+dqG9AZ6CKCyovMcVZFR4o5xypTb8YQXWKobvXJp iUkcilNEBSr8qiqmipyhCBhqj2F6GjfrfrCWgGsg3Sm9Rcb39rjaTefmEUAMrlH/Ib jaCrzXs0UoIgk6GgIveal/t3spDCKBx9PJL9no0G8WgTrSCvL9X7Wtm2qIOP30hP21 2TtxdSnQsDf1hzINTiV8XCKA= Received: from localhost (unknown [128.0.188.242]) by wolfsden.cz (Postfix) with ESMTPSA id A2AD7341139; Sun, 24 Nov 2024 14:31:57 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=wolfsden.cz; s=mail; t=1732458717; bh=nVRPYe/2cNx/pgLkZgdPpl+GkPfj8rBQdN0LbpA82rg=; h=From:To:Cc:Subject:Date:In-Reply-To:References; b=NR5t+S7pI+K9DumUahLU5V5M09AzF0qWfpTKUFQD74Y4OUOYPO2eB13ubltblw3nW TKQ6TkvQe869eZt+DdJvGgtwzCV3VHYDBIo5Zud9Qay/jjfZwGC+XxST1CZ3Rd1KQ1 ZTxsHreVGbZLW98BjdPdOXEpx6FURnmlNNQaNoeH1nZcaoWV8hd8FwEJbVrKdBntkr EtGVeU1HQcwt+RVrXrJ/OjeJekst0jyl2Z6ftcIriKH6ky3+WhS68RjcQ5TZBdGx+b oxbaKCByya6a80bgdgsuXMB9zp2dK/KiMag9bExTMiiUJaboH9ZpShfppaXeJLgEab TynB6UfaW/eBEOtumeFS4lJZ0m5QDsLYnsFr+r8OLwtl4QSEEB53adZndsGKpK0g0G 23qbpiFrNcTVTR+jENyEvjn4Sdyw3+Uh++XshtFYQiToLqCDnAek/4UAfiI1MaISKk B3RuZQv3V/ln1FIRbdH3ovBOvE67PZFEUmO4DvqW/5u1QAjLCL1TFGRBCQhjfmNMnK N9t8LbkKm2vJpVpACLQKWod8yqBwEF4mW6KBNRSoe2BiVW8cPmbHGMFpxqgC8dW6SG qfswaC9jMV1WHgZlYzRC7jY0AGycWtmuDjNX7KyCKfQ+tVqaUdH7GVay5NV9HSYOY3 LzVg3KsMy79rUY6+OS6KvMac= From: Tomas Volf <~@wolfsden.cz> Date: Sun, 24 Nov 2024 15:31:32 +0100 Message-ID: X-Mailer: git-send-email 2.46.0 In-Reply-To: References: MIME-Version: 1.0 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-Flow: FLOW_IN X-Migadu-Country: US X-Migadu-Queue-Id: C580E4329 X-Migadu-Scanner: mx13.migadu.com X-Migadu-Spam-Score: -3.29 X-Spam-Score: -3.29 X-TUID: vUF7+kZ3bcVw 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. * 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?. (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. + +@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 + 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)))))) -- 2.46.0