From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: from mp1.migadu.com ([2001:41d0:403:58f0::]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits)) by ms13.migadu.com with LMTPS id YGvuCROhRGckSgEA62LTzQ:P1 (envelope-from ) for ; Mon, 25 Nov 2024 16:08:51 +0000 Received: from aspmx1.migadu.com ([2001:41d0:403:58f0::]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits)) by mp1.migadu.com with LMTPS id YGvuCROhRGckSgEA62LTzQ (envelope-from ) for ; Mon, 25 Nov 2024 17:08:51 +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=DZZmIbua; dkim=fail ("headers rsa verify failed") header.d=wolfsden.cz header.s=mail header.b=c9Dx6mpD; dkim=fail ("headers rsa verify failed") header.d=wolfsden.cz header.s=mail header.b=nyhczlJP; 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"; dmarc=fail reason="SPF not aligned (relaxed), DKIM not aligned (relaxed)" header.from=wolfsden.cz (policy=none) ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=yhetil.org; s=key1; t=1732550930; 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=zQ6WJ35srmbU0Tp/t2X3zfkIcLeZSk6/c3DNdhLPQts=; b=ohDaHLHzCa6rpc198ZAY2AzCGfmNh11O0dS33uJ+H8q1/jeMKIA2jB0NlhOMgKj1LRbipq mW46Y8VxcGd2hFhTfiikM86SDnR9caVcYpktarEs0Yfm5qFwYVtp+3wqYiC45SJVn+S6Ck ARBcrcjDkbu7aC6e9/tUMo8zoOLTLz4LMfFG9RyI4WjIFXQBYCCPRZMYuBqKzJXm2tcIL/ zoZy4Qqq9EAomLtxVGcA/FZoeAsiMdXpI9ByMGjYf4qrjSfWgpuqfy/L8+0fR6mjdQXxeX DU6VwaHCD4wAI+WaXJ+hQS33fIqZVWEibcxbBjoiGy6Si5FtiiG43rf9sXACZg== ARC-Authentication-Results: i=1; aspmx1.migadu.com; dkim=pass header.d=debbugs.gnu.org header.s=debbugs-gnu-org header.b=DZZmIbua; dkim=fail ("headers rsa verify failed") header.d=wolfsden.cz header.s=mail header.b=c9Dx6mpD; dkim=fail ("headers rsa verify failed") header.d=wolfsden.cz header.s=mail header.b=nyhczlJP; 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"; dmarc=fail reason="SPF not aligned (relaxed), DKIM not aligned (relaxed)" header.from=wolfsden.cz (policy=none) ARC-Seal: i=1; s=key1; d=yhetil.org; t=1732550930; a=rsa-sha256; cv=none; b=pEAD64UdoDZMzHcCG02E+cJ+4nb39s2k4BrVRoqASG2YbzMKunJBzKQqjZkB1PFPpAER+T 9o0hhBTYyaDrI13tUT2t97W79i3iDIQmV+ixlwdpHcluY+2H0F6SeOc9x1k+b8QSa2+2vQ BFFJCaXjjsIyvcPUT3EGNcfLaLwPp9UZohzS2lWgxFfzLWBpRew+LsqEppUQa0Ax3Hqia8 wCsinmldSOpFhZhE1+aB7RtDcHy0cZ/ogKgmdnvX42cnHjmQGAbzJrNqLwfX4+K2zMAXMa 8McannViYm4iNk+HboLh8bfV2NGWrFxJxNud+OO2ILigAWpz/6e67SclGf/wHA== 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 B770946AAE for ; Mon, 25 Nov 2024 17:08:49 +0100 (CET) Received: from localhost ([::1] helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1tFbdE-0004Py-88; Mon, 25 Nov 2024 11:08:12 -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 1tFbd6-0004OO-96 for guix-patches@gnu.org; Mon, 25 Nov 2024 11:08:05 -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 1tFbd5-0000Nk-Me; Mon, 25 Nov 2024 11:08: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=zQ6WJ35srmbU0Tp/t2X3zfkIcLeZSk6/c3DNdhLPQts=; b=DZZmIbuaGHcLg8Qry0bXLH3nHrAUe6xSUNPn8sU+JaoaiChXj6CZAh/moQNFdYWrPmAJ63deOQViICAcvGyhTcFCuwTCN1qDlR3Weq5T6DhbNlK7x68OaASFqYvxGOjyScElg19Fqh27pVd7juxu9ubczINxopjFFI8CRN/9muCb57X29cd0azlXa9s0nNhqS0h1vPrwuhV1aRk8LJdKSq4JWiRQWmJmfMoKJBMj8s5eLIv2xT4KbA2CKYieIbQJV39+DXWEmDkfrqYHHn6RCmwOvbzFsR4DTVe4iRSfcNYJMVISCW9x589hEwn4ZJVo7kPXdDpR6MfkYLpaGrjHHQ==; Received: from Debian-debbugs by debbugs.gnu.org with local (Exim 4.84_2) (envelope-from ) id 1tFbd5-0007Aw-Gl; Mon, 25 Nov 2024 11:08:03 -0500 X-Loop: help-debbugs@gnu.org Subject: [bug#74508] [PATCH v2 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: Mon, 25 Nov 2024 16:08: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.173255085327521 (code B ref 74508); Mon, 25 Nov 2024 16:08:03 +0000 Received: (at 74508) by debbugs.gnu.org; 25 Nov 2024 16:07:33 +0000 Received: from localhost ([127.0.0.1]:40146 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1tFbcb-00079j-40 for submit@debbugs.gnu.org; Mon, 25 Nov 2024 11:07:33 -0500 Received: from wolfsden.cz ([37.205.8.62]:60516) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from <~@wolfsden.cz>) id 1tFbcX-00079C-Mz for 74508@debbugs.gnu.org; Mon, 25 Nov 2024 11:07:31 -0500 Received: by wolfsden.cz (Postfix, from userid 104) id 97A4334741C; Mon, 25 Nov 2024 16:07:27 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=wolfsden.cz; s=mail; t=1732550847; bh=TaKbwCJVtoWcr/IdoRULKNYPnWEYen9S6540wGSiVt0=; h=From:To:Cc:Subject:Date; b=c9Dx6mpDMPqo+a77RPywPno2c5MKMfwxOwXcWyaKzQ2jwJ6eLWvKW7BfdpC5XYN26 L/k4s+gEPPQ/r3KXjgxe7eYn0UWegn8GZauVhtDPhp+NfsNp5XsMlJ0rZWLteQhbou pOxvlzdHPdO990ShTtQRrvXH31oMNVwl/H3VrZF/da7GUa+u+wNLf2rKIqjAvrcnOG ddkOe1LU1L8qhrCxE2+XlRoyyjNLAZ4fqIHcJbEq1udsUqk2iw+nTK+lDay5+0vR5e ZqixtxF842l4w+dUxpklYH8QJLQL/SQB3udD/Wv03PgQ05Nstqr8JbgUJX6YRqf6MD 5+VRMRLHC1m5myP/OF6kSKmULADSK7rlvKZwVpCfjGSIs8JlRxCNBj1wFAZHHlK0YJ PQh/9dXLEPUx87XNoAAw90KKixBIHQC2OqcT4OptHxNGJYiP/sVnTe3NZiIGfQkZlT 8OmkF+p2SouaR4yYNoVkOIDPalScvThuAOXX5wcPw6wo7hVyXLArDwSrRn5JjSjsVL r1U7FWNv8e+ZtLtv1YVhhLdUUpOWOlHDcB28vp6lms9WIxaOdU7UgFYKNPhTlvOjX2 3aKDK9XTUL+lX4rsNkMdc2iUCk3TCB8NcKuoWnTMvhlGyWGd+ASilAxE2ZHVjA43VU z9GdSvqSf51z1sSKr0avNmLo= Received: from localhost (unknown [128.0.188.242]) by wolfsden.cz (Postfix) with ESMTPSA id DA960345FD5; Mon, 25 Nov 2024 16:07:26 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=wolfsden.cz; s=mail; t=1732550846; bh=TaKbwCJVtoWcr/IdoRULKNYPnWEYen9S6540wGSiVt0=; h=From:To:Cc:Subject:Date; b=nyhczlJPjCAtsjKl0UiUUs3KlIAITPZEf6dGO02LkvZYbE9s6BmJnNxgT1D5LKYDM /bNCp1MyKys8D3+3IF1TQ9kMiRQtsHmpWg6fr+pzFQkKTesaOuiJl5L7bZECpta27l ndEiwfmWjpKZLFthrybP6pVuRQV+4PZB9AWga1dulVa6Hs9p9XkqhVW1aO7WGx11ta WmF/ErbLRhaV5v5/1iuWDlcCYKlWrT2JHIvwGb2TMWKq/y5N4/+nM+qAWiHhN25X1b 7Wa9AU5R4T73qquVeYV9YJVtuyWXpiqbcTB9XJ+jlSZXDr8ONDQtaRjkC7IqX+grGI nitO1NK2bI3vQ//3vj9ALJLdataxlXKZnXtNEkCXT5hgTaiF9swyiIRvOpIGFwkaBE +tC1uR90dNT18sYIPKHVlfdf+ECYgvlhMZvAbYkdKYby+qyY2OUtxQY/zQTvBOGxa+ cQIpJtBNcxC2OdxycDjxRnSfjPToJQmIYgclD+gWMV4CSr7vOqCmyjVJcaroTJ0Bj1 6JvXiBVhHhfA1IWtfZnpqowtV10T9+UmPmR+xQLyYpumgbYyC+of/n3WfCyHpDIQui LdLcIqOO1n85jRS/weMZahWZkF34Fj4dBLJLp+Wx2X+GDQjYBYVfOIYkEI99L9ZQyL HpCeQU3go+MswHpp/3Z5etyw= From: Tomas Volf <~@wolfsden.cz> Date: Mon, 25 Nov 2024 17:05:33 +0100 Message-ID: <3735b134a382255528e7da6706828ee5d80f50a5.1732550735.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-Country: US X-Migadu-Flow: FLOW_IN X-Migadu-Scanner: mx11.migadu.com X-Migadu-Spam-Score: 4.84 X-Spam-Score: 4.84 X-Migadu-Queue-Id: B770946AAE X-TUID: i6Y8vIV8glUP 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. doc/guix.texi | 27 ++++++++++++++++++++++- gnu/services/base.scm | 51 ++++++++++++++++++++++++++++++++++++++++--- 2 files changed, 74 insertions(+), 4 deletions(-) diff --git a/doc/guix.texi b/doc/guix.texi index 26488b41c8..c5f9481810 100644 --- a/doc/guix.texi +++ b/doc/guix.texi @@ -19348,7 +19348,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..9712218bd5 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-chdir + mingetty-configuration-chroot mingetty-configuration? mingetty-service ; deprecated mingetty-service-type @@ -1250,12 +1256,25 @@ (define-record-type* (login-pause? mingetty-login-pause? ;Boolean (default #f)) (clear-on-logout? mingetty-clear-on-logout? ;Boolean - (default #t))) + (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 +1305,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