From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: from mp2.migadu.com ([2001:41d0:403:4876::]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits)) by ms13.migadu.com with LMTPS id cGQvODg5Q2cmeAAAe85BDQ:P1 (envelope-from ) for ; Sun, 24 Nov 2024 14:33:29 +0000 Received: from aspmx1.migadu.com ([2001:41d0:403:4876::]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits)) by mp2.migadu.com with LMTPS id cGQvODg5Q2cmeAAAe85BDQ (envelope-from ) for ; Sun, 24 Nov 2024 15:33:29 +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=Stdil1gc; dkim=fail ("headers rsa verify failed") header.d=wolfsden.cz header.s=mail header.b=RWPpiHDu; dkim=fail ("headers rsa verify failed") header.d=wolfsden.cz header.s=mail header.b=RWPpiHDu; 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=1732458808; a=rsa-sha256; cv=none; b=KG0FJ4RhkYgB4lvF0wCjE8FgKnMirfJoFBx0XuagVSxtTlBVDknZC0v09P7BbyNpn0rSuu uEj4VS8f1JC9mWA6GtTNYcG719GdzhNxg42vF+OCE2ovm12fa7wZa+DpVLCy/At0Xfsmv5 dvQmMRcTuzd8IdlDYhdQJysDe1pemwm9u6POgauiv3vlsoBxViryexJcoFraE9+t2jnChI TcyarsDJEq1zN5NMMZW8N79veEzcbIGFdzHSlTsM64/Y3W1lilHZgsJ975Am6dQQxjKRa8 NZTgG7cFl2zHfwFRJSFWP+oSGSffRK8oKCKYbWSAlTYrXSfvvu2kExVc3pSBSg== ARC-Authentication-Results: i=1; aspmx1.migadu.com; dkim=pass header.d=debbugs.gnu.org header.s=debbugs-gnu-org header.b=Stdil1gc; dkim=fail ("headers rsa verify failed") header.d=wolfsden.cz header.s=mail header.b=RWPpiHDu; dkim=fail ("headers rsa verify failed") header.d=wolfsden.cz header.s=mail header.b=RWPpiHDu; 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=1732458808; 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=N7/oElrX8kblVnAkpSVX7JWACAA5SU580dIM/Odw/tY=; b=T9js4JIVn2Xh5uHhvdmloStZcy2Dy3ZWPCgTA1YP+KjPsEZqIHc4LY3Djotq2AnoS+cte6 DjmoXuIVCDpRrYCZTjiu6h7TlL7zZQe6gvUcQgBnZBXHTrclxsmGjD9HXNj9d+4CzoP0yw dudnlktZVMWqE6GLIBaOkZNO7fhXaJZywsvZ+9JtYRCuaUnv8sYp4rvxa75idCUQnvhlP/ oMf5vb5EOz/VcoDkUealEk7BdtdPV7X2Fwg1+B7aqf/F1akX7K4/+ebWjLbfbWHrcUdvrN oJpXpSe1myS2IBRKy+pEW6IQtAoojMkpxeohvYcqNLiVeAWqIlFAz3NSU07ONQ== 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 741867BF99 for ; Sun, 24 Nov 2024 15:33:28 +0100 (CET) Received: from localhost ([::1] helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1tFDff-0003Yd-Lr; Sun, 24 Nov 2024 09:33: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 1tFDfd-0003Y3-Ig for guix-patches@gnu.org; Sun, 24 Nov 2024 09:33:05 -0500 Received: from debbugs.gnu.org ([2001:470:142:5::43]) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_128_GCM_SHA256:128) (Exim 4.90_1) (envelope-from ) id 1tFDfc-0003zk-6a; Sun, 24 Nov 2024 09:33:05 -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=N7/oElrX8kblVnAkpSVX7JWACAA5SU580dIM/Odw/tY=; b=Stdil1gcSLPmAu/yC7E6U7B3pW4s0hO9vtfQHBkMckgJHx1M+H1FLhUODM1mrOJ06brx3cc2H7enZWZM8FhsbuAjenXVJV/6yFQ+wEgNaPZ5Mabf53zs4BCRzqaIDA/H8AcmwdLWEj3H7U0ocQjf/wkZ1QpcnHG+SvozhP6yyXBWZaUWZXAyWUt3wzAeF8gtd9Ooqr4y8OE+EnqL9dshhS87lZ++24RPQj7TTXFgto2jYGqnEbKjGtgiW6PSLQ0hILcQKyHbeiACz0VS98CuGKoki+vE2QO1153E8FFSAYd+xym8rKhTeT45hWBayjS4JFRARHOdsG6MIX3FTcBRkQ==; Received: from Debian-debbugs by debbugs.gnu.org with local (Exim 4.84_2) (envelope-from ) id 1tFDfc-0007zD-0J; Sun, 24 Nov 2024 09:33:04 -0500 X-Loop: help-debbugs@gnu.org Subject: [bug#74508] [PATCH 2/2] 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: Sun, 24 Nov 2024 14:33: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.173245873430564 (code B ref 74508); Sun, 24 Nov 2024 14:33:03 +0000 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= 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> 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 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-Spam-Score: -1.39 X-Spam-Score: -1.39 X-Migadu-Queue-Id: 741867BF99 X-Migadu-Scanner: mx10.migadu.com X-TUID: jAVe/QEGDkgN 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