[SOLVED] Console screen clears when prompting for login

This forum is dedicated to basic help and support :

Ask here your questions about basic installation and usage of Mageia. For example you may post here all your questions about getting Mageia isos and installing it, configuring your printer, using your word processor etc.

Try to ask your questions in the right sub-forum with as much details as you can gather. the more precise the question will be, the more likely you are to get a useful answer

[SOLVED] Console screen clears when prompting for login

Postby feretio » May 31st, '12, 16:52

Hi,

Before I file a bug, I wanted to make sure I didn't miss something.

I personally prefer a text boot/login screen and starting X manually. In the past with Mandrake & Mandriva, I would typically add the --noclear option to the mingetty lines in /etc/inittab so I can scroll back to see the boot messages. However, this doesn't seem to be working with Mageia 2. My inittab lines are as follows:

1:2345:respawn:/sbin/mingetty --noclear tty1
2:2345:respawn:/sbin/mingetty --noclear tty2
3:2345:respawn:/sbin/mingetty --noclear tty3
4:2345:respawn:/sbin/mingetty --noclear tty4
5:2345:respawn:/sbin/mingetty --noclear tty5
6:2345:respawn:/sbin/mingetty --noclear tty6

but the screen is cleared just before the login prompt is displayed after booting and it's also cleared when logging out on all 6 tty's. I also verified my .bash_logout does not contain anything that clears the screen.

Part of the reason for checking here first is because Mandriva 2011 is using the same version of the mingetty package and it worked so I want to make sure I'm not missing some other configuration that exists with Mageia 2.

Thanks!

-Jeff
Last edited by feretio on Jun 6th, '12, 19:24, edited 1 time in total.
feretio
 
Posts: 14
Joined: May 31st, '12, 16:40

Re: Console screen clears when prompting for login

Postby doktor5000 » May 31st, '12, 21:58

This probably has to do with the migration to systemd.
Cauldron is not for the faint of heart!
Caution: Hot, bubbling magic inside. May explode or cook your kittens!
----
Disclaimer: Beware of allergic reactions in answer to unconstructive complaint-type posts
User avatar
doktor5000
 
Posts: 18056
Joined: Jun 4th, '11, 10:10
Location: Leipzig, Germany

Re: Console screen clears when prompting for login

Postby feretio » May 31st, '12, 22:29

Hi doktor5000,

Mandriva 2011 also used systemd. How would systemd running affect getty?

-Jeff
feretio
 
Posts: 14
Joined: May 31st, '12, 16:40

Re: Console screen clears when prompting for login

Postby doktor5000 » Jun 2nd, '12, 13:36

You may be aware that systemd integration in Mandriva is far from complete, and the implementation is quite a bit different.
As the complete init system has changed, also the integration of the various logging services, and other stuff like mounting details, plymouth (bootsplash) or where PID files are written to and how services are started, and also the integration of tty's have changed a bit, f.ex. the primary/graphical login should now be on tty1.

I've asked some developers who are more knowledgeable in this area to take a look, but if there are no replies in the next few days feel free to report this as a bug: https://wiki.mageia.org/en/How_to_report_a_bug_properly
Cauldron is not for the faint of heart!
Caution: Hot, bubbling magic inside. May explode or cook your kittens!
----
Disclaimer: Beware of allergic reactions in answer to unconstructive complaint-type posts
User avatar
doktor5000
 
Posts: 18056
Joined: Jun 4th, '11, 10:10
Location: Leipzig, Germany

Re: Console screen clears when prompting for login

Postby colin » Jun 2nd, '12, 13:42

systemd does not read or use /etc/inittab so any changes made there are irrelevant.

If you would like to customise your getty implementation, simply copy /lib/systemd/system/getty@.service to /etc/systemd/system/ and edit the file there to suit your needs. See the various TTY options in man systemd.exec if needed. Then update the symlink /etc/systemd/system/multi-user.target.wants/getty@tty1.service to point to your modified /etc/systemd/system/getty@.service.

