PDA

View Full Version : How to hide Console text when logging off while using GDM instead of lightDM



dcharlespyle
22nd October 2013, 06:10 AM
This is a workaround for making sure you don't see Console text between logging off from a Gnome-shell session when using GDM instead of lightDM. This has been something that has bugged me for a while and finally ended up figuring out a workaround that works for me. Hopefully it will work for others facing this.

It is really easy.

1. As root, open /etc/X11/xinit/Xsession with a text editor.

2. Before the line that reads "# redirect errors to a file in user's home directory if we can" add the following:


# Clear the previous console text prior to loading X. This makes it
# so you never see console output between session logout and GDM greeter.
echo -e \\033c

3. Save the file and reboot.

What this does is to clear the Console before X loads. Now, when you logoff of a session when using GNOME Shell and GDM instead of lightDM, you should see nothing but a black background instead of a bunch of distorted or other Console text. Putting it in the above file makes it so it works for all users.

Unfortunately, if that file is changed you could lose this setting so it might be prudent to look for other places to put it to do the same thing without losing your changes during updates. Perhaps the various people involved in making some of the various Linux distributions could make this little snippet of code part of their distributions so we don't lose this setting during updates? :)

Also, by way of warning, this will not work if you are running the colord service or have run it in the past. Something about that service interferes with the working of this little bit of text, even if you disable the service. Should that happen, you can so a sudo init 3, followed by a init 5 in a root console. That seems to restore the original functionality. At least it did for me.

SlowJet
22nd October 2013, 06:38 AM
The console lines are ussually hidden or cleared before plymouyh exits (except for a couple that may say something like
shuting down now
powering off.

Otherwise they are bugs and errors in the systemd, intscripts, and kernel jumk.
These messages change with the latest updates like the weather.

And the point is, seeing them indicates not all is well and therefore may be needed to debug something.
i.g. syslogd writes a lot of log files, why not turn it off.
save disk space, fragmented f/s, and the life of the disk light.

SJ

dcharlespyle
22nd October 2013, 07:16 AM
There are a few that are left over on the console screen after Plymouth exits. In my case, none of them are errors of any kind as all of them have a green [ OK ] after each and every one. In addition, the lines often tend to be staggered across the screen.

Failures have a red [ FAILED ] after those lines. I have none of those.

Please note: I am using nothing but FOSS graphics card drivers. But, when I use GDM and when I logoff a Gnome shell session, for a few moments before the GDM greeter comes back, I can see leftover console text that occurred before X initialized.

My workaround seems to have removed that and left a single, non-blinking cursor at worst, with no annoying, leftover console text. I am always looking for something better and hopefully will find/figure out something that will work better than this.

SlowJet
22nd October 2013, 07:43 PM
I found this in the users mail list.

In /etc/systemd/journald.conf
you will see the default setting with an #.
Add a line under
#Storage=auto (keeping the default line in tact for reference.)
to
Storage=volatile

After I did this the booting was more consistent and
#shutdown was back to jjust 2 line post plymouth close.
This fist line is to long ad fast, and the second line is
#powering off.

SJ

dcharlespyle
27th October 2013, 01:21 AM
The journald.conf suggestion had no effect either way on my system.

dcharlespyle
28th October 2013, 01:06 AM
I have rewritten the above method slightly in favor of something that works as intended 100% of the time, regardless of whether or not one has ever used the colord service. It just is a modification of existing code to make that code functional, whereas it is not functional otherwise.

This is a workaround for making sure you don't see Console text between logging off from a Gnome-shell session when using GDM instead of lightDM. This has been something that has bugged me for a while and finally ended up figuring out a workaround that works for me. Hopefully it will work for others facing this.

It is really easy.

1. As root, open /etc/gdm/PostSession/Default with a text editor.

2. Find the line that reads "echo -e \\033c" and modify it to the following:


# Echo the 'all-clear' to the console to clear console text before any user sees it:
echo -ne "\\033c" > /dev/console

3. Save the file and logoff. The effect should be immediate and no console text should be seen on logoff. If it isn't, simply reboot and logon as usual.

If seeing a non-blinking cursor and a black screen while control is returned to the GDM greeter is bothersome, you also can add echo -ne "Transferring to logon screen. Please wait..." > /dev/console between the line you just modified and the line that reads exit 0."

What this change does is to clear /dev/console and the buffer just before the user logs off. The previous code no longer functions because it is not calling to /dev/console, which is where the console text remains because it isn't cleared as it ought to be before gdm starts. The above modified code specifies that it is /dev/console that is to be cleared and echoes the escape code to that device instead of nowhere or to a VT that isn't the cause of the problem.

Now, when you logoff a GDM session when using any DE, and GDM instead of lightDM, you should see nothing but a black background (with no more than a cursor at most) instead of a bunch of distorted or other Console text (unless you want some custom text to be displayed). Putting it in the above file makes it so it works for all users for a consistent user experience.

Unfortunately, if that file is changed you could lose this code so it might be prudent to back it up so you don't lose your changes during possible future updates. Perhaps the various people involved in making some of the various Linux distributions could make this little modified snippet of code part of their distributions so we don't lose this setting during updates? :)

Works well for me. Hopefully it will work equally well for others.