From patchwork Tue Dec 3 00:11:37 2024 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Tomas Volf <~@wolfsden.cz> X-Patchwork-Id: 34400 Return-Path: X-Original-To: patchwork@mira.cbaines.net Delivered-To: patchwork@mira.cbaines.net Received: by mira.cbaines.net (Postfix, from userid 113) id 00D4127BBEA; Tue, 3 Dec 2024 00:15:37 +0000 (GMT) X-Spam-Checker-Version: SpamAssassin 3.4.6 (2021-04-09) on mira.cbaines.net X-Spam-Level: X-Spam-Status: No, score=-6.8 required=5.0 tests=BAYES_00,DKIMWL_WL_HIGH, DKIM_ADSP_ALL,DKIM_SIGNED,DKIM_VALID,MAILING_LIST_MULTI, RCVD_IN_DNSWL_BLOCKED,RCVD_IN_VALIDITY_CERTIFIED,RCVD_IN_VALIDITY_RPBL, RCVD_IN_VALIDITY_SAFE,SPF_HELO_PASS,URIBL_BLOCKED autolearn=ham autolearn_force=no version=3.4.6 Received: from lists.gnu.org (lists.gnu.org [209.51.188.17]) by mira.cbaines.net (Postfix) with ESMTPS id D1EF827BBE9 for ; Tue, 3 Dec 2024 00:15:34 +0000 (GMT) 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 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+patchwork=mira.cbaines.net@gnu.org Sender: guix-patches-bounces+patchwork=mira.cbaines.net@gnu.org X-getmail-retrieved-from-mailbox: Patches 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(-) -- 2.46.0 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)))))) From patchwork Tue Dec 3 00:11:38 2024 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Tomas Volf <~@wolfsden.cz> X-Patchwork-Id: 34399 Return-Path: X-Original-To: patchwork@mira.cbaines.net Delivered-To: patchwork@mira.cbaines.net Received: by mira.cbaines.net (Postfix, from userid 113) id 69CE827BBEC; Tue, 3 Dec 2024 00:15:37 +0000 (GMT) X-Spam-Checker-Version: SpamAssassin 3.4.6 (2021-04-09) on mira.cbaines.net X-Spam-Level: X-Spam-Status: No, score=-6.8 required=5.0 tests=BAYES_00,DKIMWL_WL_HIGH, DKIM_ADSP_ALL,DKIM_SIGNED,DKIM_VALID,MAILING_LIST_MULTI, RCVD_IN_DNSWL_BLOCKED,RCVD_IN_VALIDITY_CERTIFIED,RCVD_IN_VALIDITY_RPBL, RCVD_IN_VALIDITY_SAFE,SPF_HELO_PASS,URIBL_BLOCKED autolearn=ham autolearn_force=no version=3.4.6 Received: from lists.gnu.org (lists.gnu.org [209.51.188.17]) by mira.cbaines.net (Postfix) with ESMTPS id D334027BBEA for ; Tue, 3 Dec 2024 00:15:34 +0000 (GMT) Received: from localhost ([::1] helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1tIGZF-0003Ly-1g; 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-0003LQ-Tm 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-0002dw-CK for guix-patches@gnu.org; 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:References:In-Reply-To:Date:From:To:Subject; bh=Gh9r8G4tiOgVRi1Cqvo0psdh+4LgFqIIizXj/SingpU=; b=hn3jo+rt54JrJeuuC93g7Zf2lSvf2N+8yeV45H+7P6rdRDcQq9cgU9w/vBu8cwCzjAr8M2nDhraTzzWTiqr5UtCfPaZSH+GfnSHlQrsLGX+ukbBa2Ds7cvAzhFN8WOz2yDeJHBVy8m5DMVxtLxWUt/NTclQl1qPJfqVzMis048FFDD9X0mCfOoAmuz6sSvOMb8sCx3Zp0M66k2ml6m0SazzJjTH41aHD2liOEC3MPYYWFIm+AyGLumXwTSzSsgb33DJ4ZQR6LnwmO3F42lOAnc3LUk1L3o/uCQc2HGxgvHZ40+p/uH+7yapJ3rROO3XEGb0IBj66xH92PclsjDV0FA==; Received: from Debian-debbugs by debbugs.gnu.org with local (Exim 4.84_2) (envelope-from ) id 1tIGZB-0000Ns-UN for guix-patches@gnu.org; Mon, 02 Dec 2024 19:15:01 -0500 X-Loop: help-debbugs@gnu.org Subject: [bug#74508] [PATCH v3 2/3] services: mingetty: Rename misnamed accessors. Resent-From: Tomas Volf <~@wolfsden.cz> Original-Sender: "Debbugs-submit" Resent-CC: guix-patches@gnu.org Resent-Date: Tue, 03 Dec 2024 00:15:01 +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> Received: via spool by 74508-submit@debbugs.gnu.org id=B74508.17331848901424 (code B ref 74508); Tue, 03 Dec 2024 00:15:01 +0000 Received: (at 74508) by debbugs.gnu.org; 3 Dec 2024 00:14:50 +0000 Received: from localhost ([127.0.0.1]:57056 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1tIGYy-0000Mo-4L for submit@debbugs.gnu.org; Mon, 02 Dec 2024 19:14:50 -0500 Received: from wolfsden.cz ([37.205.8.62]:50590) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from <~@wolfsden.cz>) id 1tIGYw-0000MS-Fe for 74508@debbugs.gnu.org; Mon, 02 Dec 2024 19:14:47 -0500 Received: by wolfsden.cz (Postfix, from userid 104) id EE879338904; Tue, 3 Dec 2024 00:14:45 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=wolfsden.cz; s=mail; t=1733184885; bh=IjvwDEm2SDGB3wpdM9Std8ZR6/5S1gU7uHKm1NA7st4=; h=From:To:Cc:Subject:Date:In-Reply-To:References; b=jVmMew1PWAwHsiPKTLXvccUNN/rmAGtLI7PIOdyr4RztrVGO1ACH4XlKLxIsUTk+l 4lOOr5BhsRpYzfDsEEB/MdHqh891NL2XRwz8qhFbQC6zWPqWSZS1KITJt4GQYN7kS+ bvYxUzx8zERYxTVRujH48YA53ZNxb3oE4t3Oe4c44lwTeXlSvZ8hbX9TSNAVIMbLO+ 4PCw34pbGMXruNVrIofWyIh3lJy1TB4mnxEsEh16DbGAGXVVKBxWjq8CcML7wU934e zvkE64IFYfRvFwFK8YOmnOr6mz8X0Kw2A3MHqhueJhjMm9jPBlgCnQS4Orh/hZ5Z54 eMsDzPJKlVnnVIZHC9sPitBm2jLfQ9RK+EVO1c784JvPlbni2oJBz+WQqMLyGxqnnV 0Go0VTqVZ+Lln7iJUhxyJQoxonE0J/wXFDKjJfcSX4YkPhg4+VjzJQHOYfxFYELewo I0GANvOqeKbAuwzW5AYF26YB9wzR9tSmimkCr0TrZOp1MZ8weG2IId9zmoSCKKH+DM jkK2WgNSkUW6CzTXEOE0D8IJsQE4uohB0bvujQ/WVlUOl7C5r4Dr+13oESFLUBkNQt pXnMioNX9kVSgDwuylfTJodzJ96OZ/lAeE8lUNSwL7zgwbedtCcS5sys06nFKy/T97 9U8n50LOZy1ro6YlhEBGa+x4= Received: from localhost (unknown [128.0.188.242]) by wolfsden.cz (Postfix) with ESMTPSA id 52E1033822B; 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=IjvwDEm2SDGB3wpdM9Std8ZR6/5S1gU7uHKm1NA7st4=; h=From:To:Cc:Subject:Date:In-Reply-To:References; b=ZkfPCJVplE9eByLNuqmWfeV4SiWVE7b6uTp2dDoTXOeZcK2eBx898YRveClC10eWe DcyDEk0DYtMu/YekwBuMk9nFplm0jWREBojJuLrqe+lEXHbC7pf/bY655+V5AxhFJj eXu7XyNJhdQoxGheJf9UWGxInnhHz4OojUBa3o8qxspCRj0ryNQ1scdd6zIJK21uL9 efGenfsiwm2G/oAeXEH8TGqQ8YMsroLYLKg54TyIErji212BTWlbFqQo502yzL9Hgt sd2WxnG18Xig60eGPoKZIAu4H+OkNm2Clp8tDo/GlelSkOEBVcTt3OVJ3XBW9QU8ps Qu2x92tD5a640vNW2hRA808K4aw2biPT9bVcnN7CFljEe2yqGit6sNzHr44Uu4osg2 xw9PUYG2G7vCk03G0X83ShAwveKNtHzpiTnPOVkfRgLFbJxnfuZl40VeZmMUW+cyFk LwqNfB339InGtYEpOhCHqv56E5xrENcxcxBqtp4HUad1HEoU4SUsSJxmqNG3qCJ9eY bzTz4lgdZG2imQkFWNOobcJTCJyENMUbkzmkZGbigsedNIXpsVyNCyhDcvR6+fPnqi AaQGGjnesU40FugAU2sVf2A+Rg17FRSNoGW97SaBaEm/RMTb9lL/hAbh43IyXUBOL/ vzkH/a9N7hPon5wakVB0Pk2k= From: Tomas Volf <~@wolfsden.cz> Date: Tue, 3 Dec 2024 01:11:38 +0100 Message-ID: X-Mailer: git-send-email 2.46.0 In-Reply-To: <746975a119582d4dc85f1e5615d6b870a81164a9.1733184699.git.~@wolfsden.cz> References: <746975a119582d4dc85f1e5615d6b870a81164a9.1733184699.git.~@wolfsden.cz> MIME-Version: 1.0 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+patchwork=mira.cbaines.net@gnu.org Sender: guix-patches-bounces+patchwork=mira.cbaines.net@gnu.org X-getmail-retrieved-from-mailbox: Patches Rename the accessors to ensure all start with `mingetty-configuration-' prefix. Some were named just `mingetty-$FIELD', instead of `mingetty-configuration-$FIELD'. The renaming *is* backwards compatible, since in the define-module's #:export argument the correct (`mingetty-configuration-$FIELD') were used already and thus the accessors were not accessible. * gnu/services/base.scm (): Rename accessors for auto-login, login-program, login-pause?, clear-on-logout?. Change-Id: I4557a82498805ade0b341feda9d33eccc305690f --- v2: Now is a separate commit. gnu/services/base.scm | 10 +++++----- 1 file changed, 5 insertions(+), 5 deletions(-) -- 2.46.0 diff --git a/gnu/services/base.scm b/gnu/services/base.scm index 798356ed84..f1995640f1 100644 --- a/gnu/services/base.scm +++ b/gnu/services/base.scm @@ -1248,14 +1248,14 @@ (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 + (clear-on-logout? mingetty-configuration-clear-on-logout? ;Boolean (default #t)) (delay mingetty-configuration-delay ;Integer | #f (default #f)) From patchwork Tue Dec 3 00:11:39 2024 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Tomas Volf <~@wolfsden.cz> X-Patchwork-Id: 34401 Return-Path: X-Original-To: patchwork@mira.cbaines.net Delivered-To: patchwork@mira.cbaines.net Received: by mira.cbaines.net (Postfix, from userid 113) id 4FCD927BBE9; Tue, 3 Dec 2024 00:15:44 +0000 (GMT) X-Spam-Checker-Version: SpamAssassin 3.4.6 (2021-04-09) on mira.cbaines.net X-Spam-Level: X-Spam-Status: No, score=-6.8 required=5.0 tests=BAYES_00,DKIMWL_WL_HIGH, DKIM_ADSP_ALL,DKIM_SIGNED,DKIM_VALID,MAILING_LIST_MULTI, RCVD_IN_DNSWL_BLOCKED,RCVD_IN_VALIDITY_CERTIFIED,RCVD_IN_VALIDITY_RPBL, RCVD_IN_VALIDITY_SAFE,SPF_HELO_PASS,URIBL_BLOCKED autolearn=unavailable autolearn_force=no version=3.4.6 Received: from lists.gnu.org (lists.gnu.org [209.51.188.17]) by mira.cbaines.net (Postfix) with ESMTPS id 5824F27BBE2 for ; Tue, 3 Dec 2024 00:15:42 +0000 (GMT) Received: from localhost ([::1] helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1tIGZF-0003M2-QW; 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 1tIGZD-0003LV-L7 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 1tIGZD-0002gh-5l; Mon, 02 Dec 2024 19:15: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=cu5XkxN6ksonmZs1dQQfzz+xacLbDbSuji3msUuOTg8=; b=Wn+1UVFKzkYipqlaAuBDECBxjXiFK9DyHoGQHXTQx8/7VmdgsIOXkeDnbalCGydTYcH3/Vtb7oSIn2L0vddI0VZiM2ECVnQwxWaxRvizxoySwI4UWwrvZCVNhwosto5jbJ6w8CY75B2PQ+e8aFEneK2nTgmxiVpYltOKMUvhsz6bVJjvfCyjX1t1JHRWSViiQVHvmVQFroDa1jLpcJVBrk6f+O5IaHiE0TDEizyvpsUkBx8kl/Pq7V9CGSni2eTO+r1q5xrKYupXMAmNqDfwxZt0TAI12TslTaCG57u9ce1qK4M64D3E6PNhCZbDD/pmTIfSsF8HXciNvOX3gR+trw==; Received: from Debian-debbugs by debbugs.gnu.org with local (Exim 4.84_2) (envelope-from ) id 1tIGZD-0000OD-06; Mon, 02 Dec 2024 19:15:03 -0500 X-Loop: help-debbugs@gnu.org Subject: [bug#74508] [PATCH v3 3/3] services: mingetty: Support waiting on shepherd services. 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.17331848911439 (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]:57060 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1tIGZ0-0000N3-Uj for submit@debbugs.gnu.org; Mon, 02 Dec 2024 19:14:51 -0500 Received: from wolfsden.cz ([37.205.8.62]:50602) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from <~@wolfsden.cz>) id 1tIGYx-0000MU-4S for 74508@debbugs.gnu.org; Mon, 02 Dec 2024 19:14:47 -0500 Received: by wolfsden.cz (Postfix, from userid 104) id 8D23C338295; Tue, 3 Dec 2024 00:14:46 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=wolfsden.cz; s=mail; t=1733184886; bh=Z9yxeQ+XVj0NzNY3pQQ25fJrmdBIClfSQ7HAYWzaPHI=; h=From:To:Cc:Subject:Date:In-Reply-To:References; b=My0KLQ/sX/606YCEBXYOkxtRBSMs08l7gvN9CkLbqU5MuN1ACx8+dEol406eWBybi dN/xCWcRrSRc8/0RAgogz80S7rWPWQPC+w9F1gpbDzg74u02dd88I7iddqllrPRaHg pJksMfO/9od/1pCJspI5r/Hp9MKEB75K1bxSO9tjo9G7QV+/jxtlsZBBVyxUw7SAJG h6EiNAxdyLgJS5xiCpgoSTjeg+ZXO4412/+/AE1XGgih2uVIT9TILSh6NiYX6a28dn Fvh9/n6MqvWDpHDmbKm9HqRZI9cFFTY3ILkAAvGNJqGZ9Wnv85A9vtR3l/xdeHMJ23 ump5mdyoMwZyPZ+ErKUvXpM4ug/Dxo7VsE7iAkCvmLjlGmyTmgbxKO+t204cazhSfV R+MQ2UKlJCuQfrKBFMkr6UgrcAHMOubVdX0BqBQ8qNmD5UQAWmICwUgO59A3LVi/0J iV4Pb1So78gmYKL0NQxqY28bqLY5D61pA2B8ANhU1MtXpD3RTufi7XzymTINo3iOCq rg9nmADqHZFBGvhv6VgmcFvK3pPIAdFu5p6Ejcv3c1t5QJngEaxh6b05n0vPvXjmAv cliIwdSqKkK1juFB17SJGmEzqvITSM/ZlXRtPeK8n75HgZAnZy0n0qDzQg1iiop5o7 QJYfGmjR1mlSOyZoQg3MSucc= Received: from localhost (unknown [128.0.188.242]) by wolfsden.cz (Postfix) with ESMTPSA id CDCAD32697F; 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=Z9yxeQ+XVj0NzNY3pQQ25fJrmdBIClfSQ7HAYWzaPHI=; h=From:To:Cc:Subject:Date:In-Reply-To:References; b=uyZL+pvp8HhUbgBnVGz8GE67XZRNxOs4iurcbLvomZrOW9SM4rEGggNgdmoQqQz2T DWe71TQjRF34lYxBFqbs5tHckGEeUWKcDUI1aWCz8rIuBALjS3hXtIRpuOaL96ZgGd ZwM7An7tb4rEkYoEHC4v5B/TelqnEhf1Lwo69jtT7JpWMUlhiq3dA2LsmYqnwmvHzd oG9z2RDmpQn7topivOph8sgrV8vE5HwPIuC59yqHoEmUERI170A5BF0Uv48CHwdvNy vel2nmRGjqSTOMuRPdmqmp2X25xneQRxQSuhpUOHAjZLubu657KliQwwckNQbIppHK FCkn3vtR2HrdGad2Xlv1KhLivcSQELxtoioPrL1THtxTK8OiAjoGChfmVrBQIgbh2D z1ZcDPtvZN/r8/RnkNxp9+MuO9KeRWC1pa3htYoBoKFBNxDAcT6SQr5OUthlMfzaWQ E2mGqP4piW3uLVFL/UlJy1FZc+BCS++jVlVs7EoIQdAuOz0dFLxqREaeOKFyznP/Ti sJCRVuQeIYD4L6cc6VI+GwfJdT5KpoAB85Rp0PQRFro/wRk7RgPe6OyahxBV7OIs+t +Pha2Bx+sngL+09R+zC33n2YCL5YDiQH5EkWN5ysVyy1jvDMq5UITZv9YxgGfZmc3y i5qkl0MWVyAWlrXvlQjxSsH0= From: Tomas Volf <~@wolfsden.cz> Date: Tue, 3 Dec 2024 01:11:39 +0100 Message-ID: <09f772e45032200dd462ecb54b39c97ddb3301d6.1733184699.git.~@wolfsden.cz> X-Mailer: git-send-email 2.46.0 In-Reply-To: <746975a119582d4dc85f1e5615d6b870a81164a9.1733184699.git.~@wolfsden.cz> References: <746975a119582d4dc85f1e5615d6b870a81164a9.1733184699.git.~@wolfsden.cz> MIME-Version: 1.0 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+patchwork=mira.cbaines.net@gnu.org Sender: guix-patches-bounces+patchwork=mira.cbaines.net@gnu.org X-getmail-retrieved-from-mailbox: Patches For auto-login on systems with elogind, dbus-system needs to be started. This commit adds ability to express that ordering. * gnu/services/base.scm (): Add shepherd-requirement field. (mingetty-shepherd-service): Use it. * doc/guix.texi (Base Services): Document it. Change-Id: Iedbdc4375180740379d561aa193d7c63350d2e7b --- v2: Just slight formatting changes. doc/guix.texi | 20 ++++++++++++++ gnu/services/base.scm | 61 +++++++++++++++++++++++-------------------- 2 files changed, 53 insertions(+), 28 deletions(-) -- 2.46.0 diff --git a/doc/guix.texi b/doc/guix.texi index 3432a5d604..41b23e4695 100644 --- a/doc/guix.texi +++ b/doc/guix.texi @@ -19438,6 +19438,26 @@ Base Services When set to a string, use this directory at the process's root directory. +@item @code{shepherd-requirement} +List of shepherd requirements. Unless you know what you are doing, it +is recommended to add to the default list instead of replacing. + +For example you can use this field when performing auto-login on a +system with elogind to wait on @code{'dbus-system}. + +@lisp +(modify-services %base-services + (mingetty-service-type config => + (mingetty-configuration + (inherit config) + ;; Automatically log in as "guest". + (auto-login "guest") + (shepherd-requirement + (cons 'dbus-system + (mingetty-configuration-shepherd-requirement + config)))))) +@end lisp + @item @code{mingetty} (default: @var{mingetty}) The Mingetty package to use. diff --git a/gnu/services/base.scm b/gnu/services/base.scm index f1995640f1..6a42496599 100644 --- a/gnu/services/base.scm +++ b/gnu/services/base.scm @@ -193,6 +193,7 @@ (define-module (gnu services base) mingetty-configuration-nice mingetty-configuration-working-directory mingetty-configuration-root-directory + mingetty-configuration-shepherd-requirement mingetty-configuration? mingetty-service ; deprecated mingetty-service-type @@ -1246,45 +1247,49 @@ (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-configuration-auto-login ;string | #f - (default #f)) - (login-program mingetty-configuration-login-program ;gexp - (default #f)) - (login-pause? mingetty-configuration-login-pause? ;Boolean - (default #f)) - (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)) - (working-directory mingetty-configuration-working-directory ;String | #f - (default #f)) - (root-directory mingetty-configuration-root-directory ;String | #f - (default #f))) + (mingetty mingetty-configuration-mingetty ;file-like + (default mingetty)) + (tty mingetty-configuration-tty) ;string + (auto-login mingetty-configuration-auto-login ;string | #f + (default #f)) + (login-program mingetty-configuration-login-program ;gexp + (default #f)) + (login-pause? mingetty-configuration-login-pause? ;Boolean + (default #f)) + (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)) + (working-directory mingetty-configuration-working-directory ;String | #f + (default #f)) + (root-directory mingetty-configuration-root-directory ;String | #f + (default #f)) + (shepherd-requirement mingetty-configuration-shepherd-requirement + ;; Since the login prompt shows the host name, wait + ;; for the 'host-name' service to be done. Also wait + ;; for udev essentially so that the tty text is not + ;; lost in the middle of kernel messages (XXX). + (default '( user-processes host-name udev + virtual-terminal)))) (define (mingetty-shepherd-service config) (match-record config ( mingetty tty auto-login login-program login-pause? clear-on-logout? delay print-issue print-hostname nice - working-directory root-directory) + working-directory root-directory shepherd-requirement) (list (shepherd-service (documentation "Run mingetty on an tty.") (provision (list (symbol-append 'term- (string->symbol tty)))) - ;; Since the login prompt shows the host name, wait for the 'host-name' - ;; service to be done. Also wait for udev essentially so that the tty - ;; text is not lost in the middle of kernel messages (XXX). - (requirement '(user-processes host-name udev virtual-terminal)) + (requirement shepherd-requirement) (start #~(make-forkexec-constructor (list #$(file-append mingetty "/sbin/mingetty")