In systemd, local virtual consoles are managed by getty@.service
and serial lines by serial-getty@.service
. Both start the agetty program which initializes a few tty parameters, displays the banner, and the "login:" prompt.
For your program, it's best to just use the existing unit as a base, and change it to run the custom program.
Copy /usr/lib/systemd/system/getty@.service
to /etc/systemd/system/myapp@.service
. Edit your new file to have the correct program in ExecStart=, and additionally add a line Conflicts=getty@%i.service
in the [Unit] section.
Test with systemctl start myapp@tty1
. If it works, disable the original getty@tty1.service through systemctl and enable your own.
There is no such folder, only
/usr/lib/systemd/
exists – Theo Freeman – 2019-01-11T10:18:01.307Then your distro probably keeps unit files in
/lib/systemd/system/
instead. – user1686 – 2019-01-11T10:38:33.497You meant to write
Conflicts=getty@%I.service
, with uppercase 'I', correct?Thanks for the great advice so far, this seems to be the right way, but when I try to start my service everything except a blinking underscore in tty1 disappears – Theo Freeman – 2019-01-11T12:57:05.617