In systemd, local virtual consoles are managed by [email protected]
and serial lines by [email protected]
. 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/[email protected]
to /etc/systemd/system/[email protected]
. 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 [email protected] through systemctl and enable your own.