From 52322163ac4b730a62af67549583d89ee496aeff Mon Sep 17 00:00:00 2001 From: Ludovic Courtès Date: Sat, 31 May 2014 19:16:50 +0200 Subject: system: Add more options for 'mingetty-service'. * gnu/services/base.scm (mingetty-service): Add #:auto-login, #:login-program, and #:login-pause? parameters and honor them. --- gnu/services/base.scm | 37 ++++++++++++++++++++++++++++++++++--- 1 file changed, 34 insertions(+), 3 deletions(-) (limited to 'gnu/services') 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 @@ (define (host-name-service name) (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 @@ (define* (mingetty-service tty (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 -- cgit v1.2.3