From unknown Mon Aug 18 14:24:55 2025 Content-Disposition: inline Content-Transfer-Encoding: quoted-printable MIME-Version: 1.0 X-Mailer: MIME-tools 5.509 (Entity 5.509) Content-Type: text/plain; charset=utf-8 From: bug#74508 <74508@debbugs.gnu.org> To: bug#74508 <74508@debbugs.gnu.org> Subject: Status: [PATCH 0/2] Improvements for mingetty-service-type Reply-To: bug#74508 <74508@debbugs.gnu.org> Date: Mon, 18 Aug 2025 21:24:55 +0000 retitle 74508 [PATCH 0/2] Improvements for mingetty-service-type reassign 74508 guix-patches submitter 74508 Tomas Volf <~@wolfsden.cz> severity 74508 normal tag 74508 patch thanks From debbugs-submit-bounces@debbugs.gnu.org Sun Nov 24 09:28:44 2024 Received: (at submit) by debbugs.gnu.org; 24 Nov 2024 14:28:45 +0000 Received: from localhost ([127.0.0.1]:33312 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1tFDbQ-0007fy-7K for submit@debbugs.gnu.org; Sun, 24 Nov 2024 09:28:44 -0500 Received: from lists.gnu.org ([209.51.188.17]:54468) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from <~@wolfsden.cz>) id 1tFDbL-0007fd-2I for submit@debbugs.gnu.org; Sun, 24 Nov 2024 09:28:42 -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 <~@wolfsden.cz>) id 1tFDbK-0002sL-G7 for guix-patches@gnu.org; Sun, 24 Nov 2024 09:28:38 -0500 Received: from wolfsden.cz ([37.205.8.62]) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from <~@wolfsden.cz>) id 1tFDbI-0003On-Hx for guix-patches@gnu.org; Sun, 24 Nov 2024 09:28:38 -0500 Received: by wolfsden.cz (Postfix, from userid 104) id 4872034188A; Sun, 24 Nov 2024 14:28:32 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=wolfsden.cz; s=mail; t=1732458512; bh=Fnk3152ynxJ5IgKeloATeYjYcTbgdIXOxzHYPJyLaJQ=; h=From:To:Cc:Subject:Date; b=cYQr2Idn+5+0PyGhNN8IiTrPjJch2Xwwkk56Qk510INjYp0YRNmooEa4lCA3e214x Re/KKSIiWIXtU7JzSFGflKvrYqaC4ZwIHDCR4hO8RMdayrZI7dpzTel1G3xiLKhdys W3T58bfLvKvoJ/0hPn7j2+eRyHlCZpHzzrgMK1qHOLkMMLDEY+sG7AFEA3spop8iLY cuuXs5BbfueWakhnWSCtiH3SAeo69yfKBGXY3UPkQrtZHE3C67tuuueFXg/4k383be Okrs4eYvtFJgUUl883l4OU5g7MIbkiwyAnK9RenWhQ1LGQ0QJRcrq+diQKCGqQVVyu 8G/sSPfeCBYGQT3wVXs/7GZjZb1CMf786Jv+2W9RE5yfC1nePlMG5HMCRW2G8J8/jT NwLnDLmb3FJCeHsNQ91UXgMeeBrYJtu3m07bKVYdIcHPT7A+vj/5P/0lAVzjLAqwuB lk5Opi0wVrFWGl2EqLUmA7aJ2vWxZ1O7tyxjfFty6iRWZF0t8UuX5gb6+gzEXYkagQ PYXWDsYvH7M0uKG0Uk83ZYIynygCP64PdaKxuMe81ww1AvA+ERPePL/bpBbOHWwvC5 XYYv/PJ14Z4VpYu4peUbz+TLPGB1nrLPP5HnRYhv3MyisG17d+vcUNsR14T0DMLH7K T7yuVuikoeQ8FhvLrT2U0k30= X-Spam-Checker-Version: SpamAssassin 3.4.6 (2021-04-09) on wolfsden X-Spam-Level: X-Spam-Status: No, score=-3.1 required=5.0 tests=ALL_TRUSTED,BAYES_00, DKIM_SIGNED,DKIM_VALID,DKIM_VALID_AU,DKIM_VALID_EF,URIBL_BLOCKED autolearn=ham autolearn_force=no version=3.4.6 Received: from localhost (unknown [128.0.188.242]) by wolfsden.cz (Postfix) with ESMTPSA id 77058341295; Sun, 24 Nov 2024 14:28:31 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=wolfsden.cz; s=mail; t=1732458511; bh=Fnk3152ynxJ5IgKeloATeYjYcTbgdIXOxzHYPJyLaJQ=; h=From:To:Cc:Subject:Date; b=Ccii/NDmtpjjGdYVgMQZcfvsKSyqgA2O5t55exMi/t3B7LErUCxLSTSKuGINy97TD SbVN3IyY6XGY9XEVAzNeWOLwBghWOESoKab7YALQs4O5PyW7jL/7oDvEdTX1Il3OY4 B8X+MLnED6Skr9Uf9hrHqVwmHxacPNFrGPfyAqvlfV8XgywIjz9PWLCDZ6o+owDWqt qC4mmciP6i3dALtJGEopNuda449hOre04pe9EGYbRW2fL2FWKDVUSzBKuHqx/i42LG DTj3G2UFAIeU1obI/vNpu3V9iD/afjt20OVOgLuvI9WjI9V/u/0bASq3V2Ze0FdMaU Z7NDp6bY0qrf2v2WEn5vX/UUzsrRQzTJByj39anMzZPnhG1LPHZzM9QxZkoBWDCZw4 hMMuJRPt11eXd9AiDTPeB8dktOUeMOKafE8BBdoMa44WOSwxqsacAUIKfx0H854I6v fvtvRVuXGs99wNYfcFxA5bAkKp29O3E2bHONYrfI4eGv6U0Z58H/e4FaRkmoNamzQD Jzmf+xBESbVxl6xATyX2OsYQg/VsvQL5yVDZfzfw2TUcMshIpFrM5nKz/Aw3vcEMIq 2d35LFGUTRUWIOeQzHxP8VdGNqLydUqEi4WSR4rVSOla98dRK+o7sxEewwWi6XFa4E LsRnvxU5K43t/TGUxv5PPJTA= From: Tomas Volf <~@wolfsden.cz> To: guix-patches@gnu.org Subject: [PATCH 0/2] Improvements for mingetty-service-type Date: Sun, 24 Nov 2024 15:28:20 +0100 Message-ID: X-Mailer: git-send-email 2.46.0 MIME-Version: 1.0 X-Debbugs-Cc: Ludovic Courtès , Maxim Cournoyer Content-Transfer-Encoding: 8bit Received-SPF: pass client-ip=37.205.8.62; envelope-from=~@wolfsden.cz; helo=wolfsden.cz X-Spam_score_int: -20 X-Spam_score: -2.1 X-Spam_bar: -- X-Spam_report: (-2.1 / 5.0 requ) BAYES_00=-1.9, DKIM_SIGNED=0.1, DKIM_VALID=-0.1, DKIM_VALID_AU=-0.1, DKIM_VALID_EF=-0.1, RCVD_IN_VALIDITY_CERTIFIED_BLOCKED=0.001, RCVD_IN_VALIDITY_RPBL_BLOCKED=0.001, SPF_HELO_PASS=-0.001, SPF_PASS=-0.001 autolearn=ham autolearn_force=no X-Spam_action: no action X-Spam-Score: -1.3 (-) X-Debbugs-Envelope-To: submit Cc: Tomas Volf <~@wolfsden.cz> X-BeenThere: debbugs-submit@debbugs.gnu.org X-Mailman-Version: 2.1.18 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: debbugs-submit-bounces@debbugs.gnu.org Sender: "Debbugs-submit" X-Spam-Score: -2.3 (--) Some configuration options were missing and some accessors where misnamed. Ability to depend on arbitrary shepherd service is also added. Tomas Volf (2): services: mingetty: Add additional configuration options. services: mingetty: Support waiting on shepherd services. doc/guix.texi | 47 ++++++++++++++++++++++- gnu/services/base.scm | 86 ++++++++++++++++++++++++++++++++++--------- 2 files changed, 114 insertions(+), 19 deletions(-) -- 2.46.0 From debbugs-submit-bounces@debbugs.gnu.org Sun Nov 24 09:32:04 2024 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= X-Spam-Checker-Version: SpamAssassin 3.4.6 (2021-04-09) on wolfsden X-Spam-Level: X-Spam-Status: No, score=-3.1 required=5.0 tests=ALL_TRUSTED,BAYES_00, DKIM_SIGNED,DKIM_VALID,DKIM_VALID_AU,DKIM_VALID_EF,URIBL_BLOCKED autolearn=ham autolearn_force=no version=3.4.6 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> To: 74508@debbugs.gnu.org Subject: [PATCH 1/2] services: mingetty: Add additional configuration options. 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 X-Debbugs-Cc: Ludovic Courtès , Maxim Cournoyer Content-Transfer-Encoding: 8bit X-Spam-Score: 0.0 (/) X-Debbugs-Envelope-To: 74508 Cc: Tomas Volf <~@wolfsden.cz> X-BeenThere: debbugs-submit@debbugs.gnu.org X-Mailman-Version: 2.1.18 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: debbugs-submit-bounces@debbugs.gnu.org Sender: "Debbugs-submit" X-Spam-Score: -1.0 (-) 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 From debbugs-submit-bounces@debbugs.gnu.org Sun Nov 24 09:32:14 2024 Received: (at 74508) by debbugs.gnu.org; 24 Nov 2024 14:32:14 +0000 Received: from localhost ([127.0.0.1]:33335 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1tFDem-0007wr-Ln for submit@debbugs.gnu.org; Sun, 24 Nov 2024 09:32:13 -0500 Received: from wolfsden.cz ([37.205.8.62]:55154) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from <~@wolfsden.cz>) id 1tFDeZ-0007vu-AQ for 74508@debbugs.gnu.org; Sun, 24 Nov 2024 09:32:02 -0500 Received: by wolfsden.cz (Postfix, from userid 104) id C5B1A341903; 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=TZbKIUNv1H22TixRkK/3ypLwJT2Oocpq07OXRX4bzQo=; h=From:To:Cc:Subject:Date:In-Reply-To:References; b=RWPpiHDuhahUp5lo/XtwrYprSS3O8fGPRJ6JybnCkc889ZC3YuDLj8HmMvNgvwfz9 lLjivojfj5hPINOW15aX+Lz8OTzTBnl/SERNgmIFa3g0DfR1M4a+15wORlbSSZZ76W ovoSLGFxRph11yNOjD880lb8Vdcs4UuddiXTNc7OdMD8kBHCTWs8epKdDQ15uZwfqC Oln4gG+yZtmLplZ6nt/pT7nMxSTi6le8cruGH5Ng4TbrDvkkOjcWSsjIMIoE5YWUxg +lqyc5m1AEZyEWLehJnjz5/wGrTXCQz2VC7c9g0QIxAJ4sE6U4gD5IpGUF9bpxC9Gk TNoP3ySiEfDRV0ZEuLi4s5gvHf9FFuJyGYLzwiX08FjfY5zNEVVdq4feXCPHASLvED 7JXAwqu6pFezGeYfK7epD9012tM9D6Vc4yWctMLfyEFt7f9IvuYwZBUED7f+RSxJVS 0BKef/75MKiy0T05LX7GYyGzGDaDJJCfUUzc8jbv375OHmHDU8+5sXzT3XbDg+f7kD DVGG5MsSp9E0g4Gac9KoJOjhyXvw9SXpWtbjcQzSik1HqounqRmTpTLJZfl2mmjWYs mlVE2x3W7GWjfV+yOww28LwqhHhGTdioUlOZ5TLydHBeNB718NVvnbj/7rrmseiGbi /7rjMLebaPW5DYDH4quoG8dE= X-Spam-Checker-Version: SpamAssassin 3.4.6 (2021-04-09) on wolfsden X-Spam-Level: X-Spam-Status: No, score=-3.1 required=5.0 tests=ALL_TRUSTED,BAYES_00, DKIM_SIGNED,DKIM_VALID,DKIM_VALID_AU,DKIM_VALID_EF,URIBL_BLOCKED autolearn=ham autolearn_force=no version=3.4.6 Received: from localhost (unknown [128.0.188.242]) by wolfsden.cz (Postfix) with ESMTPSA id 2FC4833FE32; 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=TZbKIUNv1H22TixRkK/3ypLwJT2Oocpq07OXRX4bzQo=; h=From:To:Cc:Subject:Date:In-Reply-To:References; b=RWPpiHDuhahUp5lo/XtwrYprSS3O8fGPRJ6JybnCkc889ZC3YuDLj8HmMvNgvwfz9 lLjivojfj5hPINOW15aX+Lz8OTzTBnl/SERNgmIFa3g0DfR1M4a+15wORlbSSZZ76W ovoSLGFxRph11yNOjD880lb8Vdcs4UuddiXTNc7OdMD8kBHCTWs8epKdDQ15uZwfqC Oln4gG+yZtmLplZ6nt/pT7nMxSTi6le8cruGH5Ng4TbrDvkkOjcWSsjIMIoE5YWUxg +lqyc5m1AEZyEWLehJnjz5/wGrTXCQz2VC7c9g0QIxAJ4sE6U4gD5IpGUF9bpxC9Gk TNoP3ySiEfDRV0ZEuLi4s5gvHf9FFuJyGYLzwiX08FjfY5zNEVVdq4feXCPHASLvED 7JXAwqu6pFezGeYfK7epD9012tM9D6Vc4yWctMLfyEFt7f9IvuYwZBUED7f+RSxJVS 0BKef/75MKiy0T05LX7GYyGzGDaDJJCfUUzc8jbv375OHmHDU8+5sXzT3XbDg+f7kD DVGG5MsSp9E0g4Gac9KoJOjhyXvw9SXpWtbjcQzSik1HqounqRmTpTLJZfl2mmjWYs mlVE2x3W7GWjfV+yOww28LwqhHhGTdioUlOZ5TLydHBeNB718NVvnbj/7rrmseiGbi /7rjMLebaPW5DYDH4quoG8dE= From: Tomas Volf <~@wolfsden.cz> To: 74508@debbugs.gnu.org Subject: [PATCH 2/2] services: mingetty: Support waiting on shepherd services. Date: Sun, 24 Nov 2024 15:31:33 +0100 Message-ID: <28d793a8d19605d39db5e05058e3f6218d3a8c97.1732458407.git.~@wolfsden.cz> X-Mailer: git-send-email 2.46.0 In-Reply-To: References: MIME-Version: 1.0 X-Debbugs-Cc: Ludovic Courtès , Maxim Cournoyer Content-Transfer-Encoding: 8bit X-Spam-Score: 0.0 (/) X-Debbugs-Envelope-To: 74508 Cc: Tomas Volf <~@wolfsden.cz> X-BeenThere: debbugs-submit@debbugs.gnu.org X-Mailman-Version: 2.1.18 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: debbugs-submit-bounces@debbugs.gnu.org Sender: "Debbugs-submit" X-Spam-Score: -1.0 (-) 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 --- doc/guix.texi | 20 ++++++++++++++ gnu/services/base.scm | 62 ++++++++++++++++++++++++------------------- 2 files changed, 54 insertions(+), 28 deletions(-) diff --git a/doc/guix.texi b/doc/guix.texi index d689711e80..e15cfeb39d 100644 --- a/doc/guix.texi +++ b/doc/guix.texi @@ -19312,6 +19312,26 @@ Base Services @item @code{chroot} (default: @code{#f}) When set to a string, call @code{chroot} with that 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 b3d3553091..6681d5f8d4 100644 --- a/gnu/services/base.scm +++ b/gnu/services/base.scm @@ -192,6 +192,7 @@ (define-module (gnu services base) mingetty-configuration-nice mingetty-configuration-chdir mingetty-configuration-chroot + mingetty-configuration-shepherd-requirement mingetty-configuration? mingetty-service ; deprecated mingetty-service-type @@ -1245,44 +1246,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)) - (chdir mingetty-configuration-chdir ;String | #f - (default #f)) - (chroot mingetty-configuration-chroot ;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)) + (chdir mingetty-configuration-chdir ;String | #f + (default #f)) + (chroot mingetty-configuration-chroot ;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 chdir chroot) + print-issue print-hostname nice chdir chroot + 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") -- 2.46.0 From debbugs-submit-bounces@debbugs.gnu.org Sun Nov 24 20:46:38 2024 Received: (at 74508) by debbugs.gnu.org; 25 Nov 2024 01:46:38 +0000 Received: from localhost ([127.0.0.1]:36636 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1tFOBR-00083V-PF for submit@debbugs.gnu.org; Sun, 24 Nov 2024 20:46:38 -0500 Received: from mail-oi1-f178.google.com ([209.85.167.178]:53307) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1tFOBO-00083M-KM for 74508@debbugs.gnu.org; Sun, 24 Nov 2024 20:46:35 -0500 Received: by mail-oi1-f178.google.com with SMTP id 5614622812f47-3ea48624a2aso197000b6e.2 for <74508@debbugs.gnu.org>; Sun, 24 Nov 2024 17:46:34 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20230601; t=1732499134; x=1733103934; darn=debbugs.gnu.org; h=mime-version:user-agent:message-id:date:references:in-reply-to :subject:cc:to:from:from:to:cc:subject:date:message-id:reply-to; bh=wifBJKUxPtqYTDGQtDaGF3WYT39zCXduvDxnXa4vsgs=; b=nr3Gk5mIdn/SmxPNYw6djZF9kEJzzsuJN+uWewoeVJ4V1F0Woy7PaxoK+G/2pe7E+2 GXhBqsOYkFl16HEqHiPwe5AOKDWpazkqpUcxlPHTqq5QV2bmCxCKNNHiJz/u14OR7K6l kMYccrIUNJKs272oN6qhZThQmAYY3x8MCuN/cNaSY04wyJ2VUxxMdhdhJRhNOIsWREEL +p40AfMt6uJvwdp5eudZDa1btTNQbrCy9GSn6oJ9OFBCw1IyGoJsMm1DRheer98nVNE5 Lq5y1zP/+TCXEEnCSb/J3azePscuiSggYf13eVjcsjXju0Mox2Oqa8i47+HskFs8Kn0S 949w== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1732499134; x=1733103934; h=mime-version:user-agent:message-id:date:references:in-reply-to :subject:cc:to:from:x-gm-message-state:from:to:cc:subject:date :message-id:reply-to; bh=wifBJKUxPtqYTDGQtDaGF3WYT39zCXduvDxnXa4vsgs=; b=dzn/JG2Ny6v2MXtDmEbu7PRtNn3hP7IGInQ+pFht3rb+mAjFe5w3bavMJaHFbn4URx lzAqUObNjVJR7+q4YNvXUaoBcQHYTPvYdvm4howGYyNr7xljEfjy4SZsP5YuOKb90sjd Jv2ovP+tRaBljYM8ywm3FDImzKl08oGKSOrZyFeVyercOu2Mo+VtkZ41GhN3ZLoOKuxN dqwlvqno1An9C7Xpr+2sKkShBhoehiTx6i7Cpff42/27RKSnoXOLZgzj/M4jZ/l2cca6 DVgy0Mjifh3PaHbYaLSsHbCza4r6sutZvKTXiLLuq3oDhWaMLYS4J0fwf8m7yTXkBrLn 3bJg== X-Gm-Message-State: AOJu0YwaWsgVtsGTmC1LkCDtO9X8YCIPvilbm/xNK0PFH+T7w0LysDcv /TioESYFQ7nBvIbMzkTylTGHFvCADv2PByttfERhqTFrnO+cjGyT X-Gm-Gg: ASbGnctPTw9+jfwFe+b/brsqZNlloYbOJa9tdT82qhezijJvJrFWWmnyLf4jHe8ML1i KAaK/XzMovfpqgjV4otxbvWaHIKuAUPEZW2O9+Xw356OG+aN1qiexI1YaHT4Z6JXCek/OxF7FgF 0Y2j3S44pgXfMm5zbJHPWplJIV4Z/v4fkgqvqmFFQRUaGjNyZnqtiKaK3utxTaRZ/ucXLP2JWU3 HEp46K5pGMNSjc5MBZ2EKKwcg0a5A22X+6+4uxr+OZGNhQ= X-Google-Smtp-Source: AGHT+IEjbcuB1FXDI+lTQQB6Q2uALRH7lrDTmIe6JTkjI8oIKB2OLcsj7if5yzXi60LWYouBK6Tm4g== X-Received: by 2002:a05:6808:1921:b0:3e6:65f8:8f28 with SMTP id 5614622812f47-3e915875613mr9176006b6e.21.1732499133756; Sun, 24 Nov 2024 17:45:33 -0800 (PST) Received: from terra ([2405:6586:be0:0:c8ff:1707:9b9:af89]) by smtp.gmail.com with ESMTPSA id 41be03b00d2f7-7fbcc3fb34dsm5410922a12.78.2024.11.24.17.45.32 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Sun, 24 Nov 2024 17:45:33 -0800 (PST) From: Maxim Cournoyer To: Tomas Volf <~@wolfsden.cz> Subject: Re: [bug#74508] [PATCH 1/2] services: mingetty: Add additional configuration options. In-Reply-To: (Tomas Volf's message of "Sun, 24 Nov 2024 15:31:32 +0100") References: Date: Mon, 25 Nov 2024 10:45:24 +0900 Message-ID: <87jzcsnl1n.fsf@gmail.com> User-Agent: Gnus/5.13 (Gnus v5.13) MIME-Version: 1.0 Content-Type: text/plain X-Spam-Score: 0.0 (/) X-Debbugs-Envelope-To: 74508 Cc: 74508@debbugs.gnu.org, Ludovic =?utf-8?Q?Court=C3=A8s?= X-BeenThere: debbugs-submit@debbugs.gnu.org X-Mailman-Version: 2.1.18 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: debbugs-submit-bounces@debbugs.gnu.org Sender: "Debbugs-submit" X-Spam-Score: -1.0 (-) Hello, Tomas Volf <~@wolfsden.cz> writes: > 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. Fun, good catch! I find it odd that Guile doesn't warn or error when exporting a symbol that isn't defined; I was bit by that recently myself. Personally I'd have effected that correction in a distinct commit, to keep your new functionality diff to its bare minimum (clearer/easier to review). > * 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?. Are all these expected to be functional on Guix, e.g., the 'chroot' option? > (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. This sounds useful. Could it be used in place of a 'motd', such as in our hydra/berlin.scm conf (from the Guix maintenance repo), which is currently relying on PAM to work (and doesn't currently seem to do anything, at least on berlin, for unknown reason). > +@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 Why is the above accessor removed? > + 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)))))) Neatly crafted. Could you please send a v2 with my small comments above addressed, such as splitting in two commits, and not removing the 'mingetty-configuration-mingetty' accessor? Other than that, LGTM. -- Thanks, Maxim From debbugs-submit-bounces@debbugs.gnu.org Sun Nov 24 20:50:42 2024 Received: (at 74508) by debbugs.gnu.org; 25 Nov 2024 01:50:43 +0000 Received: from localhost ([127.0.0.1]:36651 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1tFOFO-0008Gn-Jd for submit@debbugs.gnu.org; Sun, 24 Nov 2024 20:50:42 -0500 Received: from mail-oa1-f50.google.com ([209.85.160.50]:54273) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1tFOFJ-0008GJ-TP for 74508@debbugs.gnu.org; Sun, 24 Nov 2024 20:50:38 -0500 Received: by mail-oa1-f50.google.com with SMTP id 586e51a60fabf-2965e10da1bso1910961fac.0 for <74508@debbugs.gnu.org>; Sun, 24 Nov 2024 17:50:37 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20230601; t=1732499372; x=1733104172; darn=debbugs.gnu.org; h=mime-version:user-agent:message-id:date:references:in-reply-to :subject:cc:to:from:from:to:cc:subject:date:message-id:reply-to; bh=A6cNILMWk/Ex4YnBMJlQ9aeMBamYL9Lp/JQmkC7w5Xk=; b=YU5azftJE4OoFNDDMioVijQkbrfmaqZs0oAOjWx9kifKZMsj9Y2WnLRnBM3UmI74Co XVBNMthwsSqZtU4dACyR8dnUhhhP6U8+aD+tZTO1sSnUPrOhKAVX5mV1XCiUJiQEWsGO wna5QzAl1LxSV9ODbZZwDhbFL/l0cnWNjjzMZXyO5YNX0G3FUu9/+sCNc+gGwRq8ob46 u2PtJ8Sa0FJyZHvi85Uuk3gQhBVFj72QWJkqHuEF8dtOVKritWVypqIk+bDHmexhawn9 ip15KHYj9EnrJHl9uvIYGhcQd5x5Cx44MkT5eoNzOLRo10yJeuFrAVAgGAvLWZD6E6Sd qfjA== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1732499372; x=1733104172; h=mime-version:user-agent:message-id:date:references:in-reply-to :subject:cc:to:from:x-gm-message-state:from:to:cc:subject:date :message-id:reply-to; bh=A6cNILMWk/Ex4YnBMJlQ9aeMBamYL9Lp/JQmkC7w5Xk=; b=UHSnTmD5OAvY2ahJIGzPFf1dnxuNRpyZLolvdmTqPq3NgRonXejmuqizXj12ItM8hd v3/FX7JXxsJF4A3/MD4gZYHMYNpHBK1JEQ4fMskndq6lTVX2cF38eSfxAzsGp26TxPJf n6EH96G/yK/8EEDBDeWtPAOPcLkFcDWfO9GmmJpZ1kn0AnR/qeCPc1axlCLMiGZaJ7KR m4e+tH5XUm1G5G8R3DJ1L4sMJBolau+24bxPWmCcTULglhE2KMyVT6wJI/zGdA+vF1Y+ w2Jiu2Ea41xT7+aVpb3Gd+0DjlNUGOe9TFJYLVA+oBubfdrGgg3wqIkkB/oMLqwpuiXB vRFA== X-Gm-Message-State: AOJu0Yy5vaf2yd3a+cvOPPAJq4ryJre0re+JhumaarVjAnRdsfwG6X1y JSb0jnyKPBpXwX9reVVmfF8fUFhnDcic2mvNLdbenjuHErDmLQWY X-Gm-Gg: ASbGnct2zOgnQnWiymkPV/iJ3xE8gOI58G4m2IkUEQJNlRrJSUHYkwlQtB7rMG/cHE3 XrDpfkFsmfGummIyuCf4rqjY42aal5H+SQ1/LcDQS2RPBUz3iHQtqYoyduxAQ5qDod9e6Ue9lWF fGp30+zV0XpjL9okxtatmatxuJmQOqQ+BIk8gNknKNYBejV28rV2vd8Yg4qCndV6CP6RHPaixod 9PQFgTfcSD7xrf32Gb0KufDUd+TgGzWN9vnG3JT8tBtcm8= X-Google-Smtp-Source: AGHT+IHFnwDBdFpVAliXCsvTb/BxveKtAeID5T8zOLS7mqFFAf1YPvokP96WXnuzqnU6D09fSWPHlQ== X-Received: by 2002:a05:6870:9a90:b0:286:f24f:c231 with SMTP id 586e51a60fabf-29720c728admr8224629fac.25.1732499372349; Sun, 24 Nov 2024 17:49:32 -0800 (PST) Received: from terra ([2405:6586:be0:0:c8ff:1707:9b9:af89]) by smtp.gmail.com with ESMTPSA id 41be03b00d2f7-7fbcbfc3e26sm4593134a12.9.2024.11.24.17.49.30 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Sun, 24 Nov 2024 17:49:31 -0800 (PST) From: Maxim Cournoyer To: Tomas Volf <~@wolfsden.cz> Subject: Re: [bug#74508] [PATCH 2/2] services: mingetty: Support waiting on shepherd services. In-Reply-To: <28d793a8d19605d39db5e05058e3f6218d3a8c97.1732458407.git.~@wolfsden.cz> (Tomas Volf's message of "Sun, 24 Nov 2024 15:31:33 +0100") References: <28d793a8d19605d39db5e05058e3f6218d3a8c97.1732458407.git.~@wolfsden.cz> Date: Mon, 25 Nov 2024 10:49:23 +0900 Message-ID: <87frngnkv0.fsf@gmail.com> User-Agent: Gnus/5.13 (Gnus v5.13) MIME-Version: 1.0 Content-Type: text/plain X-Spam-Score: 0.0 (/) X-Debbugs-Envelope-To: 74508 Cc: 74508@debbugs.gnu.org, Ludovic =?utf-8?Q?Court=C3=A8s?= X-BeenThere: debbugs-submit@debbugs.gnu.org X-Mailman-Version: 2.1.18 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: debbugs-submit-bounces@debbugs.gnu.org Sender: "Debbugs-submit" X-Spam-Score: -1.0 (-) Tomas Volf <~@wolfsden.cz> writes: > 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 Reviewed-by: Maxim Cournoyer -- Thanks, Maxim From debbugs-submit-bounces@debbugs.gnu.org Mon Nov 25 10:37:39 2024 Received: (at 74508) by debbugs.gnu.org; 25 Nov 2024 15:37:40 +0000 Received: from localhost ([127.0.0.1]:40071 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1tFb9f-0005nw-7o for submit@debbugs.gnu.org; Mon, 25 Nov 2024 10:37:39 -0500 Received: from wolfsden.cz ([37.205.8.62]:55770) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from <~@wolfsden.cz>) id 1tFb9c-0005nj-Ck for 74508@debbugs.gnu.org; Mon, 25 Nov 2024 10:37:37 -0500 Received: by wolfsden.cz (Postfix, from userid 104) id B021034603F; Mon, 25 Nov 2024 15:37:34 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=wolfsden.cz; s=mail; t=1732549054; bh=U1kUopvIeusHC9OrU8RjpjbtfRlaERZJw830IYJWa84=; h=From:To:Cc:Subject:In-Reply-To:References:Date; b=nVR4S4NpeiN+2ElgffQP/bta2P8EDvUnebYb2dUQ+EdkGmtPPFDK1bNu3UZn/rTIA HPiFZuFPOP68ydszecXHk8y7NrIWah+huQeXJCfq5NUwenhvXawqWRMDpDPtOFcyrW tSVSZaqKfqLkP5fajgguTRN0Upwi4kbsbGwwBg33ytdhoCQMahm/BIOO97qQJD+QJe x9T+/iifALwNX/b19GaXgZssYVrL/CpUwAti6F07jJdKSnWCFlJYYzkrANZoaR4P5H LvguafoPmG56nEoY3TPQJWxOryZGRU9BTZ0KVujNh0i8AXI4uN54HZz/2UQJHMYQVj tLodXq4W3s5ZoWzVs7bpCAgdGDJji81sqN0SpscUuZrf7o3EUkORWcmYAyu4P4V3sM jPrKhzyZW9ofdLixdc4Wr3QwkwSb5rcxuB1ogkKm8UYU3BE/dyEb6aMSswwuc1CUFg qzwnUaRkrX2KzuSvneKzp/gWEybRPr9jvejgtRzzFtWjmkW16bQhD2cfcJJySxISTV evsKF5xxxK159GUJoTZh+9VL3+FZZyZ8H6H4lJ/cm1omcYlxrzO+9dBP28tdniG32E sy89i6vLMpuXmNZwPE+d99PKjBj/5jKF3yR0uJSV/bRydlJnsxEuMJKontmJMbVXpc n7R41iJbpUGrgCfRaws2Uq9c= X-Spam-Checker-Version: SpamAssassin 3.4.6 (2021-04-09) on wolfsden X-Spam-Level: X-Spam-Status: No, score=-3.1 required=5.0 tests=ALL_TRUSTED,BAYES_00, DKIM_SIGNED,DKIM_VALID,DKIM_VALID_AU,DKIM_VALID_EF,URIBL_BLOCKED autolearn=ham autolearn_force=no version=3.4.6 Received: from localhost (unknown [128.0.188.242]) by wolfsden.cz (Postfix) with ESMTPSA id C6061346539; Mon, 25 Nov 2024 15:37:33 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=wolfsden.cz; s=mail; t=1732549053; bh=U1kUopvIeusHC9OrU8RjpjbtfRlaERZJw830IYJWa84=; h=From:To:Cc:Subject:In-Reply-To:References:Date; b=joEpdFMDX0fN/FmiwZkrZEsNOfBGmEo6a1NwOQAG7CDECRwuPicSMIVZfxaprOFt+ lCcf+4pZVb3jrBQcaR6y9VqQWOPlV/KyysfDMfX+xLLaoKCBy9/FWzKxG2kvHCx+yO tLskuQqK8oGpD7dKBRHaY8q+nusXK6Y3oQa9R3HfC81azRL1VDSBJ1JAiBqkR4b501 UwK2sejBLH92y7wkijhe/mOC6i/od/6r/W+SEpqqavd9a7w3zS6MSos/DrcUL/7oiU fgV5B7w6gIY9Hq8jvgC+VyZjuOHhEizIQ4jLtokch7lMV1gpW2LCOUQubeQoPGqOij /vvtGyAnfYOZG8m6XDHtp7pSPY5CcGMcuoxW35eQ1c6NV6i5CwMzKqEUsfecfVvpEu zZ0+wstIeNmKJpB7rTGqm5CPE7+eCfvXhXUn6cw66YmAyq0b09WblZUMDDiQILkn4W ItePjLI21tegj2TV+n8HHh8zECPoQgYdVfGXSfUnOhZwXmegntrNnib7ZXBfMwKbfh CDJfCHJzpRPTrN8nzUJsJE+pZRpoVwlwxAb8SXnZGLnBSfcHXdRgo2LzXqYvDpE6EP kRZFvTuucqXY9bu/g+h8D3gIdH/j4y3fd5ZWPrBzb8/JL2Uv6lFcGdQFB8UeBCoLQs snuX8cBmk8ZktG1E2OZXCPi0= From: Tomas Volf <~@wolfsden.cz> To: Maxim Cournoyer Subject: Re: [bug#74508] [PATCH 1/2] services: mingetty: Add additional configuration options. In-Reply-To: <87jzcsnl1n.fsf@gmail.com> (Maxim Cournoyer's message of "Mon, 25 Nov 2024 10:45:24 +0900") References: <87jzcsnl1n.fsf@gmail.com> Date: Mon, 25 Nov 2024 16:37:32 +0100 Message-ID: <87ttbve343.fsf@wolfsden.cz> User-Agent: Gnus/5.13 (Gnus v5.13) MIME-Version: 1.0 Content-Type: multipart/signed; boundary="=-=-="; micalg=pgp-sha512; protocol="application/pgp-signature" X-Spam-Score: 0.0 (/) X-Debbugs-Envelope-To: 74508 Cc: 74508@debbugs.gnu.org, Ludovic =?utf-8?Q?Court=C3=A8s?= X-BeenThere: debbugs-submit@debbugs.gnu.org X-Mailman-Version: 2.1.18 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: debbugs-submit-bounces@debbugs.gnu.org Sender: "Debbugs-submit" X-Spam-Score: -1.0 (-) --=-=-= Content-Type: text/plain Content-Transfer-Encoding: quoted-printable Hi, thank you for the review of this patch as well. Comments below. Maxim Cournoyer writes: > Hello, > > Tomas Volf <~@wolfsden.cz> writes: > >> 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 na= med >> just `mingetty-$FIELD', instead of `mingetty-configuration-$FIELD'. How= ever >> the renaming *is* backwards compatible, since in the define-module's #:e= xport >> argument the correct (`mingetty-configuration-$FIELD') were used already. >> Hence, until now, there was no way to access anything except the `tty' f= ield. > > Fun, good catch! I find it odd that Guile doesn't warn or error when > exporting a symbol that isn't defined; I was bit by that recently > myself. I assume there might be historical and/or technical reasons for that, but that is probably topic for guile-devel. :) I personally am bit torn, while I can imagine situations when some symbol is by design left unbound, I had no need for that yet. > Personally I'd have effected that correction in a distinct commit, to > keep your new functionality diff to its bare minimum (clearer/easier > to review). Yeah, I agree, will split it. > >> * gnu/services/base.scm (): Add delay, print-iss= ue, >> print-hostname, nice, chdir, chroot fields. Rename accessors for auto-l= ogin, >> login-program, login-pause?, clear-on-logout?. > > Are all these expected to be functional on Guix, e.g., the 'chroot' > option? Sure, why not? I can for example imagine having Alpine Linux installed in chroot in /opt/alpine, and tty2 would login you into Alpine instead of GuixSD. Do I expect the `chroot' to be used often? No. But it *is* a valid argument to mingetty, so I think it makes sense to add them all and leave it to the user creativity whether it will be used or not. > >> (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. > > This sounds useful. Could it be used in place of a 'motd', such as in > our hydra/berlin.scm conf (from the Guix maintenance repo), which is > currently relying on PAM to work I do not think so. Notice the default value (#t). The issue is printed by default. When you see a tty login prompt, it looks (by default) like this: =2D-8<---------------cut here---------------start------------->8--- $ISSUE $HOST login: $USER Password: $PASSWORD $MOTD =2D-8<---------------cut here---------------end--------------->8--- So in my QEMU test system the "logging screen" looks (roughly) like this: =2D-8<---------------cut here---------------start------------->8--- GNU/Linux test-system x86_64 <--- /etc/issue login: tester (automatic login) GuixSD test VM. Welcome. <--- /gnu/store/...-motd $ =2D-8<---------------cut here---------------end--------------->8--- > (and doesn't currently seem to do anything, at least on berlin, for > unknown reason). I think this is expected no? I would assume that most people log via SSH (only Ricardo has physical access?) and there is no `/etc/motd' file created by `frontend-services'. Consider adding something like this to the list of services returned by the `frontend-services' procedure: =2D-8<---------------cut here---------------start------------->8--- (extra-special-file "/etc/motd" motd) =2D-8<---------------cut here---------------end--------------->8--- That should make the message of the day visible even for SSH logins. > >> +@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 > > Why is the above accessor removed? Good catch, that was not intentional. > >> + 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 | Sy= mbol >> + (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)))))) > > Neatly crafted. Could you please send a v2 with my small comments above > addressed, such as splitting in two commits, and not removing the > 'mingetty-configuration-mingetty' accessor? Other than that, LGTM. Will polish the commit messages and send v2, thank you once more for the review. Have a nice day, Tomas =2D-=20 There are only two hard things in Computer Science: cache invalidation, naming things and off-by-one errors. --=-=-= Content-Type: application/pgp-signature; name="signature.asc" -----BEGIN PGP SIGNATURE----- iQJCBAEBCgAsFiEEt4NJs4wUfTYpiGikL7/ufbZ/wakFAmdEmbwOHH5Ad29sZnNk ZW4uY3oACgkQL7/ufbZ/wamgZA/+IQVtCxK4CdRsHObKgbFawK83gYWfZd8M6vop vBVzdTRT+Uet1OQVxZqMpODNPBe9diWGdOB4/t2tc2cOnX8eAd6PXIVuXK71BU5U qDtHPZKA4tg7cz5Z36JgGcsCvJSEv9aXjau3wA61BecNwT27k5qOFx3eeWKbv/aO wuEshVYCs23KDgA64rkIfxqEP5rpMWcOKnPIZBj6PFBFC3IWCl0HFhpBAA0PbW5E 38xXvmSuwBlW//DyLSjC/R8HZvRgAJWVKBRwZTgC6A+qa+TvIGuw1ciHaJye4RTm oiiF7cuPYd1UcvHsEwNuIR2eAhKWgFkDz58zRrttdO10b6y9+RTBbXUnsVgHKlYC B9JEqr3LXPTl9gSvT5tPLtPEokQRbnT1Bes6I+deZbckLquzIEA3yiGfQiURfna/ 5eQn+3ZyfXk4sWtaMqqgLYlhC9TAnEG8rKKpeRfhdMKi5S+0/HlOL+j9e0rCiTnY 1izzUQIJU3nscmVOcaefj+6fFDWoHhcUxIe6sTXS9ZCxr8vfYzzP+Kq9ef3uUpID Ad7tJRvV4mmW5njh8Cl2PP0IQhMWDq/UJ5y20lVVSwChfX79GzlfZygPmJRHLtWw /BDfEKsgR1fYt9k/Ku/iFUlnTKri0bgu0Qr/2XiRZLIM/mQGf+c2GD8gIHs0bKiq UNw+m5E= =zz7R -----END PGP SIGNATURE----- --=-=-=-- From debbugs-submit-bounces@debbugs.gnu.org Mon Nov 25 11:07:32 2024 Received: (at 74508) by debbugs.gnu.org; 25 Nov 2024 16:07:32 +0000 Received: from localhost ([127.0.0.1]:40142 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1tFbca-00079a-6u for submit@debbugs.gnu.org; Mon, 25 Nov 2024 11:07:32 -0500 Received: from wolfsden.cz ([37.205.8.62]:60522) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from <~@wolfsden.cz>) id 1tFbcX-00079E-Pc for 74508@debbugs.gnu.org; Mon, 25 Nov 2024 11:07:30 -0500 Received: by wolfsden.cz (Postfix, from userid 104) id 31A86347014; Mon, 25 Nov 2024 16:07:29 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=wolfsden.cz; s=mail; t=1732550849; bh=2HqlvG8RV+MlyB8kgfh56fBUqh9eZp/Zu71QifBDznk=; h=From:To:Cc:Subject:Date:In-Reply-To:References; b=kzwpJhroGT4GHSTRYrhlX12qWYCO6zInoTDkcVN+mQqB9aQ8rLIcH24m4eCI8b7K1 6oTDAM4o19a5XRaCJR37/upqGOe89UMS3e/SQhmjGr+eVVRsnMLmMiBaWNvBzz3FRH bGkVQIldmyn9RdM/Izit7eorqTMqdwexXY4P3ZgJgLRX0OPR1zQGXs7LMfPpsTUst7 CEqCCHXqDhK2p/xCG2Jz9g29Yqc33Ypx+q9xY46uIRVbdBz2Ip6WDxPYFml7OK236n +JJOQanvkwsVVRU03q3OM2/XjeHIfbTYc6wti0bA1ShsetghN7OKvje8xpyQcRs3Dw i8NlykNUry85gF3vcq7e9V7pRwGkWkca3IXvFXpKR+dvMaJzeGx2fxxx0c+Tb8HJ6F Y6a0piSUKbxVfU+bg3T3y/QnG3KFb1WiTvLHzfXv6l9ru2Q2y9tQVHW78Xy6IgwFYl yMN/G5AL9tBuY4DPJ16AMgjnGgoDH+/0Vqv2CJOOV5JF4bfszevDcnzN66kzbY25hn RlmzEIeq4pB2ocT8dsvD3ASUxY4TXQ+PgHpKIGuDMEZk7lbMIJn8gUjfwZTq8K/u+U hkExqdgL+euPfhSa+n6layn/LosyheMDd5vxevXhYmIexZWdGxQygquO5nPNlCbuIk zm63a52KCvOinnAv0tsRNH+g= X-Spam-Checker-Version: SpamAssassin 3.4.6 (2021-04-09) on wolfsden X-Spam-Level: X-Spam-Status: No, score=-3.1 required=5.0 tests=ALL_TRUSTED,BAYES_00, DKIM_SIGNED,DKIM_VALID,DKIM_VALID_AU,DKIM_VALID_EF,URIBL_BLOCKED autolearn=unavailable autolearn_force=no version=3.4.6 Received: from localhost (unknown [128.0.188.242]) by wolfsden.cz (Postfix) with ESMTPSA id 5C1DE347780; 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=2HqlvG8RV+MlyB8kgfh56fBUqh9eZp/Zu71QifBDznk=; h=From:To:Cc:Subject:Date:In-Reply-To:References; b=GaXYtUbr2nlB4zqfx9Cw1nXovkWJaQCQPkUVYSB8W1jWFF7WdHxzr9N9EsNgIM1cb CqI+gobhOTYPls4TKs/nPW3nGmmWX62L11yuBOXTdvG51A0qatSd4QaLqMqEYLlXKB KODXbhn5DyxKLnFIPFNt/M0U23npAgF8ELyR5xoEomvFv1VB8QPm3rwXFbZTdkVfAi K05FREAi6hESHelFkFSrCBj/3S0hQZUxfAup6wLrMoY1ItgCtCSQxualk8aLSzdm1k m+3bj9PMVMh+v2GYSVQrZ2iakuoGw+FO38jHXMR/H0aso/n/XNWewBST4VnKkKUI04 gYKZ8Q4zGTdu/BAYZv1GxYDBsHnyxjfKgvs8t4xsnDFtvSkmXaIuKQ6X9+6cqFOqKh oxD32v9BcpjevKpPVgfpRSFANubYW22Enpov/4z6UdyoGhT/4XzslnFXka5lXVlGQM MUyXDnLblNj4qfmVUI5tmv9OSyGHII/709C390HJWg5tgjYKOQ25gKnIaT8DUAvvUm XFnPnBtjeA51thzU4UBkxQ6lbshVc7n7w4v6n7gk72569iWZRLcDgRMWguTgqHdB3t bIR0/jPhm/uEGGwpSMMD49QNa4NNmMTHW/svIZodcMl7DvbqRw0hTPOpSalB89hZ34 vHgMIfgSXLBANnH/IGLJoGtI= From: Tomas Volf <~@wolfsden.cz> To: 74508@debbugs.gnu.org Subject: [PATCH v2 2/3] services: mingetty: Rename misnamed accessors. Date: Mon, 25 Nov 2024 17:05:34 +0100 Message-ID: <5d6ae334f3275b2312d2fbce4a8f9552af444331.1732550735.git.~@wolfsden.cz> X-Mailer: git-send-email 2.46.0 In-Reply-To: <3735b134a382255528e7da6706828ee5d80f50a5.1732550735.git.~@wolfsden.cz> References: <3735b134a382255528e7da6706828ee5d80f50a5.1732550735.git.~@wolfsden.cz> MIME-Version: 1.0 Content-Transfer-Encoding: 8bit X-Spam-Score: 0.0 (/) X-Debbugs-Envelope-To: 74508 Cc: Tomas Volf <~@wolfsden.cz> X-BeenThere: debbugs-submit@debbugs.gnu.org X-Mailman-Version: 2.1.18 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: debbugs-submit-bounces@debbugs.gnu.org Sender: "Debbugs-submit" X-Spam-Score: -1.0 (-) 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(-) diff --git a/gnu/services/base.scm b/gnu/services/base.scm index 9712218bd5..e123226da5 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)) -- 2.46.0 From debbugs-submit-bounces@debbugs.gnu.org Mon Nov 25 11:07:33 2024 Received: (at 74508) by debbugs.gnu.org; 25 Nov 2024 16:07:33 +0000 Received: from localhost ([127.0.0.1]:40144 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1tFbca-00079c-Id for submit@debbugs.gnu.org; Mon, 25 Nov 2024 11:07:33 -0500 Received: from wolfsden.cz ([37.205.8.62]:60530) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from <~@wolfsden.cz>) id 1tFbcY-00079G-5d for 74508@debbugs.gnu.org; Mon, 25 Nov 2024 11:07:30 -0500 Received: by wolfsden.cz (Postfix, from userid 104) id A156E34556C; Mon, 25 Nov 2024 16:07:29 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=wolfsden.cz; s=mail; t=1732550849; bh=+/uQ783ZWvg0xyt9BEmSJL2O4cjnTop/2nTs1CkR8vM=; h=From:To:Cc:Subject:Date:In-Reply-To:References; b=Kvzx/jVMYjDd1kRlmjwpVKr1XmkDrRL3rrFRBT4nM9RUnf1ZPSpDW/AAJe1PEcDQp LMiWEvA+6hdRUKk1OsS0QC4NuHNfcQrzmjD3/sNQZq8ilDt7LkxsxjR4UB//bgCI5Z g4+ufaJNJmFNuvjAsIGVI1uPQwIa7HxRd9M8AKQ283l04lZHR8s1aJI6LBMMdXIxQC tFDBVEp3nKjtyuzyzWnCVGwLT3eaXxAd06eneU+fb7uwNaREDSBOED/99JDLgthBVx XFZgv3kuyIZROnzk3BqJpzem3+WBlUUfHHsNRdoT7nnWQL4V2izGOE1BYscDM3gWe+ vCUCwUvph6mIc17SI/IPCd6zEEcwN2b/9QF2jTk5oeswWoStkoxZepGPinB9C4q4Kk 4LcOSGgFBvkPTjPVv47llv46Rw/P+BsVCFgxlGIvEJo7sBjQssuIgy14bf70j+qa7D v1GsmaHTnBSHL7d1FdrhUFaNtXNIAvC2bh6a6Ut23u0lgyBP8d8ocAoB74SIAD1ei4 3qZc64HVFxqmQh4EHhFExykxUvPibUCIQ4bgsYvNDQWZi4xQFyAxW0JNbbPh56683N sjH7aLGspCpHWR4+VyDg8L9FjlSsiOZrt9IWwEwb9tERSzgxO+nXpOfgRj7Fo72YWp TVTbuzPXW7pxxw11ClpX5acI= X-Spam-Checker-Version: SpamAssassin 3.4.6 (2021-04-09) on wolfsden X-Spam-Level: X-Spam-Status: No, score=-3.1 required=5.0 tests=ALL_TRUSTED,BAYES_00, DKIM_SIGNED,DKIM_VALID,DKIM_VALID_AU,DKIM_VALID_EF,URIBL_BLOCKED autolearn=unavailable autolearn_force=no version=3.4.6 Received: from localhost (unknown [128.0.188.242]) by wolfsden.cz (Postfix) with ESMTPSA id E2F143458F6; 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=+/uQ783ZWvg0xyt9BEmSJL2O4cjnTop/2nTs1CkR8vM=; h=From:To:Cc:Subject:Date:In-Reply-To:References; b=nV5InPljtFBJ4h7JEXpPgn50zjR3zID3iwaijnuBUDy8eoS6DvROfZ2DBRshFCj/z 3BLP+QeAhrc+/Oypwygw6TisyPpTHHaUzWsNWEmc140q5wtByGGBcG7cZ1BpacUZLq ISgJpbcdOme1jzagxq0pjDbbePDY3towhrf91/Zq1EO4aogbRH51FznG77F/yjrAGh 8mXtl0IMycZYSZLdcfMKXQNGKjjXFO3peZ/r2jRlAUgLMUIKx9KtYnZRwnf9+Pl0u2 xA0kDbJO6f7eUT4x7k63XhNwMc25lhincfM9zWn11Y9bm+gOxS1Aw1vkXoHmpxrcPx XZUUx1bAVdgJUmH4YLW7S3Cek3l6PgcRQhhaePuiIRwPE3metJhGT1qed5lVUX2B5h orl7fqPLz0YGiJsQUgreVCgptNdZa5hTZCTt5cFqtKHhVLazlt74B6+j0dWc1oiLK4 2/jTnW9t//JzhpcNN0T4FiGq2RKaOKxTjSvhAjjcS67LLTUApj3jTo1rkoRHrxoein HxV7UkD3dBIX8RqVYAocDVAR9sOjtgIFU+ByK1jfGCgAcRWen5bt0N2lAD1zFhlzMX tg7zj8v/jTUuEv7oqj0joxOHaImSsc/G8cyM26Ob1OACXlfoHqjCFmWxzhDdgLKg91 szCyxfgVvte0BOw2Pyhsx/BI= From: Tomas Volf <~@wolfsden.cz> To: 74508@debbugs.gnu.org Subject: [PATCH v2 3/3] services: mingetty: Support waiting on shepherd services. Date: Mon, 25 Nov 2024 17:05:35 +0100 Message-ID: X-Mailer: git-send-email 2.46.0 In-Reply-To: <3735b134a382255528e7da6706828ee5d80f50a5.1732550735.git.~@wolfsden.cz> References: <3735b134a382255528e7da6706828ee5d80f50a5.1732550735.git.~@wolfsden.cz> MIME-Version: 1.0 X-Debbugs-Cc: Ludovic Courtès , Maxim Cournoyer Content-Transfer-Encoding: 8bit X-Spam-Score: 0.0 (/) X-Debbugs-Envelope-To: 74508 Cc: Tomas Volf <~@wolfsden.cz> X-BeenThere: debbugs-submit@debbugs.gnu.org X-Mailman-Version: 2.1.18 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: debbugs-submit-bounces@debbugs.gnu.org Sender: "Debbugs-submit" X-Spam-Score: -1.0 (-) 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 | 62 ++++++++++++++++++++++++------------------- 2 files changed, 54 insertions(+), 28 deletions(-) diff --git a/doc/guix.texi b/doc/guix.texi index c5f9481810..9a8daf52d9 100644 --- a/doc/guix.texi +++ b/doc/guix.texi @@ -19375,6 +19375,26 @@ Base Services @item @code{chroot} (default: @code{#f}) When set to a string, call @code{chroot} with that 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 e123226da5..ecf0322890 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-chdir mingetty-configuration-chroot + mingetty-configuration-shepherd-requirement mingetty-configuration? mingetty-service ; deprecated mingetty-service-type @@ -1246,44 +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)) - (chdir mingetty-configuration-chdir ;String | #f - (default #f)) - (chroot mingetty-configuration-chroot ;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)) + (chdir mingetty-configuration-chdir ;String | #f + (default #f)) + (chroot mingetty-configuration-chroot ;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 chdir chroot) + print-issue print-hostname nice chdir chroot + 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") -- 2.46.0 From debbugs-submit-bounces@debbugs.gnu.org Mon Nov 25 11:07:33 2024 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= X-Spam-Checker-Version: SpamAssassin 3.4.6 (2021-04-09) on wolfsden X-Spam-Level: X-Spam-Status: No, score=-3.1 required=5.0 tests=ALL_TRUSTED,BAYES_00, DKIM_SIGNED,DKIM_VALID,DKIM_VALID_AU,DKIM_VALID_EF,URIBL_BLOCKED autolearn=unavailable autolearn_force=no version=3.4.6 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> To: 74508@debbugs.gnu.org Subject: [PATCH v2 1/3] services: mingetty: Add additional configuration options. 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 X-Debbugs-Cc: Ludovic Courtès , Maxim Cournoyer Content-Transfer-Encoding: 8bit X-Spam-Score: 0.0 (/) X-Debbugs-Envelope-To: 74508 Cc: Tomas Volf <~@wolfsden.cz> X-BeenThere: debbugs-submit@debbugs.gnu.org X-Mailman-Version: 2.1.18 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: debbugs-submit-bounces@debbugs.gnu.org Sender: "Debbugs-submit" X-Spam-Score: -1.0 (-) 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 From debbugs-submit-bounces@debbugs.gnu.org Mon Dec 02 06:06:42 2024 Received: (at 74508) by debbugs.gnu.org; 2 Dec 2024 11:06:42 +0000 Received: from localhost ([127.0.0.1]:54424 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1tI4GH-00011h-LS for submit@debbugs.gnu.org; Mon, 02 Dec 2024 06:06:41 -0500 Received: from eggs.gnu.org ([209.51.188.92]:54678) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1tI4GF-00011S-Vn for 74508@debbugs.gnu.org; Mon, 02 Dec 2024 06:06:40 -0500 Received: from fencepost.gnu.org ([2001:470:142:3::e]) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1tI4G9-0005Lh-09; Mon, 02 Dec 2024 06:06:34 -0500 DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=gnu.org; s=fencepost-gnu-org; h=MIME-Version:Date:References:In-Reply-To:Subject:To: From; bh=ynSB0hxnM+ZOVM2iaGSpYV+Lv1lSXEAts5PUTjN9Tas=; b=PD1Jm2i4GHIyrgroIT9Z v5tEeUS1g9Pilw3tm9vYmzdSwUqKDBL/L0GJSJSz4oZ+IEmrLGACOvfD3npvJud0H2Uz48WyvyYJF Ft7T5Rzz1vVIov4KdCx06v7HQdTdYp4IKpr+JjtY8hde9+c1SBpB2cQr2Mde8vj4Fxzcg0YeGe4HU QUW53Wh0ha66mt9icP+Ibg3jN1YCx7YzWXE+0dk69EsqS61aJmgFS7HMfma0m/oTrlH08ona3jpd0 iBkKzENhn/+x0bvzFVaKh5ji4oLnE+YJ5JLHmW8ns3nQZmzMKXzIAai34S2fgCWbg8K64Y4dath9g 3nFK56dahZa3eg==; From: =?utf-8?Q?Ludovic_Court=C3=A8s?= To: Tomas Volf <~@wolfsden.cz> Subject: Re: [bug#74508] [PATCH v2 1/3] services: mingetty: Add additional configuration options. In-Reply-To: <3735b134a382255528e7da6706828ee5d80f50a5.1732550735.git.~@wolfsden.cz> (Tomas Volf's message of "Mon, 25 Nov 2024 17:05:33 +0100") References: <3735b134a382255528e7da6706828ee5d80f50a5.1732550735.git.~@wolfsden.cz> Date: Mon, 02 Dec 2024 12:05:48 +0100 Message-ID: <87v7w2wdir.fsf@gnu.org> User-Agent: Gnus/5.13 (Gnus v5.13) MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: quoted-printable X-Spam-Score: -2.3 (--) X-Debbugs-Envelope-To: 74508 Cc: 74508@debbugs.gnu.org, Maxim Cournoyer X-BeenThere: debbugs-submit@debbugs.gnu.org X-Mailman-Version: 2.1.18 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: debbugs-submit-bounces@debbugs.gnu.org Sender: "Debbugs-submit" X-Spam-Score: -3.3 (---) Hi, Tomas Volf <~@wolfsden.cz> skribis: > +@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. How about =E2=80=98working-directory=E2=80=99 and =E2=80=98root-directory= =E2=80=99 for these two, in line with widespread naming convention? And instead of =E2=80=9Ccall chroot=E2=80=9D, I=E2=80=99d write =E2=80=9Cus= e this directory as the process's root (``chroot'' into it).=E2=80=9D (again in an effort to avoid jargon and abbreviations). Other than that LGTM! Ludo=E2=80=99. From debbugs-submit-bounces@debbugs.gnu.org Mon Dec 02 19:14:50 2024 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= X-Spam-Checker-Version: SpamAssassin 3.4.6 (2021-04-09) on wolfsden X-Spam-Level: X-Spam-Status: No, score=-3.1 required=5.0 tests=ALL_TRUSTED,BAYES_00, DKIM_SIGNED,DKIM_VALID,DKIM_VALID_AU,DKIM_VALID_EF,URIBL_BLOCKED autolearn=unavailable autolearn_force=no version=3.4.6 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> To: 74508@debbugs.gnu.org Subject: [PATCH v3 2/3] services: mingetty: Rename misnamed accessors. 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 Content-Transfer-Encoding: 8bit X-Spam-Score: 0.0 (/) X-Debbugs-Envelope-To: 74508 Cc: Tomas Volf <~@wolfsden.cz> X-BeenThere: debbugs-submit@debbugs.gnu.org X-Mailman-Version: 2.1.18 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: debbugs-submit-bounces@debbugs.gnu.org Sender: "Debbugs-submit" X-Spam-Score: -1.0 (-) 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(-) 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)) -- 2.46.0 From debbugs-submit-bounces@debbugs.gnu.org Mon Dec 02 19:14:50 2024 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= X-Spam-Checker-Version: SpamAssassin 3.4.6 (2021-04-09) on wolfsden X-Spam-Level: X-Spam-Status: No, score=-3.1 required=5.0 tests=ALL_TRUSTED,BAYES_00, DKIM_SIGNED,DKIM_VALID,DKIM_VALID_AU,DKIM_VALID_EF,URIBL_BLOCKED autolearn=ham autolearn_force=no version=3.4.6 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> To: 74508@debbugs.gnu.org Subject: [PATCH v3 1/3] services: mingetty: Add additional configuration options. 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-Debbugs-Cc: Ludovic Courtès , Maxim Cournoyer Content-Transfer-Encoding: 8bit X-Spam-Score: 0.0 (/) X-Debbugs-Envelope-To: 74508 Cc: Tomas Volf <~@wolfsden.cz> X-BeenThere: debbugs-submit@debbugs.gnu.org X-Mailman-Version: 2.1.18 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: debbugs-submit-bounces@debbugs.gnu.org Sender: "Debbugs-submit" X-Spam-Score: -1.0 (-) 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 From debbugs-submit-bounces@debbugs.gnu.org Mon Dec 02 19:14:51 2024 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= X-Spam-Checker-Version: SpamAssassin 3.4.6 (2021-04-09) on wolfsden X-Spam-Level: X-Spam-Status: No, score=-3.1 required=5.0 tests=ALL_TRUSTED,BAYES_00, DKIM_SIGNED,DKIM_VALID,DKIM_VALID_AU,DKIM_VALID_EF,URIBL_BLOCKED autolearn=unavailable autolearn_force=no version=3.4.6 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> To: 74508@debbugs.gnu.org Subject: [PATCH v3 3/3] services: mingetty: Support waiting on shepherd services. 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-Debbugs-Cc: Ludovic Courtès , Maxim Cournoyer Content-Transfer-Encoding: 8bit X-Spam-Score: 0.0 (/) X-Debbugs-Envelope-To: 74508 Cc: Tomas Volf <~@wolfsden.cz> X-BeenThere: debbugs-submit@debbugs.gnu.org X-Mailman-Version: 2.1.18 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: debbugs-submit-bounces@debbugs.gnu.org Sender: "Debbugs-submit" X-Spam-Score: -1.0 (-) 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(-) 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") -- 2.46.0 From debbugs-submit-bounces@debbugs.gnu.org Mon Dec 02 19:18:17 2024 Received: (at 74508) by debbugs.gnu.org; 3 Dec 2024 00:18:17 +0000 Received: from localhost ([127.0.0.1]:57074 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1tIGcK-0000ag-OQ for submit@debbugs.gnu.org; Mon, 02 Dec 2024 19:18:17 -0500 Received: from wolfsden.cz ([37.205.8.62]:45398) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from <~@wolfsden.cz>) id 1tIGcH-0000aP-BS for 74508@debbugs.gnu.org; Mon, 02 Dec 2024 19:18:14 -0500 Received: by wolfsden.cz (Postfix, from userid 104) id 650BB338906; Tue, 3 Dec 2024 00:18:12 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=wolfsden.cz; s=mail; t=1733185092; bh=p3NJEgWARBF1AZniacmn1y7CXS8QAt2JzuIXdOxb4DM=; h=From:To:Cc:Subject:In-Reply-To:References:Date; b=cDnXlFDTK8AGIG4styPtM+IAqeph8MheimPlEryTP6CAff/qTptVPvu3nIH0QrZq9 JQQ6nkmwrcn+2FaOkeTfr4qfdwQSF8j8HfyNEaQFZqD6zyeCioH7p2ictclkSo2ZdB 169ZVyezzBmN8OQMuISXGTkn1U9ekOHaKDrZLRV5tRrbpBVxlyWCBei26OPAzI35Cu MYl1o7MlAyA1+NBrA7KzUnE7ffpvBSk9s/Hm1PzdAx7Ub+t/Y5nBl6MepTigsb6EHl lYYGepBfM3nxaxbuiCasQgKpgsVn628VilrTLl/vsQa5RG2YD/ftX6Fh97N7MBaKpf uN/hYglG7z1tOtJxOFynVHUqVGS8DjJOnkzf2oqsoaFtmePnBGq3fI4rUWje7S+g9J +GVVqcYw+5EEutDI3advEY9B+ewOnOE1mR14R5abwGn58WWPnUdJzG0ubUKdptNUoh BBPiyHZNfG+UbCGmkZrPxL0F5Mgt1W9J7svZByt9V3mcD16KGcUXmYMvxGkZxgCHQq wNrb15gqM8b6qCJQr7szbtOUHZdGGxLTwxA1VYdumQiOetHCSBs39FYddEXhMtC2s4 ZOV08HZQn+Pe5Xp17q+cAtf2R9CN7vhzMppxcOQ1RBmSVXf+ih8iHMLso6I7IHINn/ V8Zf5/1UXt+qKWrz6G/dkT/U= X-Spam-Checker-Version: SpamAssassin 3.4.6 (2021-04-09) on wolfsden X-Spam-Level: X-Spam-Status: No, score=-3.1 required=5.0 tests=ALL_TRUSTED,BAYES_00, DKIM_SIGNED,DKIM_VALID,DKIM_VALID_AU,DKIM_VALID_EF,URIBL_BLOCKED autolearn=ham autolearn_force=no version=3.4.6 Received: from localhost (unknown [128.0.188.242]) by wolfsden.cz (Postfix) with ESMTPSA id 0D60C32773D; Tue, 3 Dec 2024 00:18:12 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=wolfsden.cz; s=mail; t=1733185092; bh=p3NJEgWARBF1AZniacmn1y7CXS8QAt2JzuIXdOxb4DM=; h=From:To:Cc:Subject:In-Reply-To:References:Date; b=cDnXlFDTK8AGIG4styPtM+IAqeph8MheimPlEryTP6CAff/qTptVPvu3nIH0QrZq9 JQQ6nkmwrcn+2FaOkeTfr4qfdwQSF8j8HfyNEaQFZqD6zyeCioH7p2ictclkSo2ZdB 169ZVyezzBmN8OQMuISXGTkn1U9ekOHaKDrZLRV5tRrbpBVxlyWCBei26OPAzI35Cu MYl1o7MlAyA1+NBrA7KzUnE7ffpvBSk9s/Hm1PzdAx7Ub+t/Y5nBl6MepTigsb6EHl lYYGepBfM3nxaxbuiCasQgKpgsVn628VilrTLl/vsQa5RG2YD/ftX6Fh97N7MBaKpf uN/hYglG7z1tOtJxOFynVHUqVGS8DjJOnkzf2oqsoaFtmePnBGq3fI4rUWje7S+g9J +GVVqcYw+5EEutDI3advEY9B+ewOnOE1mR14R5abwGn58WWPnUdJzG0ubUKdptNUoh BBPiyHZNfG+UbCGmkZrPxL0F5Mgt1W9J7svZByt9V3mcD16KGcUXmYMvxGkZxgCHQq wNrb15gqM8b6qCJQr7szbtOUHZdGGxLTwxA1VYdumQiOetHCSBs39FYddEXhMtC2s4 ZOV08HZQn+Pe5Xp17q+cAtf2R9CN7vhzMppxcOQ1RBmSVXf+ih8iHMLso6I7IHINn/ V8Zf5/1UXt+qKWrz6G/dkT/U= From: Tomas Volf <~@wolfsden.cz> To: Ludovic =?utf-8?Q?Court=C3=A8s?= Subject: Re: [bug#74508] [PATCH v2 1/3] services: mingetty: Add additional configuration options. In-Reply-To: <87v7w2wdir.fsf@gnu.org> ("Ludovic =?utf-8?Q?Court=C3=A8s=22'?= =?utf-8?Q?s?= message of "Mon, 02 Dec 2024 12:05:48 +0100") References: <3735b134a382255528e7da6706828ee5d80f50a5.1732550735.git.~@wolfsden.cz> <87v7w2wdir.fsf@gnu.org> Date: Tue, 03 Dec 2024 01:18:11 +0100 Message-ID: <87ldwx39h8.fsf@wolfsden.cz> User-Agent: Gnus/5.13 (Gnus v5.13) MIME-Version: 1.0 Content-Type: multipart/signed; boundary="=-=-="; micalg=pgp-sha512; protocol="application/pgp-signature" X-Spam-Score: 0.0 (/) X-Debbugs-Envelope-To: 74508 Cc: 74508@debbugs.gnu.org, Maxim Cournoyer X-BeenThere: debbugs-submit@debbugs.gnu.org X-Mailman-Version: 2.1.18 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: debbugs-submit-bounces@debbugs.gnu.org Sender: "Debbugs-submit" X-Spam-Score: -1.0 (-) --=-=-= Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: quoted-printable Ludovic Court=C3=A8s writes: > Hi, > > Tomas Volf <~@wolfsden.cz> skribis: > >> +@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. > > How about =E2=80=98working-directory=E2=80=99 and =E2=80=98root-directory= =E2=80=99 for these two, in > line with widespread naming convention? > > And instead of =E2=80=9Ccall chroot=E2=80=9D, I=E2=80=99d write =E2=80=9C= use this directory as the > process's root (``chroot'' into it).=E2=80=9D (again in an effort to avoid > jargon and abbreviations). > > Other than that LGTM! I cannot say I particularly agree with that. I would consider both `chdir' and `chroot' being terms familiar to anyone who would actually want to configure them, and the terms map cleanly to the mingetty(8). In any case, I do appreciate the review and I have sent a v3 with the requested changes. Have a nice day, Tomas =2D-=20 There are only two hard things in Computer Science: cache invalidation, naming things and off-by-one errors. --=-=-= Content-Type: application/pgp-signature; name="signature.asc" -----BEGIN PGP SIGNATURE----- iQJCBAEBCgAsFiEEt4NJs4wUfTYpiGikL7/ufbZ/wakFAmdOTkMOHH5Ad29sZnNk ZW4uY3oACgkQL7/ufbZ/wamZsQ//Rt3UT6YZ/ATH84SCgK44V8+zhLqwHCxU5yMM 2wM1JV/hzdqAUiJ0tTfwSO8bBEAg/o8tIRhJpUzicqWM+eQrK1AZL+TRF349pDnS hqHjEaS0cVgKRbLp7wP/GmrRmpG1B68l88eZUywhf3RxhEjWhcu28Wi0z9bFq4tS ZDxH2gzcZZ2wtVkV7BDfUapSglNSHM+lCeMYgWzO3QPjz32f/lQoJ4v8Id/5027f HC+Cf5yzK78amm7qtBWrAq9IyH73sPapp0sEJMYy0KI3z6L4sXRNtQ7O0KJiuN3/ sUXaD6cV/0ahcT+LOfYhWNDDOE1ov6jIp0B9NnFzYFWobEk1z2/oGrxw7ncOaXd7 PZXsmjJgru+68W72+s9LGNSmrr8AggNYw7ukEjoXO93j2nU3EarKmcxyiJDyjOib M9A8TzBtuhrPRxVK0QSrtgH1TguLeKyZ8aIHtmSi1kfZ+FeLSziIvIKNA9W8q1FB yKE10jZAj6SVN4GEcpL7Jgjc7KAGKEbrJHAFutEAVYJVgszjE3u+amqFtGsDZ2gS E+LSOc+OpInOemnY1BFkXzvqVSypv+ZYhj5mIxv1Tr+c6dnj1ovVnf7SWn9bTMey pDEWlkkFDIHlDaet/5+0hvuhYgc5UblH/DhofZZiN1g/a8IZWleqZFBI3/Xm0f97 0cLmU+Y= =CT3l -----END PGP SIGNATURE----- --=-=-=-- From debbugs-submit-bounces@debbugs.gnu.org Sun Dec 08 19:50:13 2024 Received: (at 74508) by debbugs.gnu.org; 9 Dec 2024 00:50:13 +0000 Received: from localhost ([127.0.0.1]:52121 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1tKRyX-0001mC-66 for submit@debbugs.gnu.org; Sun, 08 Dec 2024 19:50:13 -0500 Received: from mail-pf1-f172.google.com ([209.85.210.172]:60666) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1tKRyV-0001hD-EE for 74508@debbugs.gnu.org; Sun, 08 Dec 2024 19:50:12 -0500 Received: by mail-pf1-f172.google.com with SMTP id d2e1a72fcca58-725c24f3a89so1818168b3a.0 for <74508@debbugs.gnu.org>; Sun, 08 Dec 2024 16:50:11 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20230601; t=1733705346; x=1734310146; darn=debbugs.gnu.org; h=mime-version:user-agent:message-id:date:references:in-reply-to :subject:cc:to:from:from:to:cc:subject:date:message-id:reply-to; bh=RgjyiZ2fEAoAV8XjPSqmrd7pKj63Lr4KytXVmASxxAc=; b=PSLMnKvxTfZ1ciFup66V8BxzM+Tq1jn60szotnd3BpOwc5zaF3W9R4F+SSX88ONMUb s1lnbCIW2woRXxkuu9zzvb0yXU4DrBSe3xXb1y3kgTPTVIC0priE8MQVF1cKVoQj3RWw sGyJb/SdrYmcM1hVfOjqMWisGFkxFOf/CPYim1XUP6g+0w5THKh/ttaIAc4qVJ0075X7 QUQUUVute4YWkKrpol+lCFoglEtb3lUZ4rzRFplvlxVdeFV3duPUBRDLGLJ6kqJsGIEz DqMY1J4CA+mbp0qGD3IvQ7N75ChiaxhvYkz5dW4zI5Sh/8BI+wtpgc1fdQBXGhgEdcvr Zntw== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1733705346; x=1734310146; h=mime-version:user-agent:message-id:date:references:in-reply-to :subject:cc:to:from:x-gm-message-state:from:to:cc:subject:date :message-id:reply-to; bh=RgjyiZ2fEAoAV8XjPSqmrd7pKj63Lr4KytXVmASxxAc=; b=hGXGIUwaL5HZ567t3rJ/hHN29qwFuFa45jhEWxpijgiqjQTi2yuRgudjVH21+OoVfo I1obWUPuAR+BEzN/DF+TtVpq5qrg/YHQawqV8u7Ha/tRBH043YbMUVjyEgucKdFXP4cN jvQ/dwWDMHG9wnWff9zOYPUzUgHgDwGalI/9g269JjFzNW06B/qprE/AIit3UsoyFIhy c5caQ03jhdHNUTge0IjTQy5x3xN4gAEfTmsYxKF5MuEJWTtoG4yK7Jou/QvtCkl1wtnQ doxwPpbGI77B2+IhJyg59ftn/52D6vmJlgZBZgW7MpqRVXVtN+CLDxVaN4D6UhIix3F+ V0xg== X-Gm-Message-State: AOJu0YzEH/wCJpyTgY+gKNocH04TjWUj1L9y+jSHmV2gEbnCfAp8u8c7 Syk74C9dHXk5M48NMTuZb4jxGurpGJVJoOperPjSG5lvOiPktVL4rK497w== X-Gm-Gg: ASbGncu0WP4ppC58mqMWC3p0crlpbV2qGTiBoSR5B4xD9iCFPixrpAyhWA/Vu2oGnku NGrzAabRfYPwl9YWshJ4VJMIrj1jrladYwX4PP25BwD0YF0eJX+fxoYjFei79fYKCJNUMq5UUQ6 143T+gAl/0BRnn4/d647/tJXitD+9zMeHmFyheGn4mEReNYRrbe6Ymzoa4KUa3Xdk4e1lZDqnJm 277AOSio59osnlNpruoW7dJsMpLTkvELmUG7Xt73AEC2T4= X-Google-Smtp-Source: AGHT+IFrmcR4Lwy7+Dc1gp9fTXPQfTqHU3d5ozDuzQB3mkjsB2QvyF2vUJm+jpPVix7sESLS8hdVTw== X-Received: by 2002:a05:6a00:2e19:b0:724:de1c:bac9 with SMTP id d2e1a72fcca58-725b813f7d8mr14874015b3a.13.1733705345750; Sun, 08 Dec 2024 16:49:05 -0800 (PST) Received: from terra ([2405:6586:be0:0:c8ff:1707:9b9:af89]) by smtp.gmail.com with ESMTPSA id d2e1a72fcca58-725df133a56sm2082684b3a.69.2024.12.08.16.49.04 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Sun, 08 Dec 2024 16:49:05 -0800 (PST) From: Maxim Cournoyer To: Tomas Volf <~@wolfsden.cz> Subject: Re: [bug#74508] [PATCH v3 1/3] services: mingetty: Add additional configuration options. In-Reply-To: <746975a119582d4dc85f1e5615d6b870a81164a9.1733184699.git.~@wolfsden.cz> (Tomas Volf's message of "Tue, 3 Dec 2024 01:11:37 +0100") References: <746975a119582d4dc85f1e5615d6b870a81164a9.1733184699.git.~@wolfsden.cz> Date: Mon, 09 Dec 2024 09:48:55 +0900 Message-ID: <874j3disug.fsf@gmail.com> User-Agent: Gnus/5.13 (Gnus v5.13) MIME-Version: 1.0 Content-Type: text/plain X-Spam-Score: 0.0 (/) X-Debbugs-Envelope-To: 74508 Cc: 74508@debbugs.gnu.org, Ludovic =?utf-8?Q?Court=C3=A8s?= X-BeenThere: debbugs-submit@debbugs.gnu.org X-Mailman-Version: 2.1.18 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: debbugs-submit-bounces@debbugs.gnu.org Sender: "Debbugs-submit" X-Spam-Score: -1.0 (-) Hi Tomas, Tomas Volf <~@wolfsden.cz> writes: > 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. These have been renamed now :-). Otherwise, LGTM. -- Thanks, Maxim From debbugs-submit-bounces@debbugs.gnu.org Fri Dec 13 11:28:26 2024 Received: (at 74508) by debbugs.gnu.org; 13 Dec 2024 16:28:26 +0000 Received: from localhost ([127.0.0.1]:43889 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1tM8Wf-0007Fl-I8 for submit@debbugs.gnu.org; Fri, 13 Dec 2024 11:28:26 -0500 Received: from wolfsden.cz ([37.205.8.62]:60118) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from <~@wolfsden.cz>) id 1tM8Wb-0007FT-Vq for 74508@debbugs.gnu.org; Fri, 13 Dec 2024 11:28:23 -0500 Received: by wolfsden.cz (Postfix, from userid 104) id 7980F35F362; 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=iuiSGSJt0mYYKBodxHE+EaJX7GkMoF4qaCgyYEb31bE=; h=From:To:Cc:Subject:Date:In-Reply-To:References; b=S0DE28du/1IJfBprBbOKX0iCGHVkaumrFUzoVTCJ3J9QhvRfeh9BU13vMcdgNM75V Ro+14qqznjTOtYw8eA1A6EsLf1GCLbmAsgvjDkd2m5yHJx5vmHDnjN196xC+SOCLyA plhddlLGGQBJcJh44uzABzFo/Umsd+ByK2jv8LdzGy/dIaN6wdUwdpMhFVPYYH2Ns3 EWmoDi0htns29mu2m7LxabT83lAn0csAxOR3h7sUZH6Hu67PN4f2gGvgr36eJt1jGj 5AlZIbLECYXOTW57nxVm9UjBxigyTqVich/PbaT8EeahH5FLsDxUO1yke/OYJsbIfz buiJl0cM5PrW9qVYZeG41lyDm9efT9YlxqkplOMr2mv9z1EXhBc4Yh22GOiGM7S5JO u5bcrzFTWGzJJTe7aWshMJeC5c02SFP+fxQMD12aACFJ2vO777P6sW0eqSXSESe4Lw hoJxrZ4tp0GYPoMRWXsfWaiorNTx14ITpvV2ArnhEIaB0rhW5p1LNdghqvJcC42xM+ Cv+/tQ2wlJap8ccmpi7B+95/ezCXbAmevkfpVXofGi7YCtfE5YVjNL3i6GBjsU76xt s8Araf8cvIhfYXRoXe2xH+AvUA73xXsBAVXx6gkfWDwILJPQIWMk//eUosNYVvoLar Hob1aqUuCv/DHZVdo2hdgt+c= X-Spam-Checker-Version: SpamAssassin 3.4.6 (2021-04-09) on wolfsden X-Spam-Level: X-Spam-Status: No, score=-3.1 required=5.0 tests=ALL_TRUSTED,BAYES_00, DKIM_SIGNED,DKIM_VALID,DKIM_VALID_AU,DKIM_VALID_EF,URIBL_BLOCKED autolearn=ham autolearn_force=no version=3.4.6 Received: from localhost (unknown [128.0.188.242]) by wolfsden.cz (Postfix) with ESMTPSA id 0850D36068D; 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=iuiSGSJt0mYYKBodxHE+EaJX7GkMoF4qaCgyYEb31bE=; h=From:To:Cc:Subject:Date:In-Reply-To:References; b=S0DE28du/1IJfBprBbOKX0iCGHVkaumrFUzoVTCJ3J9QhvRfeh9BU13vMcdgNM75V Ro+14qqznjTOtYw8eA1A6EsLf1GCLbmAsgvjDkd2m5yHJx5vmHDnjN196xC+SOCLyA plhddlLGGQBJcJh44uzABzFo/Umsd+ByK2jv8LdzGy/dIaN6wdUwdpMhFVPYYH2Ns3 EWmoDi0htns29mu2m7LxabT83lAn0csAxOR3h7sUZH6Hu67PN4f2gGvgr36eJt1jGj 5AlZIbLECYXOTW57nxVm9UjBxigyTqVich/PbaT8EeahH5FLsDxUO1yke/OYJsbIfz buiJl0cM5PrW9qVYZeG41lyDm9efT9YlxqkplOMr2mv9z1EXhBc4Yh22GOiGM7S5JO u5bcrzFTWGzJJTe7aWshMJeC5c02SFP+fxQMD12aACFJ2vO777P6sW0eqSXSESe4Lw hoJxrZ4tp0GYPoMRWXsfWaiorNTx14ITpvV2ArnhEIaB0rhW5p1LNdghqvJcC42xM+ Cv+/tQ2wlJap8ccmpi7B+95/ezCXbAmevkfpVXofGi7YCtfE5YVjNL3i6GBjsU76xt s8Araf8cvIhfYXRoXe2xH+AvUA73xXsBAVXx6gkfWDwILJPQIWMk//eUosNYVvoLar Hob1aqUuCv/DHZVdo2hdgt+c= From: Tomas Volf <~@wolfsden.cz> To: 74508@debbugs.gnu.org Subject: [PATCH v4 2/3] services: mingetty: Rename misnamed accessors. Date: Fri, 13 Dec 2024 17:27:45 +0100 Message-ID: <866c4043b1043ace21d5e77751923fad55e3d15c.1734107266.git.~@wolfsden.cz> X-Mailer: git-send-email 2.46.0 In-Reply-To: References: MIME-Version: 1.0 Content-Transfer-Encoding: 8bit X-Spam-Score: 0.0 (/) X-Debbugs-Envelope-To: 74508 Cc: Tomas Volf <~@wolfsden.cz> X-BeenThere: debbugs-submit@debbugs.gnu.org X-Mailman-Version: 2.1.18 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: debbugs-submit-bounces@debbugs.gnu.org Sender: "Debbugs-submit" X-Spam-Score: -1.0 (-) 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 --- gnu/services/base.scm | 10 +++++----- 1 file changed, 5 insertions(+), 5 deletions(-) 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)) -- 2.46.0 From debbugs-submit-bounces@debbugs.gnu.org Fri Dec 13 11:28:30 2024 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= X-Spam-Checker-Version: SpamAssassin 3.4.6 (2021-04-09) on wolfsden X-Spam-Level: X-Spam-Status: No, score=-3.1 required=5.0 tests=ALL_TRUSTED,BAYES_00, DKIM_SIGNED,DKIM_VALID,DKIM_VALID_AU,DKIM_VALID_EF,URIBL_BLOCKED autolearn=ham autolearn_force=no version=3.4.6 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> To: 74508@debbugs.gnu.org Subject: [PATCH v4 1/3] services: mingetty: Add additional configuration options. Date: Fri, 13 Dec 2024 17:27:44 +0100 Message-ID: X-Mailer: git-send-email 2.46.0 MIME-Version: 1.0 X-Debbugs-Cc: Ludovic Courtès , Maxim Cournoyer Content-Transfer-Encoding: 8bit X-Spam-Score: 0.0 (/) X-Debbugs-Envelope-To: 74508 Cc: Tomas Volf <~@wolfsden.cz> X-BeenThere: debbugs-submit@debbugs.gnu.org X-Mailman-Version: 2.1.18 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: debbugs-submit-bounces@debbugs.gnu.org Sender: "Debbugs-submit" X-Spam-Score: -1.0 (-) 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 From debbugs-submit-bounces@debbugs.gnu.org Fri Dec 13 11:28:32 2024 Received: (at 74508) by debbugs.gnu.org; 13 Dec 2024 16:28:32 +0000 Received: from localhost ([127.0.0.1]:43893 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1tM8Wk-0007G4-Uz for submit@debbugs.gnu.org; Fri, 13 Dec 2024 11:28:31 -0500 Received: from wolfsden.cz ([37.205.8.62]:60120) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from <~@wolfsden.cz>) id 1tM8Wc-0007FW-ME for 74508@debbugs.gnu.org; Fri, 13 Dec 2024 11:28:27 -0500 Received: by wolfsden.cz (Postfix, from userid 104) id 2522535FC64; Fri, 13 Dec 2024 16:28:22 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=wolfsden.cz; s=mail; t=1734107302; bh=ujmQFWGTh4LFjJPQPRoEjkSDmAXAVeyPSCdGrpHxKvw=; h=From:To:Cc:Subject:Date:In-Reply-To:References; b=IIyctqLtPfGQVGRTg0k0HlLUyej1/iXT9fIBBu8VEFFnZoEEKM0cmMpMSH8oCC67b bXCxU5MHF9+br/9VyBf5x9vfnwu5piHi2LwifLJTADx44RRbSaVlOe73ivSZcUkmAq g+Z/GVDp9BzbXLgcLDmTo2GE7XehzR3KJLRGkP/JHTH/foguGZ59/J7U5AVo+ZFnrx nHpcuoCyL8ysbBKiGX37hl33RSAMudxUfIHK73T0Ie3ffMobhRt1qgGetHKk1qrpCZ lH25fXyCZahFYDzOWcjgrnEBTk/NnD7nPtD5tdZJ9uipBepM4dQ64bYMC1NygiinSC kAgwYx5r7b6TND04jBjb4Z8wtEHBC/q3iSRqaf/BhZWXrbR99VvoqyKdLN8ntu2C2z 4tqOmQhSXxCyH2nl1BKtQ/4PcfYC7f9YSKAMEoEnfkxRfnAGGOShrLJghszYlaLdi2 LP0W1JFUEZY59FlU1+dwcNk8su7mARVTLkfmHi5GmOyJeICT0WH8aK0MNbb8qI6a78 qmeoLEjysnRrcFyF583HN3F7njmTre9U5pb5iYKTH1r9WvFsXydxgP0sz473Ggd9dx pK3tcE5swhvPQRoYV9nNv9E1rCad9IUKyxw9L4rqUQDF8ie4QPlOPlyNm5eYAYhZ1A 1ed6KBQx+ggVnB/gRBQuuJWI= X-Spam-Checker-Version: SpamAssassin 3.4.6 (2021-04-09) on wolfsden X-Spam-Level: X-Spam-Status: No, score=-3.1 required=5.0 tests=ALL_TRUSTED,BAYES_00, DKIM_SIGNED,DKIM_VALID,DKIM_VALID_AU,DKIM_VALID_EF,URIBL_BLOCKED autolearn=unavailable autolearn_force=no version=3.4.6 Received: from localhost (unknown [128.0.188.242]) by wolfsden.cz (Postfix) with ESMTPSA id 8AF9235F93F; 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=ujmQFWGTh4LFjJPQPRoEjkSDmAXAVeyPSCdGrpHxKvw=; h=From:To:Cc:Subject:Date:In-Reply-To:References; b=pcH9sIuSpzxtI3rFTShXugjNU6dLgv9/YMdWqSHyBWe2v1xgjnAyz6skjvLhwQB4n lWxdhL0swUA98Q8EMVWQfYFpG8mC2NNIRUMr/QoYcg/V+j5tTfbg5vNzEPDtekiSPl CDWGdE5ufgHFAS+xGj8mC54+QPHLQcftbpmcD1C16nqq4oFiu+4b+06psqEZwHbHka j5pa/q2Xtupb9n9CZ67I21O2H4beCZnkR7Nq6hcG/shvhUeyc6xKFUi5577rg+qHLU iMiycjWmgOY/w41WkI1V98QOj3Nc8wgzO8rGF3GddHJiIK6zHT5i4V/pu9W7RsTo3F yS2ccny43ywU5Tcb4bvAWhHdpW3jHxEmtv0IJQ1g0N6EzmgfKsqyfGlTxPtECZ7P/a vA2z3IZu4WwvHcBOby5/IzjBbMRzq9bDkmSHY70rFI0qCrxqGaF8Bd6RWh1fDTAwhU EEyAYKkgo4K4m1LxMYKh0uzlQuA1BaCdnwYXC1qnQFVUv9nw9gORrzTBdNEMp6qjYV xPMdamBX5OCt5R91M68VrL5qKfWGsqo8k/x93O/xVn3Yh2FCB9tewpUHgU4bmNTbPL oDPMo1zb5bwqKshOOFUFqiZgxkB+x7o/soI3GjldXTxXEDw/DAFyeV9ZegCuhz1CMj cy4++4VrvUDzAib/jj0PsGV0= From: Tomas Volf <~@wolfsden.cz> To: 74508@debbugs.gnu.org Subject: [PATCH v4 3/3] services: mingetty: Support waiting on shepherd services. Date: Fri, 13 Dec 2024 17:27:46 +0100 Message-ID: X-Mailer: git-send-email 2.46.0 In-Reply-To: References: MIME-Version: 1.0 X-Debbugs-Cc: Ludovic Courtès , Maxim Cournoyer Content-Transfer-Encoding: 8bit X-Spam-Score: 0.0 (/) X-Debbugs-Envelope-To: 74508 Cc: Tomas Volf <~@wolfsden.cz> X-BeenThere: debbugs-submit@debbugs.gnu.org X-Mailman-Version: 2.1.18 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: debbugs-submit-bounces@debbugs.gnu.org Sender: "Debbugs-submit" X-Spam-Score: -1.0 (-) 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 --- doc/guix.texi | 20 ++++++++++++++ gnu/services/base.scm | 61 +++++++++++++++++++++++-------------------- 2 files changed, 53 insertions(+), 28 deletions(-) diff --git a/doc/guix.texi b/doc/guix.texi index f5cd9461a3..5da0716fa7 100644 --- a/doc/guix.texi +++ b/doc/guix.texi @@ -19445,6 +19445,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") -- 2.46.0 From debbugs-submit-bounces@debbugs.gnu.org Sat Dec 14 10:41:10 2024 Received: (at 74508-done) by debbugs.gnu.org; 14 Dec 2024 15:41:10 +0000 Received: from localhost ([127.0.0.1]:48037 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1tMUGU-0008Kt-Gi for submit@debbugs.gnu.org; Sat, 14 Dec 2024 10:41:10 -0500 Received: from mail-pf1-f171.google.com ([209.85.210.171]:55666) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1tMUGS-0008KS-BB for 74508-done@debbugs.gnu.org; Sat, 14 Dec 2024 10:41:08 -0500 Received: by mail-pf1-f171.google.com with SMTP id d2e1a72fcca58-728f337a921so2881067b3a.3 for <74508-done@debbugs.gnu.org>; Sat, 14 Dec 2024 07:41:08 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20230601; t=1734190803; x=1734795603; darn=debbugs.gnu.org; h=mime-version:user-agent:message-id:date:references:in-reply-to :subject:cc:to:from:from:to:cc:subject:date:message-id:reply-to; bh=+buuWfnMgzYSSPGk3KmtPAtakGpX19jW1y6OrTO4SBA=; b=gbxbvWR+Eq5BWEmR8pVBg9QxpJRvbO/VxqNMrbrW93ZOEsZVc1IBXqndDkLACUOzIg NlfQKpiSvnAQ6txn7DhsUxQFulu+RAhiEhlhYi+Q9iP6slRc6qUJXe33LtfVwUkW4L+w 54fnge+GqUf9L+VGfYs6Pbm6UjXRGmWZ7K6WD6LGf/EmcOFMjSpvf3g4xuRpFRlWrOk8 R/ZYM1acMYxrwa1Of2mTEYpcVe16v8HN7rOqvT5jY5N4OL4yZCiRwqJ8PmUbrDi2rxes uxluIBNR90HVBt+RHUFLbgU6TzqoIhXhxajPC5XNthcVfLBOYbm8dckqXwzjVmrfl73u zSvA== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1734190803; x=1734795603; h=mime-version:user-agent:message-id:date:references:in-reply-to :subject:cc:to:from:x-gm-message-state:from:to:cc:subject:date :message-id:reply-to; bh=+buuWfnMgzYSSPGk3KmtPAtakGpX19jW1y6OrTO4SBA=; b=b9Y0LyL0rrGigHOyHaib1R4WM7daHpBgPuK5OKjXq5XbcoOFT10Mw+3TPKGCoagdWH 7+rb2K08d2i8CTPPIwoZyTewLspe4rczW4EiNc+P7gvYVH5/FMf67kzUBpKQ++IVBAAG rVn96vd8lxqGpkj67Rg9SdKl+grwONoqcRblRlx4Vkm8vH5kxg+B1waeybrv0XuDgv+r Bat0q+UWtkqFFdmtO+IoVy0lan+SxpGemKXbfFgUiCj1aQ8i722FHGQWLi7upgnyXUWf jPNRpb+hn4cblzLN6IWD/8Y16wAPiFGaST8r/EiUT6RlycbbvrWQ3Q2YHcA5GH7PCmvg 5i7w== X-Gm-Message-State: AOJu0Yxdh7+EMUYBHSsUV+9WyFL9oHrfXG+m8kgFIOrVDHBeCcHk+/PW jdz3AuXzPCJK9ZcFSRxzdNiYxLYuIiDJACoc9gmr/DaUjUfUSkxnxKRI6oKL X-Gm-Gg: ASbGncuaFGKO7v7QleSHnlmeFGsjslL0t3SEn+UErkrllih+vQ71dKNbYZiFCgY0yCE DYQZqYAXsw9lvfWjT1AOfyEA3zlIDATOpCg6Cmw/xeLatI/thWHzSdYR1axUSXuQyRIEHrkz8Jk ubZZJEVo+ukpO7P5BoGw7eYX4mJ6yTjjoy94u4Xm3mHPwfHiaQ4LFLTdZls0DYb/wh1DnswR9GD VpoeKYrpAQrb/KGqJbd3BzwIQRcx+dzWN6zTzPU2VSlxBlesh6pBA== X-Google-Smtp-Source: AGHT+IE+LcoGFKfXg1+iu9vftuSMvw2YJgoI6LZ9T62bd+rPQrk7DTjU3WUAawuHPLR3P0bjUd3x2A== X-Received: by 2002:a05:6a00:9084:b0:725:eb3e:22b7 with SMTP id d2e1a72fcca58-7290c29ac62mr9835228b3a.26.1734190802779; Sat, 14 Dec 2024 07:40:02 -0800 (PST) Received: from terra ([2405:6586:be0:0:c8ff:1707:9b9:af89]) by smtp.gmail.com with ESMTPSA id d2e1a72fcca58-72918bcde27sm1592103b3a.181.2024.12.14.07.40.01 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Sat, 14 Dec 2024 07:40:02 -0800 (PST) From: Maxim Cournoyer To: Tomas Volf <~@wolfsden.cz> Subject: Re: [bug#74508] [PATCH v4 1/3] services: mingetty: Add additional configuration options. In-Reply-To: (Tomas Volf's message of "Fri, 13 Dec 2024 17:27:44 +0100") References: Date: Sun, 15 Dec 2024 00:39:52 +0900 Message-ID: <87ldwi1dfb.fsf@gmail.com> User-Agent: Gnus/5.13 (Gnus v5.13) MIME-Version: 1.0 Content-Type: text/plain X-Spam-Score: 0.0 (/) X-Debbugs-Envelope-To: 74508-done Cc: Ludovic =?utf-8?Q?Court=C3=A8s?= , 74508-done@debbugs.gnu.org X-BeenThere: debbugs-submit@debbugs.gnu.org X-Mailman-Version: 2.1.18 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: debbugs-submit-bounces@debbugs.gnu.org Sender: "Debbugs-submit" X-Spam-Score: -1.0 (-) Hi, I've taken the freedom to reword some passages in the manual, and pushed to the master branch. Closing! -- Thanks, Maxim From unknown Mon Aug 18 14:24:55 2025 Received: (at fakecontrol) by fakecontrolmessage; To: internal_control@debbugs.gnu.org From: Debbugs Internal Request Subject: Internal Control Message-Id: bug archived. Date: Sun, 12 Jan 2025 12:24:05 +0000 User-Agent: Fakemail v42.6.9 # This is a fake control message. # # The action: # bug archived. thanks # This fakemail brought to you by your local debbugs # administrator