2

I'm configuring TTY auto login, so I followed the official guide, created a file named autologin.conf in /etc/systemd/system/getty@tty1.service.d, containing the following lines:

[Service]
ExecStart=
ExecStart=-/usr/bin/agetty --autologin XX --noclear %I 38400 linux

I did this for both tty1 and tty3.

Now when my system boots, I can see the bash prompt on tty1, but my autorun scripts for tty3 doesn't run at all. (The script is in ~/.bashrc, it runs if $(tty) equals to /dev/tty3)

Any ideas?

P.S If I modify getty@.service directly, adding the autologon, it works perfectly, the auto run scripts for tty3 executes.

EDIT

I also noticed if I press ALT + F3 manually, after switching to tty3, the script get executed as well.

2

I found this thread which I think is your issue. The thread is titled: systemd: autologin to tty1 problems, sounds like your issue.

note: As of systemd 30, only 1 getty will be launched by default. If you switch to another tty, a getty will be launched there (socket-activation style). You can still force additional agetty processes to start using the above methods.

I think you need to add another getty service file.

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.