Gentoo Websites Logo
Go to: Gentoo Home Documentation Forums Lists Bugs Planet Store Wiki Get Gentoo!

Bug 524318

Summary: sys-apps/sysvinit - /etc/inittab should spawn agetty with '--noclear' option
Product: Gentoo Linux Reporter: Piotr Karbowski (RETIRED) <slashbeast>
Component: [OLD] Core systemAssignee: Gentoo's Team for Core System packages <base-system>
Status: RESOLVED DUPLICATE    
Severity: normal CC: whissi
Priority: Normal    
Version: unspecified   
Hardware: All   
OS: Linux   
Whiteboard:
Package list:
Runtime testing required: ---

Description Piotr Karbowski (RETIRED) gentoo-dev 2014-10-02 20:37:59 UTC
As from some time, agetty by default clear the screen, resulting in supressing last 'screen' of boot logs, one still can control-PgUp/PgDown, but the last screen-worth of logs is wiped.

This could be easly adjusted by appending '--noclear' to aggety forks, for example /etc/inittab's:

    c1:12345:respawn:/sbin/agetty 38400 tty1 linux

to

    c1:12345:respawn:/sbin/agetty --noclear 38400 tty1 linux

(same goes for all other agetty forks).

This is a minor cosmetic change, but I do believe it's worth the effort to commit given changes into inittab.

Reproducible: Always
Comment 1 Jeroen Roovers (RETIRED) gentoo-dev 2014-10-02 20:40:55 UTC
You haven't argued yet why this should be everyone's default.
Comment 2 Piotr Karbowski (RETIRED) gentoo-dev 2014-10-02 20:47:03 UTC
(In reply to Jeroen Roovers from comment #1)
> You haven't argued yet why this should be everyone's default.

Let start with:

- It was default for like a decade, until it was changed in agetty.
- Having the logs from boot on default console is useful, one could miss some failures/warnings/error messages that could have serious impact on production later on.
Comment 3 Joshua Kinard gentoo-dev 2014-10-03 10:07:46 UTC
I've manually added --noclear myself to my inittab, but only for the first console so I can see the boot logs.  The other consoles work better by clearing when logged out.  That seems to be the intended purpose as addressing an OPSEC issue by clearing the console on logout so the contents of the console can't be inadvertently viewed by others. 

I don't think it should be a default, though.  Perhaps an entry in a manual or on the wiki somewhere.  Pity there isn't some way to only clear the console upon a user logout, not everytime agetty is loaded (lkike after booting).
Comment 4 Piotr Karbowski (RETIRED) gentoo-dev 2014-10-03 15:21:55 UTC
Well, by default gentoo have bash as any user shell.

And /etc/skel/.bash_logout have 'clear', meaning on every logout, by default, it will clear the screen.

The agetty cleaning the screen and logout clear is not connected.
Comment 5 Joshua Kinard gentoo-dev 2014-10-04 00:13:11 UTC
(In reply to Piotr Karbowski from comment #4)
> Well, by default gentoo have bash as any user shell.
> 
> And /etc/skel/.bash_logout have 'clear', meaning on every logout, by
> default, it will clear the screen.
> 
> The agetty cleaning the screen and logout clear is not connected.

Bash may be default, but that doesn't mean everyone runs it as their primary shell, especially after Shellshock.  I tested one of my systems that uses bash, but it appears I am not using bash's clearing function on logout.  With --noclear added to inittab on that machine, logging out does not wipe the console, just merely pushes it into scrollback, dumps /etc/issue out, and then pops a new login prompt.  Removing --noclear and signalling init to reload inittab causes the console to clear upon a logout.

That means even if --noclear was made the default for agetty, users of shells other than bash might not have their consoles cleared on logout if they don't use or don't have a clear-on-logout capability from their chosen shell.  That's a behavioral change that might not go over well with those users.  I don't think that is a good trade-off just to support being able to look at the bootlogs on the main boot console.

Manually adding --noclear to inittab takes all of 30 seconds after a fresh install, and just making sure etc-update doesn't overwrite that file on a sysvinit update.
Comment 6 SpanKY gentoo-dev 2014-10-16 19:10:33 UTC

*** This bug has been marked as a duplicate of bug 381401 ***