From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: from mp0.migadu.com ([2001:41d0:303:e16b::]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits)) by ms13.migadu.com with LMTPS id mFMVIhKhRGcObwAAqHPOHw:P1 (envelope-from ) for ; Mon, 25 Nov 2024 16:08:50 +0000 Received: from aspmx1.migadu.com ([2001:41d0:303:e16b::]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits)) by mp0.migadu.com with LMTPS id mFMVIhKhRGcObwAAqHPOHw (envelope-from ) for ; Mon, 25 Nov 2024 17:08:50 +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=FM5PnAkR; dkim=fail ("headers rsa verify failed") header.d=wolfsden.cz header.s=mail header.b="Kvzx/jVM"; dkim=fail ("headers rsa verify failed") header.d=wolfsden.cz header.s=mail header.b=nV5InPlj; 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=1732550929; a=rsa-sha256; cv=none; b=P5K/4A1Ej+wWgfcikP2/mtmtV+YX5M2C1fC6l1IjIQX9CZ+k+xxh8obeFA0X8qMb1ypad5 /sV8hxVIJJX1TPdJwvwy9qC2SFb0J2STYWoz2arbMltS7D6UZR5gzrG03m5AabLHF0Qc4a EdXSZh78ls0CibySS3al7tZZiMpO2qplTmy8pMzMXgb/lZJ+Avb0QUvtkNVy05OXf4ZENn 4Vuum79EFnt/UaQdooxtnkbx5XUMa+24LL799oLv/vgPvKTbaNQ/QW/iMCmiY5dstNAYx3 Z6x32zsnIxByUFS4fxc1vFIvI0ow+lfncX4Q2pIukABa/B90taM5iTZlgqWWwA== ARC-Authentication-Results: i=1; aspmx1.migadu.com; dkim=pass header.d=debbugs.gnu.org header.s=debbugs-gnu-org header.b=FM5PnAkR; dkim=fail ("headers rsa verify failed") header.d=wolfsden.cz header.s=mail header.b="Kvzx/jVM"; dkim=fail ("headers rsa verify failed") header.d=wolfsden.cz header.s=mail header.b=nV5InPlj; 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=1732550929; 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=jAM0zHZ0c2cMVZB/+sBxLs9jTUX4ff3cHlUCF6KywZs=; b=eR28GTVffjtAxA8mApNTv+8Cc+THRw7YfAf4RIzduhHYYN1r/Rq+dm+JTY+i9rVnq4SSOd CLemZtTvh8aU4hLoSg/tO53pt6UOrOITGQOMveA8g/UZDJJQgwKEo8Pkk0Bz9tM/8CvkLG V8UCJRpG97Up9LV5YjRbyXi9IGTfQaQhiM/Betzo9x2z0g97XSqDB/nPXi50QWVtGxEtXM X26j14hlKrXrCgMosQehLvBS/n+cp7cmL9pkuT1adl4D50cyo7Kj7GaUw1KtuAZ4kf0VtE gGQ2UikRC1WLQCPlRdmZ0Sr8xyGy59gY8G83gPusnIT4mPYdONgqiFxpD76Avg== 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 526D1572E5 for ; Mon, 25 Nov 2024 17:08:49 +0100 (CET) Received: from localhost ([::1] helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1tFbdD-0004P0-6M; Mon, 25 Nov 2024 11:08:11 -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 1tFbd6-0004ON-9L for guix-patches@gnu.org; Mon, 25 Nov 2024 11:08: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 1tFbd5-0000Nb-6H; Mon, 25 Nov 2024 11:08: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=jAM0zHZ0c2cMVZB/+sBxLs9jTUX4ff3cHlUCF6KywZs=; b=FM5PnAkRef7r0EJd+nUfveOVWUwp3b6/L35kvAp/7g8bHnN41dHlFYdQZ5lpp5BfQN/qH4/hWib+UshTx6trESLu15ve3uN6uMO1JSLE0i9jRGErMvVy5sp7ENZiwjpgxXywGBLBea02ktgHQbzyJy4bAsMRnv2/7toDwTRAUnK17SrjXoFmZqr19ZCs2ctuVIDQSueyQnZkU+BP8wvV35+v4Zp4fuNni1r/bbXS//7ZxgQ2WF5BHYdmnC8w/YIEWCn+MwH2BMdVT+q7qvsPXweT6mL8Y4J+YIPhjAjo4zt+pPvnFI1yOs0Nj5rdeAaCbXts0JS8fjHwjkri2cvEBQ==; Received: from Debian-debbugs by debbugs.gnu.org with local (Exim 4.84_2) (envelope-from ) id 1tFbd4-0007An-Vv; Mon, 25 Nov 2024 11:08:03 -0500 X-Loop: help-debbugs@gnu.org Subject: [bug#74508] [PATCH v2 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: Mon, 25 Nov 2024 16:08: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.173255085327514 (code B ref 74508); Mon, 25 Nov 2024 16:08:02 +0000 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= 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> 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 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-Queue-Id: 526D1572E5 X-Migadu-Scanner: mx13.migadu.com X-Migadu-Spam-Score: -3.01 X-Spam-Score: -3.01 X-TUID: /6g8vN6gtw8j 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