GNU bug report logs - #44347
mingetty --no-clear is hard-coded

Previous Next

Package: guix;

Reported by: Jesse Gibbons <jgibbons2357 <at> gmail.com>

Date: Sat, 31 Oct 2020 15:17:02 UTC

Severity: normal

Done: Ludovic Courtès <ludo <at> gnu.org>

Bug is archived. No further changes may be made.

To add a comment to this bug, you must first unarchive it, by sending
a message to control AT debbugs.gnu.org, with unarchive 44347 in the body.
You can then email your comments to 44347 AT debbugs.gnu.org in the normal way.

Toggle the display of automated, internal messages from the tracker.

View this report as an mbox folder, status mbox, maintainer mbox


Report forwarded to bug-guix <at> gnu.org:
bug#44347; Package guix. (Sat, 31 Oct 2020 15:17:02 GMT) Full text and rfc822 format available.

Acknowledgement sent to Jesse Gibbons <jgibbons2357 <at> gmail.com>:
New bug report received and forwarded. Copy sent to bug-guix <at> gnu.org. (Sat, 31 Oct 2020 15:17:02 GMT) Full text and rfc822 format available.

Message #5 received at submit <at> debbugs.gnu.org (full text, mbox):

From: Jesse Gibbons <jgibbons2357 <at> gmail.com>
To: bug-guix <at> gnu.org
Subject: mingetty --no-clear is hard-coded
Date: Sat, 31 Oct 2020 09:16:19 -0600
The --no-clear option is hard-coded for mingetty, with no documentation 
about why. The mingetty page says,
       --noclear
              Do not clear the screen before prompting for the login 
name (the
              screen is normally cleared).

I do not think I am alone in preferring the screen cleared after logout. 
I also think it could be a security issue. For now my workaround is to 
include a call to "tput reset" or "clear" in my .bash_logout script, but 
that has to be configured for every user and requires more packages 
installed either at the system level or per-user.

I think this is an "easy for beginners" issue. I would fix it myself, 
but I have a lot of other stuff to do.




Information forwarded to bug-guix <at> gnu.org:
bug#44347; Package guix. (Sun, 01 Nov 2020 16:33:02 GMT) Full text and rfc822 format available.

Message #8 received at 44347 <at> debbugs.gnu.org (full text, mbox):

From: Mark H Weaver <mhw <at> netris.org>
To: Jesse Gibbons <jgibbons2357 <at> gmail.com>, 44347 <at> debbugs.gnu.org
Subject: Re: bug#44347: mingetty --no-clear is hard-coded
Date: Sun, 01 Nov 2020 11:30:20 -0500
[Message part 1 (text/plain, inline)]
Hi Jesse,

Jesse Gibbons <jgibbons2357 <at> gmail.com> writes:

> The --no-clear option is hard-coded for mingetty, with no documentation 
> about why. The mingetty page says,
>         --noclear
>                Do not clear the screen before prompting for the login 
> name (the
>                screen is normally cleared).
>
> I do not think I am alone in preferring the screen cleared after logout. 

You're not alone.  I'd also prefer that the screen be cleared.  At
least, it should be configurable.

