all messages for Guix-related lists mirrored at yhetil.org
 help / color / mirror / code / Atom feed
From: Danny Milosavljevic <dannym@scratchpost.org>
To: 30464@debbugs.gnu.org
Subject: [bug#30464] [PATCH 1/2] services: Add console-agetty-service.
Date: Thu, 15 Feb 2018 12:47:41 +0100	[thread overview]
Message-ID: <20180215114742.663-1-dannym@scratchpost.org> (raw)
In-Reply-To: <20180215114256.551-1-dannym@scratchpost.org>

* gnu/services/base.scm (<agetty-configuration>): Make tty default to #f.
(console-agetty-shepherd-service): New variable.
(console-agetty-service-type): New variable.
(console-agetty-service): New variable.
(%base-services): Replace agetty-service instance by console-agetty-service
instance.
---
 gnu/services/base.scm | 35 ++++++++++++++++++++++++++++++-----
 1 file changed, 30 insertions(+), 5 deletions(-)

diff --git a/gnu/services/base.scm b/gnu/services/base.scm
index 1ad7c2320..29ae5fca3 100644
--- a/gnu/services/base.scm
+++ b/gnu/services/base.scm
@@ -817,7 +817,8 @@ the message of the day, among other things."
   agetty-configuration?
   (agetty           agetty-configuration-agetty   ;<package>
                     (default util-linux))
-  (tty              agetty-configuration-tty)     ;string | #f
+  (tty              agetty-configuration-tty      ;string | #f
+                    (default #f))
   (term             agetty-term                   ;string | #f
                     (default #f))
   (baud-rate        agetty-baud-rate              ;string | #f
@@ -1072,6 +1073,31 @@ program.")))
 the tty to run, among other things."
   (service agetty-service-type config))
 
+(define console-agetty-shepherd-service
+  (lambda (config)
+    (let ((base-service
+           (car
+            (agetty-shepherd-service
+             (agetty-configuration (inherit config)
+              (keep-baud? #t))))))
+      (list
+       (shepherd-service (inherit base-service)
+         ;; Make sure that Linux doesn't log to the same console as well.
+         (requirement (cons 'syslogd (shepherd-service-requirement base-service))))))))
+
+(define console-agetty-service-type
+  (service-type (name 'console-agetty)
+                (extensions (list (service-extension shepherd-root-service-type
+                                                     console-agetty-shepherd-service)))
+                (description
+                 "Provide console login using the @command{agetty}
+program on the Linux console.")))
+
+(define* (console-agetty-service config)
+  "Return a service to run agetty according to @var{config}, which specifies
+the tty to run, defaulting to the Linux console."
+  (service console-agetty-service-type config))
+
 (define-record-type* <mingetty-configuration>
   mingetty-configuration make-mingetty-configuration
   mingetty-configuration?
@@ -2053,10 +2079,9 @@ This service is not part of @var{%base-services}."
                         (cons tty %default-console-font))
                       '("tty1" "tty2" "tty3" "tty4" "tty5" "tty6")))
 
-        (agetty-service (agetty-configuration
-                         (extra-options '("-L")) ; no carrier detect
-                         (term "vt100")
-                         (tty #f))) ; automatic
+        (console-agetty-service (agetty-configuration
+                                 (extra-options '("-L")) ; no carrier detect
+                                 (term "vt100")))
 
         (mingetty-service (mingetty-configuration
                            (tty "tty1")))

  reply	other threads:[~2018-02-15 11:48 UTC|newest]

Thread overview: 20+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2018-02-15 11:42 [bug#30464] [PATCH 0/2] Add console-agetty-service Danny Milosavljevic
2018-02-15 11:47 ` Danny Milosavljevic [this message]
2018-02-15 11:47   ` [bug#30464] [PATCH 2/2] services: agetty-shepherd-service: Default to providing 'term-console instead of 'term-auto Danny Milosavljevic
2018-02-15 14:40   ` [bug#30464] [PATCH 1/2] services: Add console-agetty-service Ludovic Courtès
2018-02-15 15:41     ` Danny Milosavljevic
2018-02-15 15:47       ` Ludovic Courtès
2018-02-16 20:57         ` [bug#30464] shepherd logging; console-agetty-service Danny Milosavljevic
2018-02-16 21:07           ` [bug#30464] shepherd logging Danny Milosavljevic
2018-02-16 23:17             ` Danny Milosavljevic
2018-02-17 16:25             ` [bug#30464] " Ludovic Courtès
2018-02-17 16:47               ` Danny Milosavljevic
2018-02-17 16:57                 ` Ludovic Courtès
2018-02-17 16:20           ` [bug#30464] shepherd logging; console-agetty-service Ludovic Courtès
2018-02-17 18:02             ` Danny Milosavljevic
2018-02-26 17:52         ` [bug#30464] [PATCH 1/2] services: Add console-agetty-service Ludovic Courtès
2020-10-08 18:21           ` Maxim Cournoyer
2022-01-13 16:02             ` [bug#30464] [PATCH 0/2] " zimoun
2022-02-03  2:33               ` zimoun
2022-02-03 20:55                 ` Danny Milosavljevic
2022-03-23 13:00                   ` zimoun

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

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=20180215114742.663-1-dannym@scratchpost.org \
    --to=dannym@scratchpost.org \
    --cc=30464@debbugs.gnu.org \
    /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 external index

	https://git.savannah.gnu.org/cgit/guix.git

This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.