summary refs log tree commit diff
path: root/gnu
diff options
context:
space:
mode:
Diffstat (limited to 'gnu')
-rw-r--r--gnu/services/base.scm37
1 files changed, 34 insertions, 3 deletions
diff --git a/gnu/services/base.scm b/gnu/services/base.scm
index dc0161408b..102363819c 100644
--- a/gnu/services/base.scm
+++ b/gnu/services/base.scm
@@ -193,9 +193,31 @@ stopped before 'kill' is called."
 (define* (mingetty-service tty
                            #:key
                            (motd (text-file "motd" "Welcome.\n"))
+                           auto-login
+                           login-program
+                           login-pause?
                            (allow-empty-passwords? #t))
-  "Return a service to run mingetty on TTY."
-  (mlet %store-monad ((motd motd))
+  "Return a service to run mingetty on @var{tty}.
+
+When @var{allow-empty-passwords?} is true, allow empty log-in password.  When
+@var{auto-login} is true, it must be a user name under which to log-in
+automatically.  @var{login-pause?} can be set to @code{#t} in conjunction with
+@var{auto-login}, in which case the user will have to press a key before the
+login shell is launched.
+
+When true, @var{login-program} is a gexp or a monadic gexp denoting the name
+of the log-in program (the default is the @code{login} program from the Shadow
+tool suite.)
+
+@var{motd} is a monadic value containing a text file to use as
+the \"message of the day\"."
+  (mlet %store-monad ((motd motd)
+                      (login-program (cond ((gexp? login-program)
+                                            (return login-program))
+                                           ((not login-program)
+                                            (return #f))
+                                           (else
+                                            login-program))))
     (return
      (service
       (documentation (string-append "Run mingetty on " tty "."))
@@ -207,7 +229,16 @@ stopped before 'kill' is called."
 
       (start  #~(make-forkexec-constructor
                  (string-append #$mingetty "/sbin/mingetty")
-                 "--noclear" #$tty))
+                 "--noclear" #$tty
+                 #$@(if auto-login
+                        #~("--autologin" #$auto-login)
+                        #~())
+                 #$@(if login-program
+                        #~("--loginprog" #$login-program)
+                        #~())
+                 #$@(if login-pause?
+                        #~("--loginpause")
+                        #~())))
       (stop   #~(make-kill-destructor))
 
       (pam-services