From e92b20a41a026b8af7dd2031eb61267b061617b5 Mon Sep 17 00:00:00 2001 From: Tomas Volf <~@wolfsden.cz> Date: Fri, 13 Dec 2024 17:27:46 +0100 Subject: services: mingetty: Support waiting on shepherd services. 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 Modified-by: Maxim Cournoyer Signed-off-by: Maxim Cournoyer --- gnu/services/base.scm | 61 ++++++++++++++++++++++++++++----------------------- 1 file changed, 33 insertions(+), 28 deletions(-) (limited to 'gnu') diff --git a/gnu/services/base.scm b/gnu/services/base.scm index 7350425bb9..766371ecf1 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") -- cgit v1.2.3