From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: from mp1.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 EEnsMqhNTmeBUAAA62LTzQ:P1 (envelope-from ) for ; Tue, 03 Dec 2024 00:15:36 +0000 Received: from aspmx1.migadu.com ([2001:41d0:303:e16b::]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits)) by mp1.migadu.com with LMTPS id EEnsMqhNTmeBUAAA62LTzQ (envelope-from ) for ; Tue, 03 Dec 2024 01:15: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=VfkHuMrt; dkim=fail ("headers rsa verify failed") header.d=wolfsden.cz header.s=mail header.b=xAYYgrVi; dkim=fail ("headers rsa verify failed") header.d=wolfsden.cz header.s=mail header.b=gIAkrZ5Y; 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=1733184935; a=rsa-sha256; cv=none; b=llQ6Nc4TudwMHwCBHIeWEItXmklg01cmowPJC4EtXAqzvbGrnrfhqnS3f/Y4Bm7cjoo6Kf +Yb9ZyqgCDkdbpR+es2KSwummS3wkF2BYslFNPv7aQt5yURINZdX69XiINbqzzGJq2KGWz v9GPz5loMlH751LuP+hdk5KyfTpU0Xt6Ucvmw3CH2XOdufYirCMb/8uimUNmDIDN4rg7P7 YAjMiJaF2Lr64wGi7Y8vQdUyEHww3vyquU522N5hEyKHyegYP9XdniRjY3ykpXcd+4EXOX 4sFujl/oBA3ZPct776skKUubEqrsRSbUwnH9v6he15KPbexKIHdvqvfTGvmH2Q== ARC-Authentication-Results: i=1; aspmx1.migadu.com; dkim=pass header.d=debbugs.gnu.org header.s=debbugs-gnu-org header.b=VfkHuMrt; dkim=fail ("headers rsa verify failed") header.d=wolfsden.cz header.s=mail header.b=xAYYgrVi; dkim=fail ("headers rsa verify failed") header.d=wolfsden.cz header.s=mail header.b=gIAkrZ5Y; 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=1733184935; 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=mkhiX//A27R/JgVk9KtWhLyJmYEUXpvdYt6BdPhfCpk=; b=WC3cj187VSNhNtiZZPRb1h4rxw/JORYbfA5sz1Cj6TjkU7Nh8qxvry9zOUmpe5Viy/s+jj 8CaD8/OocbXLrMjG0cP7Pc9k1wH4XpSJE5VAK6VeeOLKQfBgNP+wsDQeX0CXYQWGSSLPyJ FltaZVkIGWFbxAlRNwX7MsfcM4iKvZs+bF1uJKY7SgHZtTLgR8R0NhzBYzZIrPEz+jJ0gX rlYPUy3OWaHzdiUichKWQS6mugp0mQTcwRCrPmP+h7/+wqiN/dKRBuWTIQD4gbaWKn4PEd fct7v/FPW73mstEyDT2udEM60c7cF0bwD/csCwnXOv3e7crgqCLYaXvSpGCwog== 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 AAD9F50652 for ; Tue, 03 Dec 2024 01:15:35 +0100 (CET) Received: from localhost ([::1] helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1tIGZF-0003M1-CD; Mon, 02 Dec 2024 19:15:05 -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 1tIGZC-0003LR-V3 for guix-patches@gnu.org; Mon, 02 Dec 2024 19:15: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 1tIGZC-0002dz-LK; Mon, 02 Dec 2024 19:15:02 -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=mkhiX//A27R/JgVk9KtWhLyJmYEUXpvdYt6BdPhfCpk=; b=VfkHuMrt5DFaWJFhSC0N9lBj1HqolmnrOF51PcWrJ/WQGKla2n7HrOO5kDKeadqKaO5NTCSqSTle9GsgnLGrs+QLr1AyncfY8sJqRAvhwMC2W8cf8eX6r5iVVlOE21jvRKTKso++PSFjY/QDZXDAgGw0XV6UV6vA4Fct2SyuvF3kex1YqQBzTJcuXDDpQ5n2oyIfILtd7iXQsuPtp0jttQX2YtrIIfJ7Q0QZAYGFVe0hoeeOxQruhAWevwheAk7+QU3bk8uZr6fchRqQqcnM8rMMqVmf1ZlG0dwlyO3bvlIbjDJCTdFW516GJcEi1KDRuIO5QZmExu7JY/6GUz+SyQ==; Received: from Debian-debbugs by debbugs.gnu.org with local (Exim 4.84_2) (envelope-from ) id 1tIGZC-0000O5-FC; Mon, 02 Dec 2024 19:15:02 -0500 X-Loop: help-debbugs@gnu.org Subject: [bug#74508] [PATCH v3 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: Tue, 03 Dec 2024 00:15: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: 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.17331848911432 (code B ref 74508); Tue, 03 Dec 2024 00:15:02 +0000 Received: (at 74508) by debbugs.gnu.org; 3 Dec 2024 00:14:51 +0000 Received: from localhost ([127.0.0.1]:57058 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1tIGZ0-0000N0-Ad for submit@debbugs.gnu.org; Mon, 02 Dec 2024 19:14:50 -0500 Received: from wolfsden.cz ([37.205.8.62]:50584) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from <~@wolfsden.cz>) id 1tIGYw-0000MO-03 for 74508@debbugs.gnu.org; Mon, 02 Dec 2024 19:14:47 -0500 Received: by wolfsden.cz (Postfix, from userid 104) id 796DF33822C; Tue, 3 Dec 2024 00:14:44 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=wolfsden.cz; s=mail; t=1733184884; bh=xy17UZ4oAJ03u1k7BjXzgFSiZWbE2wz+JYyrhJ+7F2Q=; h=From:To:Cc:Subject:Date; b=xAYYgrViArx40NsEqD2deV48xHB4GZwIJYLk/zBblEmDKUxbxe21fosce59aDeFNg X7V1pIlQyEY/pbnZ4qYbLReCLpodmTeX1QR/J7CoeueJPth31fHZXjdpmYvTgPLuci oN6yDbn0XPqZqSQBfKLivX7cCIyVB9u6BqgQX8SH4xTnKW6HvPeGywxqJ9bbWZijaW zo6EJSONRCMJCVpEO+2w/xBjWCUREzlBJN2B9RZSLWv0WQs1rt1FlqIT7cNDhrN3m5 qjJ6EAqNfbzoJ+FEWflOJoYy017SiodeL4zkA4uvv0VKxtWdUFyM4b0AqXQtSuGFwj +TOCxnNbJDtbXa0A5CV82PZiTYO1Ce/kPPW2XxtwNFwfj5iZ+RsRCyvXLwZOJLbXMa q5oK/tnAZpT2xmrQDV1BGOVu1DSAmvrkj6LCZz6YSWtfvUvLx+Vpv21tmW2TUL3nQz e1V2t+2Scld8icDashobzf9MB5MJQVlefjfZtzSDWv2nrG0580l3iZ5OVbxp3HOnv8 YvL5vdhBUJP0KpIIkR8jjEypcBTxBlthw+rGW32CLMqWcpQz3ir39jvu5XudwxlRzz eKD+e8Uiyeb2iFccIm/N8WQ7sNRcw96GIWDF2FpWbpWyyG3aHZPa0Yepztv7oj/2dh g3YxOz2nTx9zWyjZ97en1/9c= Received: from localhost (unknown [128.0.188.242]) by wolfsden.cz (Postfix) with ESMTPSA id D008B338520; Tue, 3 Dec 2024 00:14:43 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=wolfsden.cz; s=mail; t=1733184883; bh=xy17UZ4oAJ03u1k7BjXzgFSiZWbE2wz+JYyrhJ+7F2Q=; h=From:To:Cc:Subject:Date; b=gIAkrZ5YVExyTz+Ccsy5bmtJsH+pmdWT6sCYAKZ+3bwUNN3p7wKBwbbvhMZ9WgLqh ZosT4Bbat1DmIgUZ1JESA4iiA4DlNwwD58dvFBXLIecRV3x2Eih0Knx2Bkt4ZpwGqb evMYO25RvUc2HDXnTrH4o6BVqwSo7HgK1Q70atQVZjeGcCdg4bTieTUseoMQjmbJAY xrGBce2zS85dzG3WfLxJgOL5G7mqElyqDbOKsGvNVSG+dY9AKZXfd/nItxcM/8cQfj kJXBySmvG8QnI3tq3TJh8re7X6qIDT8RvLURKr73y9Z35/+Sgwo7KYCYdGGPM//j7b SkKsiRvSlSXuIX/vGfx6+lhI/3cxcT0sU+sodI1x8OOgUgX66msceSsfa+dC7w7tda NKRqr5w7nz6A7ZLLHjZO31bPxu6KdySqBOXREorOqPAxLMkuwu3leqNW3k6YXFpA2U 3++CQZeoR0IEVoQuAXv4fFZbnGAUbtse3EEE0qmnwdT44HA8cCiXqqaankdtxRU0NB 8rJ232U5I/CspMoICd4AhPl+9tJFv7QC+e2VsgVgujYRyAKdKl85cGVKLcO4+q8PHO E023PxcxRzuhM4YIhffChsyjsa0ZREMpBE1nCNxgNxVrYAPco2ShUoEIPsHD40HwWI doioq+grSzLw8rcaZ9qQfCj8= From: Tomas Volf <~@wolfsden.cz> Date: Tue, 3 Dec 2024 01:11:37 +0100 Message-ID: <746975a119582d4dc85f1e5615d6b870a81164a9.1733184699.git.~@wolfsden.cz> 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-Queue-Id: AAD9F50652 X-Migadu-Scanner: mx13.migadu.com X-Migadu-Spam-Score: -2.39 X-Spam-Score: -2.39 X-TUID: DJ7x+/2HFDLT 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, chdir, chroot 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 --- v2: Split the renaming into separate commit (2/3). Do not delete the mingetty-configuration-mingetty accessor. v3: Use working-directory and root-directory instead of chdir and chroot. 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 8a6640124c..3432a5d604 100644 --- a/doc/guix.texi +++ b/doc/guix.texi @@ -19410,7 +19410,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