linuxsystemdttyautologin

How to auto login tty2 with systemd?


I am upgrading my entertainment system's os from wheezy to jesse. Apparently they have gone from using init to systemd. On my old system, I have a program written in C that runs my entertainment system. This is launched after auto login from tty1. It then auto logins tty2 user which is able to force tty1 to dump the currect user and auto login again (because sometimes the program gets stuck).

But under systemd, I can only seem to figure out how to get tty1 to auto login. The problem seems to be that systemd will only auto login tty2 when it has been activated. I mean you need to swtich to tty2 before the auto login is done.

How do I go about forcing tty2 to auto login without needing to ctrl-alt-F2?

Currently tty1 will auto login and tty2 will autologin only when switched to that terminal.


Solution

  • You can enable the getty service on tty2 explicitly:

    systemctl enable getty@tty2
    

    If you explicitly enable it, it'll be started during boot and not just once when the tty2 is activated.