From: Tomas Volf <~@wolfsden.cz>
To: 74508@debbugs.gnu.org
Cc: "Tomas Volf" <~@wolfsden.cz>, "Ludovic Courtès" <ludo@gnu.org>,
"Maxim Cournoyer" <maxim.cournoyer@gmail.com>
Subject: [bug#74508] [PATCH v3 3/3] services: mingetty: Support waiting on shepherd services.
Date: Tue, 3 Dec 2024 01:11:39 +0100 [thread overview]
Message-ID: <09f772e45032200dd462ecb54b39c97ddb3301d6.1733184699.git.~@wolfsden.cz> (raw)
In-Reply-To: <746975a119582d4dc85f1e5615d6b870a81164a9.1733184699.git.~@wolfsden.cz>
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 (<mingetty-configuration>): Add shepherd-requirement
field.
(mingetty-shepherd-service): Use it.
* doc/guix.texi (Base Services)<mingetty-configuration>: 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>
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-configuration>
( 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
prev parent reply other threads:[~2024-12-03 0:15 UTC|newest]
Thread overview: 14+ messages / expand[flat|nested] mbox.gz Atom feed top
2024-11-24 14:28 [bug#74508] [PATCH 0/2] Improvements for mingetty-service-type Tomas Volf
2024-11-24 14:31 ` [bug#74508] [PATCH 1/2] services: mingetty: Add additional configuration options Tomas Volf
2024-11-25 1:45 ` Maxim Cournoyer
2024-11-25 15:37 ` Tomas Volf
2024-11-24 14:31 ` [bug#74508] [PATCH 2/2] services: mingetty: Support waiting on shepherd services Tomas Volf
2024-11-25 1:49 ` Maxim Cournoyer
2024-11-25 16:05 ` [bug#74508] [PATCH v2 1/3] services: mingetty: Add additional configuration options Tomas Volf
2024-11-25 16:05 ` [bug#74508] [PATCH v2 2/3] services: mingetty: Rename misnamed accessors Tomas Volf
2024-11-25 16:05 ` [bug#74508] [PATCH v2 3/3] services: mingetty: Support waiting on shepherd services Tomas Volf
2024-12-02 11:05 ` [bug#74508] [PATCH v2 1/3] services: mingetty: Add additional configuration options Ludovic Courtès
2024-12-03 0:18 ` Tomas Volf
2024-12-03 0:11 ` [bug#74508] [PATCH v3 " Tomas Volf
2024-12-03 0:11 ` [bug#74508] [PATCH v3 2/3] services: mingetty: Rename misnamed accessors Tomas Volf
2024-12-03 0:11 ` Tomas Volf [this message]
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
List information: https://guix.gnu.org/
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to='09f772e45032200dd462ecb54b39c97ddb3301d6.1733184699.git.~@wolfsden.cz' \
--to=~@wolfsden.cz \
--cc=74508@debbugs.gnu.org \
--cc=ludo@gnu.org \
--cc=maxim.cournoyer@gmail.com \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
Code repositories for project(s) associated with this public inbox
https://git.savannah.gnu.org/cgit/guix.git
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for read-only IMAP folder(s) and NNTP newsgroup(s).