From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: from mp1.migadu.com ([2001:41d0:403:58f0::]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits)) by ms13.migadu.com with LMTPS id eCAVAvVgXGdl7QAA62LTzQ:P1 (envelope-from ) for ; Fri, 13 Dec 2024 16:29:41 +0000 Received: from aspmx1.migadu.com ([2001:41d0:403:58f0::]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits)) by mp1.migadu.com with LMTPS id eCAVAvVgXGdl7QAA62LTzQ (envelope-from ) for ; Fri, 13 Dec 2024 17:29:41 +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=HlmDnJPF; dkim=fail ("headers rsa verify failed") header.d=wolfsden.cz header.s=mail header.b=IIyctqLt; dkim=fail ("headers rsa verify failed") header.d=wolfsden.cz header.s=mail header.b=pcH9sIuS; spf=pass (aspmx1.migadu.com: domain of "guix-patches-bounces+larch=yhetil.org@gnu.org" designates 209.51.188.17 as permitted sender) smtp.mailfrom="guix-patches-bounces+larch=yhetil.org@gnu.org"; dmarc=fail reason="SPF not aligned (relaxed), DKIM not aligned (relaxed)" header.from=wolfsden.cz (policy=none) ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=yhetil.org; s=key1; t=1734107365; 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=V9ouBGDeYIOZmH6XYmvya7uGzZxgPd9Q033tmJR62gw=; b=mkL34UY/XTzYNgLozTPGV9A/+qNMtDjMnx/F8nLoktgUsavqre6bg/QqIqNghSGvDYH770 +L1Wte9B1+cIbE7r6AlU8CiT4ZPIu5tJ36di0JK7xoxFV898gX6+8+Mwb4oYwq+1Q/3Qk/ 75tIUcczRaCtc5xV8euVJd4ZZoP/x5uPKRiYrREY31Qh3yxeeeZrAMY8gw3VhKmSHbGTrE S1jXjy22SYj7jQTAefActvP2QmtP+948LcZpa9PWOqZ12dtKDxVrqzKTiX+IMD1qZJXBj8 ecpblGOrREJfEwnEDdWejIezTZgMtPRa52VvTZGFyHBx2lJYSpl4NIT/AzDEEg== ARC-Authentication-Results: i=1; aspmx1.migadu.com; dkim=pass header.d=debbugs.gnu.org header.s=debbugs-gnu-org header.b=HlmDnJPF; dkim=fail ("headers rsa verify failed") header.d=wolfsden.cz header.s=mail header.b=IIyctqLt; dkim=fail ("headers rsa verify failed") header.d=wolfsden.cz header.s=mail header.b=pcH9sIuS; spf=pass (aspmx1.migadu.com: domain of "guix-patches-bounces+larch=yhetil.org@gnu.org" designates 209.51.188.17 as permitted sender) smtp.mailfrom="guix-patches-bounces+larch=yhetil.org@gnu.org"; dmarc=fail reason="SPF not aligned (relaxed), DKIM not aligned (relaxed)" header.from=wolfsden.cz (policy=none) ARC-Seal: i=1; s=key1; d=yhetil.org; t=1734107365; a=rsa-sha256; cv=none; b=Y7Jel/rg++E9tIroov6/5iDWpLkQXVVGOTehgzGelRtM6D0w0Ku2V+yqNZ2MLgq2rpIFhl Fdb1u29RGvDQBX13EEe4TpTZX3KOqasvrP5e5p8e8YJiRJv21fOQ2iS7h+AwTDiFg1MGhS gIRR+gsz9Hz3/7fqJXvrc3VQldgx8GUxm2Az5s4flWHDVUESF7ykb3VpVdSs1mLJylFrLD axEYnhyqNKJ1kwbttyFcE13B5ij9N7WuEsFw2w0nZRjahtR3tC4k6uvm4eY9TzbcsCFokU 0Xw25j3N218PZhffwrStcPp9JT0ybT7Q3lIeUsPwFvlPU/ug+95LU5KQSaFmhQ== 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 1558C8B27D for ; Fri, 13 Dec 2024 17:29:24 +0100 (CET) Received: from localhost ([::1] helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1tM8XL-000373-DQ; Fri, 13 Dec 2024 11:29:07 -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 1tM8XI-00035q-UK for guix-patches@gnu.org; Fri, 13 Dec 2024 11:29:04 -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 1tM8XH-000357-R0; Fri, 13 Dec 2024 11:29: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=V9ouBGDeYIOZmH6XYmvya7uGzZxgPd9Q033tmJR62gw=; b=HlmDnJPFjMfTH6HTYe34eBOjbRlsyBnVnmZk5nBBLOxYUlxu+EXB6ZJRK9hFwijYQI1lJcW4qzWy2hE7FULHhZ8mRH87sbYr4T8y9qjawLPB3eGq0Y7kTe50K5P3wEc7AutpTerSWo5meBpnTJtlYs0++FDZnqGAnCBNKngBF7oq+gWner+y9qN1sQi3ZIAap1TaS1r529blRNOReIf52RMh+Onje1ZoVHjJekub8P8bODOOTQLVKRyLidVGcmxG1P/HxTPWsjtA+LmTreAKcFcZCs6+uCdrmY/z7mUrcDDGmfAZvJkev/pFIqRWStoM6OAi4niXrpgZES3jqbfEeg==; Received: from Debian-debbugs by debbugs.gnu.org with local (Exim 4.84_2) (envelope-from ) id 1tM8XH-0007HE-KI; Fri, 13 Dec 2024 11:29:03 -0500 X-Loop: help-debbugs@gnu.org Subject: [bug#74508] [PATCH v4 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: Fri, 13 Dec 2024 16:29:03 +0000 Resent-Message-ID: Resent-Sender: help-debbugs@gnu.org X-GNU-PR-Message: followup 74508 X-GNU-PR-Package: guix-patches X-GNU-PR-Keywords: patch To: 74508@debbugs.gnu.org Cc: Tomas Volf <~@wolfsden.cz>, Ludovic =?UTF-8?Q?Court=C3=A8s?= , Maxim Cournoyer X-Debbugs-Original-Xcc: Ludovic =?UTF-8?Q?Court=C3=A8s?= , Maxim Cournoyer Received: via spool by 74508-submit@debbugs.gnu.org id=B74508.173410731227915 (code B ref 74508); Fri, 13 Dec 2024 16:29:03 +0000 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= 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> 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 Content-Transfer-Encoding: 8bit X-BeenThere: debbugs-submit@debbugs.gnu.org X-Mailman-Version: 2.1.18 Precedence: list X-BeenThere: guix-patches@gnu.org List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: guix-patches-bounces+larch=yhetil.org@gnu.org Sender: guix-patches-bounces+larch=yhetil.org@gnu.org X-Migadu-Country: US X-Migadu-Flow: FLOW_IN X-Migadu-Scanner: mx11.migadu.com X-Migadu-Spam-Score: 4.71 X-Spam-Score: 4.71 X-Migadu-Queue-Id: 1558C8B27D X-TUID: 8EC/s0GglZcF 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