gnu: mingetty-shepherd-service: Make 'clear-on-logout' configurable.
Also change the default configuration to clear on logout, which is the upstream default. * gnu/services/base.scm (<mingetty-configuration>): Add 'clear-on-logout?' field. (mingetty-shepherd-service): Pass the "--noclear" option to mingetty only if 'clear-on-logout?' is #false. * doc/guix.texi (Base Services): Document the 'clear-on-logout?' field.
This commit is contained in:
parent
d71f9e6f16
commit
e3ae313478
2 changed files with 19 additions and 12 deletions
|
@ -14528,6 +14528,9 @@ the name of the log-in program.
|
||||||
When set to @code{#t} in conjunction with @var{auto-login}, the user
|
When set to @code{#t} in conjunction with @var{auto-login}, the user
|
||||||
will have to press a key before the log-in shell is launched.
|
will have to press a key before the log-in shell is launched.
|
||||||
|
|
||||||
|
@item @code{clear-on-logout?} (default: @code{#t})
|
||||||
|
When set to @code{#t}, the screen will be cleared after logout.
|
||||||
|
|
||||||
@item @code{mingetty} (default: @var{mingetty})
|
@item @code{mingetty} (default: @var{mingetty})
|
||||||
The Mingetty package to use.
|
The Mingetty package to use.
|
||||||
|
|
||||||
|
|
|
@ -1,7 +1,7 @@
|
||||||
;;; GNU Guix --- Functional package management for GNU
|
;;; GNU Guix --- Functional package management for GNU
|
||||||
;;; Copyright © 2013, 2014, 2015, 2016, 2017, 2018, 2019, 2020 Ludovic Courtès <ludo@gnu.org>
|
;;; Copyright © 2013, 2014, 2015, 2016, 2017, 2018, 2019, 2020 Ludovic Courtès <ludo@gnu.org>
|
||||||
;;; Copyright © 2015, 2016 Alex Kost <alezost@gmail.com>
|
;;; Copyright © 2015, 2016 Alex Kost <alezost@gmail.com>
|
||||||
;;; Copyright © 2015, 2016 Mark H Weaver <mhw@netris.org>
|
;;; Copyright © 2015, 2016, 2020 Mark H Weaver <mhw@netris.org>
|
||||||
;;; Copyright © 2015 Sou Bunnbu <iyzsong@gmail.com>
|
;;; Copyright © 2015 Sou Bunnbu <iyzsong@gmail.com>
|
||||||
;;; Copyright © 2016, 2017 Leo Famulari <leo@famulari.name>
|
;;; Copyright © 2016, 2017 Leo Famulari <leo@famulari.name>
|
||||||
;;; Copyright © 2016 David Craven <david@craven.ch>
|
;;; Copyright © 2016 David Craven <david@craven.ch>
|
||||||
|
@ -1024,20 +1024,22 @@ the tty to run, among other things."
|
||||||
(define-record-type* <mingetty-configuration>
|
(define-record-type* <mingetty-configuration>
|
||||||
mingetty-configuration make-mingetty-configuration
|
mingetty-configuration make-mingetty-configuration
|
||||||
mingetty-configuration?
|
mingetty-configuration?
|
||||||
(mingetty mingetty-configuration-mingetty ;<package>
|
(mingetty mingetty-configuration-mingetty ;<package>
|
||||||
(default mingetty))
|
(default mingetty))
|
||||||
(tty mingetty-configuration-tty) ;string
|
(tty mingetty-configuration-tty) ;string
|
||||||
(auto-login mingetty-auto-login ;string | #f
|
(auto-login mingetty-auto-login ;string | #f
|
||||||
(default #f))
|
(default #f))
|
||||||
(login-program mingetty-login-program ;gexp
|
(login-program mingetty-login-program ;gexp
|
||||||
(default #f))
|
(default #f))
|
||||||
(login-pause? mingetty-login-pause? ;Boolean
|
(login-pause? mingetty-login-pause? ;Boolean
|
||||||
(default #f)))
|
(default #f))
|
||||||
|
(clear-on-logout? mingetty-clear-on-logout? ;Boolean
|
||||||
|
(default #t)))
|
||||||
|
|
||||||
(define mingetty-shepherd-service
|
(define mingetty-shepherd-service
|
||||||
(match-lambda
|
(match-lambda
|
||||||
(($ <mingetty-configuration> mingetty tty auto-login login-program
|
(($ <mingetty-configuration> mingetty tty auto-login login-program
|
||||||
login-pause?)
|
login-pause? clear-on-logout?)
|
||||||
(list
|
(list
|
||||||
(shepherd-service
|
(shepherd-service
|
||||||
(documentation "Run mingetty on an tty.")
|
(documentation "Run mingetty on an tty.")
|
||||||
|
@ -1050,7 +1052,6 @@ the tty to run, among other things."
|
||||||
|
|
||||||
(start #~(make-forkexec-constructor
|
(start #~(make-forkexec-constructor
|
||||||
(list #$(file-append mingetty "/sbin/mingetty")
|
(list #$(file-append mingetty "/sbin/mingetty")
|
||||||
"--noclear"
|
|
||||||
|
|
||||||
;; Avoiding 'vhangup' allows us to avoid 'setfont'
|
;; Avoiding 'vhangup' allows us to avoid 'setfont'
|
||||||
;; errors down the path where various ioctls get
|
;; errors down the path where various ioctls get
|
||||||
|
@ -1058,6 +1059,9 @@ the tty to run, among other things."
|
||||||
;; in Linux.
|
;; in Linux.
|
||||||
"--nohangup" #$tty
|
"--nohangup" #$tty
|
||||||
|
|
||||||
|
#$@(if clear-on-logout?
|
||||||
|
#~()
|
||||||
|
#~("--noclear"))
|
||||||
#$@(if auto-login
|
#$@(if auto-login
|
||||||
#~("--autologin" #$auto-login)
|
#~("--autologin" #$auto-login)
|
||||||
#~())
|
#~())
|
||||||
|
|
Reference in a new issue