Any changes you make should survive any future upgrades we make (we will only update /lib/.... tree, so customisations you make in the /etc/ tree should be preserved.

Hope that helps.
colin
 
Posts: 53
Joined: Jul 25th, '11, 11:15

Re: Console screen clears when prompting for login

Postby feretio » Jun 5th, '12, 16:52

Yes, that helps and makes perfect sense. However, I still can't get it to work.

As you suggested in addition to other research based on your suggestion, I did the following:
1. cp /lib/systemd/system/getty@.service /etc/systemd/system/
2. After verifying the correct parameter in the agetty man page, I changed ExecStart to add the --noclear parameter:
ExecStart=-/sbin/agetty --noclear %I 38400
3. I disabled/enabled the agetty service which recreates the link in /etc/systemd/system/getty.target.wants to point to /etc/systemd/system/getty@.service.
4. systemctl reboot

Unfortunately, the screen still clears after the system boots. I also checked /etc/issue to make sure there were no special characters that clear the screen. Interestingly, if I log in via tty2, the getty process on tty1 is running with the --noclear parameter:

root 2965 1 ..... tty1 00:00:00 /sbin/agetty --noclear tty1 38400

It seems like something else might be clearing the screen. I did various recursive grep in /etc for any other file that might be clearing the screen (e.g. default shell logout) but found very little.

Unfortunately, I'm not sure what else to check. Any other thoughts or suggestions?

Thanks,

-Jeff
feretio
 
Posts: 14
Joined: May 31st, '12, 16:40

Re: Console screen clears when prompting for login

Postby colin » Jun 5th, '12, 17:27

In the service file (getty@.service) make sure you change the other options other than just ExecStart. Many of them affect the TTY before agetty even gets started - see man systemd.{unit,service,exec} for full descriptions of what they mean.

I've realised however that there is another problem you'll likely have to deal with. agetty gets started before the boot is finished. This means that when the prompt first displays itself, there will still be various output from things that are still starting. In order to work around this we send a signal to pid 1 to tell systemd to stop outputting stuff on the console, thus allowing us to show a clean prompt.

But obviously if you specifically don't want to hide all the output, telling systemd stop outputting stuff is likely orthogonal to your general aim too. Thus you likely don't want to send this signal to pid 1 in getty@.service, but also you likely don't want to start the getty until everything is totally finished... Sadly this isn't too easy right now in Mageia 2. In newer versions of systemd we can (and do) only start the getty when things are idle. That is, it will wait for everything else to finish before it starts.

So I'm afraid I've not really got a great solution for you as things stand. I would however suggest that you maybe don't need to do this any more anyway. Previously it was hard to get a good overview of how things went at startup, but now you can just run "systemctl" and see a full report of exactly what services are started and whether any of them failed on boot. It's actually much nicer to use than looking at the boot log. So maybe the need is now just gone?

Another solution would be to simply disable getty on tty1? This way you'll get your output happily and you can switch to tty2 to login whenever you like.

An even hackier solution would be to put a "ExecStartPre=/bin/sleep 20" in the unit... I'd make sure this customised unit was only used for tty1 (and leave the getty@.service untouched for ttys 2-6).


Anyway I think our upstream goals of making the login prompt available as early as possible is orthoganal to your goal somewhat. With newer systemd you'll ultimately be able to make it work using Type=idle, but for now I think I've covered all your options :s

Sorry I can't be more helpful here.
colin
 
Posts: 53
Joined: Jul 25th, '11, 11:15

Re: Console screen clears when prompting for login

Postby colin » Jun 6th, '12, 11:40

As a conincidence this popped up today:
http://cgit.freedesktop.org/systemd/sys ... bb7f81311f

It doesn't solve the problems outlined above, but it explains what magic setting clears it :)
colin
 
Posts: 53
Joined: Jul 25th, '11, 11:15

Re: Console screen clears when prompting for login

Postby feretio » Jun 6th, '12, 15:31

Wonderful! Setting TTYVTDisallocate to "no" in getty@.service made all my dreams come true (well, at least this "dream")! :-)

Thanks for all your help!

-Jeff
feretio
 
Posts: 14
Joined: May 31st, '12, 16:40

Re: Console screen clears when prompting for login

Postby colin » Jun 6th, '12, 15:35

Well, like I say, I suspect that the line in the unit that does:
ExecStartPre=-/bin/kill -55 1
will cause any messages that should be going to the console to be hidden. So you may miss some "late boot" messages as a result. This is not really solvable until the Type=idle support is available which is unlikely to happen in Mageia 2 I'm afraid.

Maybe this is OK tho'? Either way, glad I could help a little.
colin
 
Posts: 53
Joined: Jul 25th, '11, 11:15

Re: Console screen clears when prompting for login

Postby feretio » Jun 6th, '12, 15:44

Yes, it helps enormously. if need be, I can use dmesg or the system logs to see any tail end messages but at least I can see the last page. I started turning the screen clear off when every now and then I'd notice and say, "what was that?" just before it cleared.

In addition, you also showed me the proper way to customize systemd. I'm used to the xml files in Solaris's service manager (which is similar in concept and function) and haven't gotten around to figuring out how to do the same with systemd.

Again, thanks!

-Jeff
feretio
 
Posts: 14
Joined: May 31st, '12, 16:40

Re: Console screen clears when prompting for login

Postby isadora » Jun 6th, '12, 19:20

Image
..........bird from paradise..........

Perfection is achieved, not when there is nothing more to add, but when there is nothing left to take away.
—Antoine de Saint-Exupéry
User avatar
isadora
 
Posts: 2766
Joined: Mar 25th, '11, 16:03
Location: Netherlands


Return to Basic support

Who is online

Users browsing this forum: No registered users and 1 guest

cron