Here's an *untested* patch to make it configurable, and to change the
default behavior to clear.  I'm rebuilding my system now, but I have a
lot of compiling ahead of me (I don't use substitutes), so it will be a
while.  I'll report back after I've tested it.

In the meantime, does anyone object to changing the default behavior to
clear-on-logout, which is the upstream default?

     Regards,
       Mark

[0001-UNTESTED-gnu-mingetty-shepherd-service-Make-clear-on.patch (text/x-patch, inline)]
From 61d0055493c46cdee178d0ffbbf15742de930028 Mon Sep 17 00:00:00 2001
From: Mark H Weaver <mhw <at> netris.org>
Date: Sun, 1 Nov 2020 11:16:08 -0500
Subject: [PATCH] UNTESTED: 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.
---
 gnu/services/base.scm | 28 ++++++++++++++++------------
 1 file changed, 16 insertions(+), 12 deletions(-)

diff --git a/gnu/services/base.scm b/gnu/services/base.scm
index 5a5c41d588..1f750670c9 100644
--- a/gnu/services/base.scm
+++ b/gnu/services/base.scm
@@ -1,7 +1,7 @@
 ;;; GNU Guix --- Functional package management for GNU
 ;;; Copyright © 2013, 2014, 2015, 2016, 2017, 2018, 2019, 2020 Ludovic Courtès <ludo <at> gnu.org>
 ;;; Copyright © 2015, 2016 Alex Kost <alezost <at> gmail.com>
-;;; Copyright © 2015, 2016 Mark H Weaver <mhw <at> netris.org>
+;;; Copyright © 2015, 2016, 2020 Mark H Weaver <mhw <at> netris.org>
 ;;; Copyright © 2015 Sou Bunnbu <iyzsong <at> gmail.com>
 ;;; Copyright © 2016, 2017 Leo Famulari <leo <at> famulari.name>
 ;;; Copyright © 2016 David Craven <david <at> craven.ch>
@@ -1024,20 +1024,22 @@ the tty to run, among other things."
 (define-record-type* <mingetty-configuration>
   mingetty-configuration make-mingetty-configuration
   mingetty-configuration?
-  (mingetty       mingetty-configuration-mingetty ;<package>
-                  (default mingetty))
-  (tty            mingetty-configuration-tty)     ;string
-  (auto-login     mingetty-auto-login             ;string | #f
-                  (default #f))
-  (login-program  mingetty-login-program          ;gexp
-                  (default #f))
-  (login-pause?   mingetty-login-pause?           ;Boolean
-                  (default #f)))
+  (mingetty         mingetty-configuration-mingetty ;<package>
+                    (default mingetty))
+  (tty              mingetty-configuration-tty)     ;string
+  (auto-login       mingetty-auto-login             ;string | #f
+                    (default #f))
+  (login-program    mingetty-login-program          ;gexp
+                    (default #f))
+  (login-pause?     mingetty-login-pause?           ;Boolean
+                    (default #f))
+  (clear-on-logout? mingetty-clear-on-logout?       ;Boolean
+                    (default #t)))
 
 (define mingetty-shepherd-service
   (match-lambda
     (($ <mingetty-configuration> mingetty tty auto-login login-program
-                                 login-pause?)
+                                 login-pause? clear-on-logout?)
      (list
       (shepherd-service
        (documentation "Run mingetty on an tty.")
@@ -1050,7 +1052,6 @@ the tty to run, among other things."
 
        (start  #~(make-forkexec-constructor
                   (list #$(file-append mingetty "/sbin/mingetty")
-                        "--noclear"
 
                         ;; Avoiding 'vhangup' allows us to avoid 'setfont'
                         ;; errors down the path where various ioctls get
@@ -1058,6 +1059,9 @@ the tty to run, among other things."
                         ;; in Linux.
                         "--nohangup" #$tty
 
+                        #$@(if clear-on-logout?
+                               #~()
+                               #~("--noclear"))
                         #$@(if auto-login
                                #~("--autologin" #$auto-login)
                                #~())
-- 
2.28.0


Information forwarded to bug-guix <at> gnu.org:
bug#44347; Package guix. (Sun, 01 Nov 2020 16:39:01 GMT) Full text and rfc822 format available.

Message #11 received at 44347 <at> debbugs.gnu.org (full text, mbox):

From: Mark H Weaver <mhw <at> netris.org>
To: Jesse Gibbons <jgibbons2357 <at> gmail.com>, 44347 <at> debbugs.gnu.org
Subject: Re: bug#44347: mingetty --no-clear is hard-coded
Date: Sun, 01 Nov 2020 11:37:02 -0500
[Message part 1 (text/plain, inline)]
Here's a revised patch, still untested, that also updates the
documentation.

       Mark

[0001-UNTESTED-gnu-mingetty-shepherd-service-Make-clear-on.patch (text/x-patch, inline)]
From 9229d0493cdbb521a2f7a821d47d60d2392b8447 Mon Sep 17 00:00:00 2001
From: Mark H Weaver <mhw <at> netris.org>
Date: Sun, 1 Nov 2020 11:16:08 -0500
Subject: [PATCH] UNTESTED: 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.
---
 doc/guix.texi         |  3 +++
 gnu/services/base.scm | 28 ++++++++++++++++------------
 2 files changed, 19 insertions(+), 12 deletions(-)

diff --git a/doc/guix.texi b/doc/guix.texi
index 69e7d5f85c..6ef4350f97 100644
--- a/doc/guix.texi
+++ b/doc/guix.texi
@@ -14494,6 +14494,9 @@ the name of the log-in program.
 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.
 
+@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})
 The Mingetty package to use.
 
diff --git a/gnu/services/base.scm b/gnu/services/base.scm
index 5a5c41d588..1f750670c9 100644
--- a/gnu/services/base.scm
+++ b/gnu/services/base.scm
@@ -1,7 +1,7 @@
 ;;; GNU Guix --- Functional package management for GNU
 ;;; Copyright © 2013, 2014, 2015, 2016, 2017, 2018, 2019, 2020 Ludovic Courtès <ludo <at> gnu.org>
 ;;; Copyright © 2015, 2016 Alex Kost <alezost <at> gmail.com>
-;;; Copyright © 2015, 2016 Mark H Weaver <mhw <at> netris.org>
+;;; Copyright © 2015, 2016, 2020 Mark H Weaver <mhw <at> netris.org>
 ;;; Copyright © 2015 Sou Bunnbu <iyzsong <at> gmail.com>
 ;;; Copyright © 2016, 2017 Leo Famulari <leo <at> famulari.name>
 ;;; Copyright © 2016 David Craven <david <at> craven.ch>
@@ -1024,20 +1024,22 @@ the tty to run, among other things."
 (define-record-type* <mingetty-configuration>
   mingetty-configuration make-mingetty-configuration
   mingetty-configuration?
-  (mingetty       mingetty-configuration-mingetty ;<package>
-                  (default mingetty))
-  (tty            mingetty-configuration-tty)     ;string
-  (auto-login     mingetty-auto-login             ;string | #f
-                  (default #f))
-  (login-program  mingetty-login-program          ;gexp
-                  (default #f))
-  (login-pause?   mingetty-login-pause?           ;Boolean
-                  (default #f)))
+  (mingetty         mingetty-configuration-mingetty ;<package>
+                    (default mingetty))
+  (tty              mingetty-configuration-tty)     ;string
+  (auto-login       mingetty-auto-login             ;string | #f
+                    (default #f))
+  (login-program    mingetty-login-program          ;gexp
+                    (default #f))
+  (login-pause?     mingetty-login-pause?           ;Boolean
+                    (default #f))
+  (clear-on-logout? mingetty-clear-on-logout?       ;Boolean
+                    (default #t)))
 
 (define mingetty-shepherd-service
   (match-lambda
     (($ <mingetty-configuration> mingetty tty auto-login login-program
-                                 login-pause?)
+                                 login-pause? clear-on-logout?)
      (list
       (shepherd-service
        (documentation "Run mingetty on an tty.")
@@ -1050,7 +1052,6 @@ the tty to run, among other things."
 
        (start  #~(make-forkexec-constructor
                   (list #$(file-append mingetty "/sbin/mingetty")
-                        "--noclear"
 
                         ;; Avoiding 'vhangup' allows us to avoid 'setfont'
                         ;; errors down the path where various ioctls get
@@ -1058,6 +1059,9 @@ the tty to run, among other things."
                         ;; in Linux.
                         "--nohangup" #$tty
 
+                        #$@(if clear-on-logout?
+                               #~()
+                               #~("--noclear"))
                         #$@(if auto-login
                                #~("--autologin" #$auto-login)
                                #~())
-- 
2.28.0


Information forwarded to bug-guix <at> gnu.org:
bug#44347; Package guix. (Sun, 01 Nov 2020 22:13:01 GMT) Full text and rfc822 format available.

Message #14 received at 44347 <at> debbugs.gnu.org (full text, mbox):

From: Ludovic Courtès <ludo <at> gnu.org>
To: Mark H Weaver <mhw <at> netris.org>
Cc: Jesse Gibbons <jgibbons2357 <at> gmail.com>, 44347 <at> debbugs.gnu.org
Subject: Re: bug#44347: mingetty --no-clear is hard-coded
Date: Sun, 01 Nov 2020 23:12:02 +0100
Hi Mark,

Mark H Weaver <mhw <at> netris.org> skribis:

> In the meantime, does anyone object to changing the default behavior to
> clear-on-logout, which is the upstream default?

Fine with me; it’s probably a safer default.

> From 61d0055493c46cdee178d0ffbbf15742de930028 Mon Sep 17 00:00:00 2001
> From: Mark H Weaver <mhw <at> netris.org>
> Date: Sun, 1 Nov 2020 11:16:08 -0500
> Subject: [PATCH] UNTESTED: 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.

Untested as well :-), but your v2 LGTM.

Thanks,
Ludo’.




Reply sent to Ludovic Courtès <ludo <at> gnu.org>:
You have taken responsibility. (Thu, 03 Dec 2020 17:13:02 GMT) Full text and rfc822 format available.

Notification sent to Jesse Gibbons <jgibbons2357 <at> gmail.com>:
bug acknowledged by developer. (Thu, 03 Dec 2020 17:13:02 GMT) Full text and rfc822 format available.

Message #19 received at 44347-done <at> debbugs.gnu.org (full text, mbox):

From: Ludovic Courtès <ludo <at> gnu.org>
To: Mark H Weaver <mhw <at> netris.org>
Cc: 44347-done <at> debbugs.gnu.org, Jesse Gibbons <jgibbons2357 <at> gmail.com>
Subject: Re: bug#44347: mingetty --no-clear is hard-coded
Date: Thu, 03 Dec 2020 18:12:14 +0100
This was fixed by commit e3ae31347882b25e1513e4475616fb6e4497e280.

Closing!




bug archived. Request was from Debbugs Internal Request <help-debbugs <at> gnu.org> to internal_control <at> debbugs.gnu.org. (Fri, 01 Jan 2021 12:24:10 GMT) Full text and rfc822 format available.

This bug report was last modified 4 years and 228 days ago.

Previous Next


GNU bug tracking system
Copyright (C) 1999 Darren O. Benham, 1997,2003 nCipher Corporation Ltd, 1994-97 Ian Jackson.