LinuxQuestions.org

LinuxQuestions.org (/questions/)
-   Gentoo (https://www.linuxquestions.org/questions/gentoo-87/)
-   -   Where is screen cleared before initial login prompt? (https://www.linuxquestions.org/questions/gentoo-87/where-is-screen-cleared-before-initial-login-prompt-938993/)

CollieJim 04-09-2012 09:34 PM

Where is screen cleared before initial login prompt?
 
In the past the screen has not been cleared before displaying /etc/issue and the initial login prompt. I like that because sometimes errors and warnings are displayed that do not appear in any logfile.

Recently one of my 2 machines (probably the one I changed to baselayout 2) has started clearing the screen. Not good.

What do I need to change to prevent clearing?

Thanks
Jim

jhwilliams 04-09-2012 09:44 PM

On my system, ~/.bash_logout calls clear_console:

Code:

# ~/.bash_logout: executed by bash(1) when login shell exits.

# when leaving the console clear the screen to increase privacy

if [ "$SHLVL" = 1 ]; then
    [ -x /usr/bin/clear_console ] && /usr/bin/clear_console -q
fi

So I could comment out those lines, if I wanted:

Code:

# ~/.bash_logout: executed by bash(1) when login shell exits.

# when leaving the console clear the screen to increase privacy

#if [ "$SHLVL" = 1 ]; then
#    [ -x /usr/bin/clear_console ] && /usr/bin/clear_console -q
#fi

You can edit /etc/skel/.bash_logout if you want to change the behavior for all new accounts, as well.

CollieJim 04-09-2012 10:28 PM

How is something in ~/.bash_logout relevant? No-one is logged in yet, so which one to use? I'm talking about clearing the screen before the *initial* login prompt is displayed.

Bruce Hill 05-01-2012 01:09 PM

Quote:

Originally Posted by CollieJim (Post 4648859)
In the past the screen has not been cleared before displaying /etc/issue and the initial login prompt. I like that because sometimes errors and warnings are displayed that do not appear in any logfile.

Recently one of my 2 machines (probably the one I changed to baselayout 2) has started clearing the screen. Not good.

What do I need to change to prevent clearing?

Thanks
Jim

This is the new default behavior in agetty. You can add --noclear in TERMINALS
section of /etc/inittab to avoid it.
Here's how that section should look to get the old behavior of not clearing:
Code:

# TERMINALS
c1:12345:respawn:/sbin/agetty --noclear 38400 tty1 linux
c2:2345:respawn:/sbin/agetty 38400 tty2 linux
c3:2345:respawn:/sbin/agetty 38400 tty3 linux
c4:2345:respawn:/sbin/agetty 38400 tty4 linux
c5:2345:respawn:/sbin/agetty 38400 tty5 linux
c6:2345:respawn:/sbin/agetty 38400 tty6 linux

It was in the post install message of sys-apps/util-linux-2.20.1-r1 - 02/27/2012
Code:

LOG: postinst                                                                                                                                                                                                                  │
│The agetty util now clears the terminal by default.  You                                                                                                                                                                      │
│might want to add --noclear to your /etc/inittab lines.

Hope that gets you all fixed up.


All times are GMT -5. The time now is 06:42 PM.