From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: from mp1.migadu.com ([2001:41d0:303:e224::]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits)) by ms13.migadu.com with LMTPS id EO/uNK5NTmcUOQEA62LTzQ:P1 (envelope-from ) for ; Tue, 03 Dec 2024 00:15:43 +0000 Received: from aspmx1.migadu.com ([2001:41d0:303:e224::]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits)) by mp1.migadu.com with LMTPS id EO/uNK5NTmcUOQEA62LTzQ (envelope-from ) for ; Tue, 03 Dec 2024 01:15:42 +0100 X-Envelope-To: larch@yhetil.org Authentication-Results: aspmx1.migadu.com; dkim=pass header.d=debbugs.gnu.org header.s=debbugs-gnu-org header.b=Wn+1UVFK; dkim=fail ("headers rsa verify failed") header.d=wolfsden.cz header.s=mail header.b="My0KLQ/s"; dkim=fail ("headers rsa verify failed") header.d=wolfsden.cz header.s=mail header.b=uyZL+pvp; dmarc=fail reason="SPF not aligned (relaxed), DKIM not aligned (relaxed)" header.from=wolfsden.cz (policy=none); spf=pass (aspmx1.migadu.com: domain of "guix-patches-bounces+larch=yhetil.org@gnu.org" designates 209.51.188.17 as permitted sender) smtp.mailfrom="guix-patches-bounces+larch=yhetil.org@gnu.org" ARC-Seal: i=1; s=key1; d=yhetil.org; t=1733184942; a=rsa-sha256; cv=none; b=ue9SWSg1geFH5b76G+UhDi6DWCXWps/pWztM4L0PblhViB/fYOW5mhrKUVsjnDmf5pzXD3 Pxd51e3hRHxflCUR3m2cQGeOHaPy9f6lkIBn3J2ctp/Mw50OqAY4bEnJPj0hoZcCWO65NO ltgj1vHZezd67773wYpewwkVvR0CANbnTHWUHWNuyTcUa+SsoCP54ibWRUEr5Nmw4Efcd/ cnNDp6JE3L//XUYDbfVs+OsXQe4YMSUyvTxtLHNPKWteQSgFxvAKE41URoJKVUgsZ16W4o hs0eYA3oWbSkeJeHgal59KFCvlpYnZh1SyfDAW3vy77KgjG5b6ukod6phVn13Q== ARC-Authentication-Results: i=1; aspmx1.migadu.com; dkim=pass header.d=debbugs.gnu.org header.s=debbugs-gnu-org header.b=Wn+1UVFK; dkim=fail ("headers rsa verify failed") header.d=wolfsden.cz header.s=mail header.b="My0KLQ/s"; dkim=fail ("headers rsa verify failed") header.d=wolfsden.cz header.s=mail header.b=uyZL+pvp; dmarc=fail reason="SPF not aligned (relaxed), DKIM not aligned (relaxed)" header.from=wolfsden.cz (policy=none); spf=pass (aspmx1.migadu.com: domain of "guix-patches-bounces+larch=yhetil.org@gnu.org" designates 209.51.188.17 as permitted sender) smtp.mailfrom="guix-patches-bounces+larch=yhetil.org@gnu.org" ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=yhetil.org; s=key1; t=1733184942; h=from:from:sender:sender:reply-to:subject:subject:date:date: message-id:message-id:to:to:cc:cc:mime-version:mime-version: content-transfer-encoding:content-transfer-encoding:resent-cc: resent-from:resent-sender:resent-message-id:in-reply-to:in-reply-to: references:references:list-id:list-help:list-unsubscribe: list-subscribe:list-post:dkim-signature; bh=cu5XkxN6ksonmZs1dQQfzz+xacLbDbSuji3msUuOTg8=; b=u/0ouhiE/gBLxE0icf8qgIBMSXXZNQ5TKf9OyyKjST4G31PU1l726SWtvnz8jnoqEqVsWk yhBKptJQY8rp+Pss0HbQd0WIbD+q0Nf5CzDlUtfTmwZkQdVunfFonnwLSkoHNU6iVttptd vDjbOqapIx1JRXqCZ4kzdk6Bp2CsT3Ftml8QnyoA4lyQk0B/mFNcof2kjpZEmhBBMxXllQ BGF0jx6IuuiaL3ZQQqYU3pTfmS/0ZwGghK67yD2+YN8W1KNXoI9QK2zODKZWTq0IAvtZ6W FpTvSZLcOJXCol2C+cUnrg69n0ooOaALldt1Dci1wsXOfwCR19pttHoTqEB1nw== Received: from lists.gnu.org (lists.gnu.org [209.51.188.17]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by aspmx1.migadu.com (Postfix) with ESMTPS id 90B8C37166 for ; Tue, 03 Dec 2024 01:15:42 +0100 (CET) Received: from localhost ([::1] helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1tIGZF-0003M2-QW; Mon, 02 Dec 2024 19:15:05 -0500 Received: from eggs.gnu.org ([2001:470:142:3::10]) by lists.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1tIGZD-0003LV-L7 for guix-patches@gnu.org; Mon, 02 Dec 2024 19:15:03 -0500 Received: from debbugs.gnu.org ([2001:470:142:5::43]) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_128_GCM_SHA256:128) (Exim 4.90_1) (envelope-from ) id 1tIGZD-0002gh-5l; Mon, 02 Dec 2024 19:15:03 -0500 DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=debbugs.gnu.org; s=debbugs-gnu-org; h=MIME-Version:References:In-Reply-To:Date:From:To:Subject; bh=cu5XkxN6ksonmZs1dQQfzz+xacLbDbSuji3msUuOTg8=; b=Wn+1UVFKzkYipqlaAuBDECBxjXiFK9DyHoGQHXTQx8/7VmdgsIOXkeDnbalCGydTYcH3/Vtb7oSIn2L0vddI0VZiM2ECVnQwxWaxRvizxoySwI4UWwrvZCVNhwosto5jbJ6w8CY75B2PQ+e8aFEneK2nTgmxiVpYltOKMUvhsz6bVJjvfCyjX1t1JHRWSViiQVHvmVQFroDa1jLpcJVBrk6f+O5IaHiE0TDEizyvpsUkBx8kl/Pq7V9CGSni2eTO+r1q5xrKYupXMAmNqDfwxZt0TAI12TslTaCG57u9ce1qK4M64D3E6PNhCZbDD/pmTIfSsF8HXciNvOX3gR+trw==; Received: from Debian-debbugs by debbugs.gnu.org with local (Exim 4.84_2) (envelope-from ) id 1tIGZD-0000OD-06; Mon, 02 Dec 2024 19:15:03 -0500 X-Loop: help-debbugs@gnu.org Subject: [bug#74508] [PATCH v3 3/3] services: mingetty: Support waiting on shepherd services. Resent-From: Tomas Volf <~@wolfsden.cz> Original-Sender: "Debbugs-submit" Resent-CC: ludo@gnu.org, maxim.cournoyer@gmail.com, guix-patches@gnu.org Resent-Date: Tue, 03 Dec 2024 00:15:02 +0000 Resent-Message-ID: Resent-Sender: help-debbugs@gnu.org X-GNU-PR-Message: followup 74508 X-GNU-PR-Package: guix-patches X-GNU-PR-Keywords: patch To: 74508@debbugs.gnu.org Cc: Tomas Volf <~@wolfsden.cz>, Ludovic =?UTF-8?Q?Court=C3=A8s?= , Maxim Cournoyer X-Debbugs-Original-Xcc: Ludovic =?UTF-8?Q?Court=C3=A8s?= , Maxim Cournoyer Received: via spool by 74508-submit@debbugs.gnu.org id=B74508.17331848911439 (code B ref 74508); Tue, 03 Dec 2024 00:15:02 +0000 Received: (at 74508) by debbugs.gnu.org; 3 Dec 2024 00:14:51 +0000 Received: from localhost ([127.0.0.1]:57060 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1tIGZ0-0000N3-Uj for submit@debbugs.gnu.org; Mon, 02 Dec 2024 19:14:51 -0500 Received: from wolfsden.cz ([37.205.8.62]:50602) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from <~@wolfsden.cz>) id 1tIGYx-0000MU-4S for 74508@debbugs.gnu.org; Mon, 02 Dec 2024 19:14:47 -0500 Received: by wolfsden.cz (Postfix, from userid 104) id 8D23C338295; Tue, 3 Dec 2024 00:14:46 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=wolfsden.cz; s=mail; t=1733184886; bh=Z9yxeQ+XVj0NzNY3pQQ25fJrmdBIClfSQ7HAYWzaPHI=; h=From:To:Cc:Subject:Date:In-Reply-To:References; b=My0KLQ/sX/606YCEBXYOkxtRBSMs08l7gvN9CkLbqU5MuN1ACx8+dEol406eWBybi dN/xCWcRrSRc8/0RAgogz80S7rWPWQPC+w9F1gpbDzg74u02dd88I7iddqllrPRaHg pJksMfO/9od/1pCJspI5r/Hp9MKEB75K1bxSO9tjo9G7QV+/jxtlsZBBVyxUw7SAJG h6EiNAxdyLgJS5xiCpgoSTjeg+ZXO4412/+/AE1XGgih2uVIT9TILSh6NiYX6a28dn Fvh9/n6MqvWDpHDmbKm9HqRZI9cFFTY3ILkAAvGNJqGZ9Wnv85A9vtR3l/xdeHMJ23 ump5mdyoMwZyPZ+ErKUvXpM4ug/Dxo7VsE7iAkCvmLjlGmyTmgbxKO+t204cazhSfV R+MQ2UKlJCuQfrKBFMkr6UgrcAHMOubVdX0BqBQ8qNmD5UQAWmICwUgO59A3LVi/0J iV4Pb1So78gmYKL0NQxqY28bqLY5D61pA2B8ANhU1MtXpD3RTufi7XzymTINo3iOCq rg9nmADqHZFBGvhv6VgmcFvK3pPIAdFu5p6Ejcv3c1t5QJngEaxh6b05n0vPvXjmAv cliIwdSqKkK1juFB17SJGmEzqvITSM/ZlXRtPeK8n75HgZAnZy0n0qDzQg1iiop5o7 QJYfGmjR1mlSOyZoQg3MSucc= Received: from localhost (unknown [128.0.188.242]) by wolfsden.cz (Postfix) with ESMTPSA id CDCAD32697F; Tue, 3 Dec 2024 00:14:44 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=wolfsden.cz; s=mail; t=1733184884; bh=Z9yxeQ+XVj0NzNY3pQQ25fJrmdBIClfSQ7HAYWzaPHI=; h=From:To:Cc:Subject:Date:In-Reply-To:References; b=uyZL+pvp8HhUbgBnVGz8GE67XZRNxOs4iurcbLvomZrOW9SM4rEGggNgdmoQqQz2T DWe71TQjRF34lYxBFqbs5tHckGEeUWKcDUI1aWCz8rIuBALjS3hXtIRpuOaL96ZgGd ZwM7An7tb4rEkYoEHC4v5B/TelqnEhf1Lwo69jtT7JpWMUlhiq3dA2LsmYqnwmvHzd oG9z2RDmpQn7topivOph8sgrV8vE5HwPIuC59yqHoEmUERI170A5BF0Uv48CHwdvNy vel2nmRGjqSTOMuRPdmqmp2X25xneQRxQSuhpUOHAjZLubu657KliQwwckNQbIppHK FCkn3vtR2HrdGad2Xlv1KhLivcSQELxtoioPrL1THtxTK8OiAjoGChfmVrBQIgbh2D z1ZcDPtvZN/r8/RnkNxp9+MuO9KeRWC1pa3htYoBoKFBNxDAcT6SQr5OUthlMfzaWQ E2mGqP4piW3uLVFL/UlJy1FZc+BCS++jVlVs7EoIQdAuOz0dFLxqREaeOKFyznP/Ti sJCRVuQeIYD4L6cc6VI+GwfJdT5KpoAB85Rp0PQRFro/wRk7RgPe6OyahxBV7OIs+t +Pha2Bx+sngL+09R+zC33n2YCL5YDiQH5EkWN5ysVyy1jvDMq5UITZv9YxgGfZmc3y i5qkl0MWVyAWlrXvlQjxSsH0= From: Tomas Volf <~@wolfsden.cz> Date: Tue, 3 Dec 2024 01:11:39 +0100 Message-ID: <09f772e45032200dd462ecb54b39c97ddb3301d6.1733184699.git.~@wolfsden.cz> X-Mailer: git-send-email 2.46.0 In-Reply-To: <746975a119582d4dc85f1e5615d6b870a81164a9.1733184699.git.~@wolfsden.cz> References: <746975a119582d4dc85f1e5615d6b870a81164a9.1733184699.git.~@wolfsden.cz> MIME-Version: 1.0 Content-Transfer-Encoding: 8bit X-BeenThere: debbugs-submit@debbugs.gnu.org X-Mailman-Version: 2.1.18 Precedence: list X-BeenThere: guix-patches@gnu.org List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: guix-patches-bounces+larch=yhetil.org@gnu.org Sender: guix-patches-bounces+larch=yhetil.org@gnu.org X-Migadu-Flow: FLOW_IN X-Migadu-Country: US X-Migadu-Spam-Score: -1.41 X-Spam-Score: -1.41 X-Migadu-Queue-Id: 90B8C37166 X-Migadu-Scanner: mx12.migadu.com X-TUID: e8FZzPS8QJ+E 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