summaryrefslogtreecommitdiff
path: root/gnu
diff options
context:
space:
mode:
authorLudovic Courtès <ludo@gnu.org>2014-05-31 19:16:50 +0200
committerLudovic Courtès <ludo@gnu.org>2014-05-31 21:51:04 +0200
commit52322163ac4b730a62af67549583d89ee496aeff (patch)
tree708f8d77ecbd5326d18a484db4f484dbced47270 /gnu
parent1bb784ea05b2eeac13f7355ae2f51fbd302a36b7 (diff)
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.
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 dc0161408b6..102363819c8 100644
--- a/gnu/services/base.scm
+++ b/gnu/services/base.scm
@@ -193,9 +193,31 @@ stopped before 'kill' is called."
193(define* (mingetty-service tty 193(define* (mingetty-service tty
194 #:key 194 #:key
195 (motd (text-file "motd" "Welcome.\n")) 195 (motd (text-file "motd" "Welcome.\n"))
196 auto-login
197 login-program
198 login-pause?
196 (allow-empty-passwords? #t)) 199 (allow-empty-passwords? #t))
197 "Return a service to run mingetty on TTY." 200 "Return a service to run mingetty on @var{tty}.
198 (mlet %store-monad ((motd motd)) 201
202When @var{allow-empty-passwords?} is true, allow empty log-in password. When
203@var{auto-login} is true, it must be a user name under which to log-in
204automatically. @var{login-pause?} can be set to @code{#t} in conjunction with
205@var{auto-login}, in which case the user will have to press a key before the
206login shell is launched.
207
208When true, @var{login-program} is a gexp or a monadic gexp denoting the name
209of the log-in program (the default is the @code{login} program from the Shadow
210tool suite.)
211
212@var{motd} is a monadic value containing a text file to use as
213the \"message of the day\"."
214 (mlet %store-monad ((motd motd)
215 (login-program (cond ((gexp? login-program)
216 (return login-program))
217 ((not login-program)
218 (return #f))
219 (else
220 login-program))))
199 (return 221 (return
200 (service 222 (service
201 (documentation (string-append "Run mingetty on " tty ".")) 223 (documentation (string-append "Run mingetty on " tty "."))
@@ -207,7 +229,16 @@ stopped before 'kill' is called."
207 229
208 (start #~(make-forkexec-constructor 230 (start #~(make-forkexec-constructor
209 (string-append #$mingetty "/sbin/mingetty") 231 (string-append #$mingetty "/sbin/mingetty")
210 "--noclear" #$tty)) 232 "--noclear" #$tty
233 #$@(if auto-login
234 #~("--autologin" #$auto-login)
235 #~())
236 #$@(if login-program
237 #~("--loginprog" #$login-program)
238 #~())
239 #$@(if login-pause?
240 #~("--loginpause")
241 #~())))
211 (stop #~(make-kill-destructor)) 242 (stop #~(make-kill-destructor))
212 243
213 (pam-services 244 (pam-services