1

I am running systemd on ArchLinux. I have read various posts of doing this but it seems impossible (i.e. I am incompetent in implementing this:)) ). I want to disable the on-demand tty spawning of systemd and start ttys on Ctrl+Alt+F1-4 and Ctrl+Alt+F6-11 during boot. On /etc/systemd/logind.conf I have :

[Login]
NAutoVTs=9

but KDE still starts on tty7 (i.e. I press Ctrl+Alt+F7 to see the desktop). I have created the files:

/etc/systemd/system/getty@tty2.service.d/autologin.conf
/etc/systemd/system/getty@tty3.service.d/autologin.conf
/etc/systemd/system/getty@tty4.service.d/autologin.conf
/etc/systemd/system/getty@tty6.service.d/autologin.conf
/etc/systemd/system/getty@tty7.service.d/autologin.conf
/etc/systemd/system/getty@tty8.service.d/autologin.conf
/etc/systemd/system/getty@tty9.service.d/autologin.conf
/etc/systemd/system/getty@tty10.service.d/autologin.conf

that contain:

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

but this did not help either.

Anthon
  • 79,293
Konstantinos
  • 1,120

1 Answers1

0

I want to disable the on-demand tty spawning of systemd and start ttys […] during boot.

This is fairly simple. The X server is grabbing the kernel virtual terminal before any login service is started on it, because your login services are only being started on demand. You want to turn that off, and rather than on-demand start the login services have them all explicitly started at bootstrap, the way Things Used To Be.

  • logind does the moral equivalent of systemctl start autovt@ttyN.service whenever you switch to kernel virtual terminal N. To turn that off, just set NAutoVTs=0 as the doco says.
  • To have systemd explicitly start all of the services, simply enable instances of the getty@.service template on each terminal in the normal way:

    for i in 1 2 3 4 6 7 8 9 10 11 
    do 
        systemctl enable getty@tty$i.service
    done

The only problem that one might hit is that older versions of systemd cannot enable template instantiations, and you have to construct the symbolic link by hand instead:

for i in 1 2 3 4 6 7 8 9 10 11 
do 
        ln -s -f -- /lib/systemd/system/getty@.service /etc/systemd/system/getty.target.wants/getty@tty$i.service
done

Making your X server(s) play nicely with this, I leave up to you. ☺

Further reading

JdeBP
  • 68,745