From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: from mp0.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 4CI9C/BgXGe8WwAAqHPOHw:P1 (envelope-from ) for ; Fri, 13 Dec 2024 16:29:36 +0000 Received: from aspmx1.migadu.com ([2001:41d0:303:e224::]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits)) by mp0.migadu.com with LMTPS id 4CI9C/BgXGe8WwAAqHPOHw (envelope-from ) for ; Fri, 13 Dec 2024 17:29:36 +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=XlX8csJ9; dkim=fail ("headers rsa verify failed") header.d=wolfsden.cz header.s=mail header.b=R9N7iKQz; dkim=fail ("headers rsa verify failed") header.d=wolfsden.cz header.s=mail header.b=FEiXlC5Q; 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=1734107374; a=rsa-sha256; cv=none; b=PFR4Iu6zoJeX7uK89mNl2PgB2Bj/j/xxuvOmy4kuCw0o6rmaQZahXpiiZtWlKRpqer5u6O jIHo3SqvBpALwC7UPiRqWxX6NsG+9dswp2lgnIK8st9effOsP4w0q8TZaKr+3eseZ8qSKv CFa1HUn1GprVvSLS0LAh9hrugX3fC+SxGiIQjyzT5OLPnAep3ogxhcefXToa2NqkiDkBlf O8HS1/dzfZNdEis0Yh1BTBi3q3lBAvzOdt4pVvR7OisPGfc/CHi9e5ikQSZQwWPt31Dmtd g3njc8eaqV9azFKQiejnELtgWtlCraETbGKv+x0xxus6NYpeS3fLmCEoIesvTA== ARC-Authentication-Results: i=1; aspmx1.migadu.com; dkim=pass header.d=debbugs.gnu.org header.s=debbugs-gnu-org header.b=XlX8csJ9; dkim=fail ("headers rsa verify failed") header.d=wolfsden.cz header.s=mail header.b=R9N7iKQz; dkim=fail ("headers rsa verify failed") header.d=wolfsden.cz header.s=mail header.b=FEiXlC5Q; 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=1734107374; 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=DXjL5o/Hjq+vKcGTPz5wAxOCH0vDSBI0haWSLsYa1fo=; b=dSd+v+bLnyBuQtXBdsLxhaNhlN/Dzd/tLR+azZTRAMG19c22N96pEt5VoPbmuII9YLEN8W niZVcFFiPjYEwtZDJkTZKEeNM8LKUP223q0Uu8gGieWJTJdW3eYiaFTlKKStJme9hkk3F+ u77MY3e6i0C9t1K1r63OnjtKKaLT+70BfV+qjQDjtizIswX3jTCphICHshNI1ukoKlPqh8 jpBVnWnS0nD0asYbmxJvEGyQ1nETjbgmnPPmRPyrJ2AsLgUg8402QSHIGlWzk46pNilnQB 6U7YHbKkuycwywm9nXbGmquRZrbnNK4djDbI5944kZI0Byy7nhcZ5AwROv0AVA== 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 D78AE67757 for ; Fri, 13 Dec 2024 17:29:33 +0100 (CET) Received: from localhost ([::1] helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1tM8XL-00036Y-2T; Fri, 13 Dec 2024 11:29: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 1tM8XI-00035n-SR for guix-patches@gnu.org; Fri, 13 Dec 2024 11:29: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 1tM8XH-000351-Av; Fri, 13 Dec 2024 11:29: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:From:To:In-Reply-To:References:Subject; bh=DXjL5o/Hjq+vKcGTPz5wAxOCH0vDSBI0haWSLsYa1fo=; b=XlX8csJ9etSNchPQGE1prdyUhpISPlVWiGv/1tvKzbm5Y3Mf9Voo2TGOPRdmtr2/VYUWpWkrrjT8AxL8d7Thl6p+wJf/QRN1i8lqcXJeb97b6xyjpSc0R2cHRk1CLw0FuVCXe54kHiAEARsc6rYGzmEuRqOd6i5jwfsXI7cNoecuTH87da8oGtSjPCroqm/Cr8HoNTlZVymblwSsao0qVw9qc+pU3NS/7Dx5HOZpMEAx2jDJ47LTXmHi64V1BOY/h5od79ztaIN2F6tz2Yqqivsdn2z8QSmt3mRrVOii6dyVgAuMqO2jz+5MmyE8VDBasZMU76DjiB96sEPfFspgyg==; Received: from Debian-debbugs by debbugs.gnu.org with local (Exim 4.84_2) (envelope-from ) id 1tM8XH-0007H4-4r; Fri, 13 Dec 2024 11:29:03 -0500 X-Loop: help-debbugs@gnu.org Subject: [bug#74508] [PATCH v4 1/3] services: mingetty: Add additional configuration options. References: In-Reply-To: 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: Fri, 13 Dec 2024 16:29: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.173410731127907 (code B ref 74508); Fri, 13 Dec 2024 16:29:03 +0000 Received: (at 74508) by debbugs.gnu.org; 13 Dec 2024 16:28:31 +0000 Received: from localhost ([127.0.0.1]:43891 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1tM8Wg-0007Fo-Oi for submit@debbugs.gnu.org; Fri, 13 Dec 2024 11:28:30 -0500 Received: from wolfsden.cz ([37.205.8.62]:60106) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from <~@wolfsden.cz>) id 1tM8Wb-0007FS-Vr for 74508@debbugs.gnu.org; Fri, 13 Dec 2024 11:28:23 -0500 Received: by wolfsden.cz (Postfix, from userid 104) id 5573936032D; Fri, 13 Dec 2024 16:28:20 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=wolfsden.cz; s=mail; t=1734107300; bh=rbCIiVIHtSEUmkuSVGkogfqYIfwoj/oQzk2IaeNfgAQ=; h=From:To:Cc:Subject:Date; b=R9N7iKQzwUy173UAHSVN+hzmjl5tzzi1sZ/exSh7ZlzL5tgklX9iTAzaVDziQ6P5Z H+5+0FpYJ7RTrODiMlgPIC8r9neoVUR4WBpCY+y2FOTXQnDMbElXZdgc59SIe0Na5V 9T91bGgFKaHGCyxfBSVw4srpQoWPGFA4e3veiyvksSytOMY9mWivbSl7h2LBH/IHHf SXKfWa7R93as9LzgmpJQDOSgn5hG23hhDu+wS1e6p9/2Hf2mw+BG5yZy1jPVSWacTZ dgXCBBXPPNh5f6kDwGBQHf1cb0YNLEQvBIBtL80XkYPmFvxlmNk99gTqtQpwQ0jpet gckQeATMN4WPbxHQ7Mkok/jcPEs4UeqckPDj9RneeCHWbYbLPvnsfrEja459LE9SCY Hr/8jlnoACVJd4gWNi0o4dbNYbt+QX+ppnu1/gIfLHZFfvDRttCfofrbyHTOfQE2XA 7Fh5CXqEZUQaVr+hPq4hXGN4VpwB01zCt9aKnaDyEDxtyb0pq8JIp98Tk3vRCpCRv/ X41evzsUucJW4K1SQtiu+MacVrWDtpWyS+HqKXqggGgrVPJ2ZEiVEmNmVr2qNZ4YJA J+R5O2bxD1vlpAZomlwkDSwDMgJfvz24u3xJOizg5qoXFyhjg5W3/K0H3aEK/03mB/ xiUPveP4mJ/ztXEnSaZwaFzE= Received: from localhost (unknown [128.0.188.242]) by wolfsden.cz (Postfix) with ESMTPSA id 88BF236032B; Fri, 13 Dec 2024 16:28:19 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=wolfsden.cz; s=mail; t=1734107299; bh=rbCIiVIHtSEUmkuSVGkogfqYIfwoj/oQzk2IaeNfgAQ=; h=From:To:Cc:Subject:Date; b=FEiXlC5Q/A6pIgEw8XkIzol7g32n4Y5g/J19EZu/5in/RbTz3PGpL2pgt36mBohml lsPBYgU3SqjTLEg1WKn1DlQlQ6fEXPo989BQedb+F0ZYXsr4cy0Zc16DVafs43uRKs /ZeZQ0eOIbT9aZiEFpKCs1E8OibO6T6XkzfKDQ/4N8AvvHl+5I3wJKJ8pgCnuSsqpo n7h+N0x/TfGw87s9RomO/4itW6iwipVoG+0iRzXSsBVeUrsTD9r952U8Jv1yLw6aJt z27xgsmydreSO2Xh8DFM5Ix4z/xYsp7GLueWISuTcDSXEDJYh8cm02cHE0Hx1zsTq/ jTNQlNYxlGZTQ8Cu4r4V8ElgJf+dTGcvtjcE8R6XLx0iHBB3aNR6z62x/0oxnbrOSG haB/3ye0ea2aMMwRIjmANx+gbKrkTMOsVHBplldEKd8Po/p4sATtXKVcspUdpKUnDb HCo32LNgG89YdwN4/F2URQ+0Ai7clbocQnIJP4BdwlLmYkEzJZrHH8+R8T3agSP7Ig 9Xje8Bn8MQQsdUFEc7cattoa6k+jCe2tXETQziBS6MPOF4wJ7Pe7A9n1kZTX2HvmS1 p6nP3Ttqx8uzvGSm+dmd7sjwmwRPhC4J6qVKOr5uE3phcxF9AdAZOICdMNkZTTWosc 4WkVT2P8zlRW4MgkDr/bl7PA= From: Tomas Volf <~@wolfsden.cz> Date: Fri, 13 Dec 2024 17:27:44 +0100 Message-ID: X-Mailer: git-send-email 2.46.0 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-Spam-Score: -2.69 X-Spam-Score: -2.69 X-Migadu-Queue-Id: D78AE67757 X-Migadu-Scanner: mx12.migadu.com X-TUID: PuvprTEXFz/v Not all aspects of mingetty were configurable, so this commit adds the additional configuration fields to support that. * gnu/services/base.scm (): Add delay, print-issue, print-hostname, nice, working-directory, root-directory fields. (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 --- v4: Update the commit message. doc/guix.texi | 28 ++++++++++++++++- gnu/services/base.scm | 72 +++++++++++++++++++++++++++++++++++-------- 2 files changed, 86 insertions(+), 14 deletions(-) diff --git a/doc/guix.texi b/doc/guix.texi index a2915de954..f5cd9461a3 100644 --- a/doc/guix.texi +++ b/doc/guix.texi @@ -19417,7 +19417,33 @@ 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{working-directory} (default: @code{#f}) +When set to a string, change into that directory before calling the +login program. + +@item @code{root-directory} (default: @code{#f}) +When set to a string, use this directory at the process's root +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..798356ed84 100644 --- a/gnu/services/base.scm +++ b/gnu/services/base.scm @@ -187,6 +187,12 @@ (define-module (gnu services base) 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-working-directory + mingetty-configuration-root-directory mingetty-configuration? mingetty-service ; deprecated mingetty-service-type @@ -1240,22 +1246,36 @@ (define-deprecated (agetty-service config) (define-record-type* mingetty-configuration make-mingetty-configuration mingetty-configuration? - (mingetty mingetty-configuration-mingetty ;file-like - (default mingetty)) - (tty mingetty-configuration-tty) ;string - (auto-login mingetty-auto-login ;string | #f - (default #f)) - (login-program mingetty-login-program ;gexp - (default #f)) - (login-pause? mingetty-login-pause? ;Boolean - (default #f)) - (clear-on-logout? mingetty-clear-on-logout? ;Boolean - (default #t))) + (mingetty mingetty-configuration-mingetty ;file-like + (default mingetty)) + (tty mingetty-configuration-tty) ;string + (auto-login mingetty-auto-login ;string | #f + (default #f)) + (login-program mingetty-login-program ;gexp + (default #f)) + (login-pause? mingetty-login-pause? ;Boolean + (default #f)) + (clear-on-logout? mingetty-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)) + (working-directory mingetty-configuration-working-directory ;String | #f + (default #f)) + (root-directory mingetty-configuration-root-directory ;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 + working-directory root-directory) (list (shepherd-service (documentation "Run mingetty on an tty.") @@ -1286,6 +1306,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 working-directory + #~("--chdir" #$working-directory) + #~()) + #$@(if root-directory + #~("--chroot" #$root-directory) #~())))) (stop #~(make-kill-destructor)))))) -- 2.46.0