1

I want to spawn a little TUI program instead of the shell on a raspberry-pi on the standard tty (without x11 of course)

Therefore I need to know how to switch of the starting of the standard-shell there and how to start my own program?

Using Raspbian9 with systemd

1 Answer 1

3

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.

3
  • There is no such folder, only /usr/lib/systemd/ exists Jan 11, 2019 at 10:18
  • Then your distro probably keeps unit files in /lib/systemd/system/ instead. Jan 11, 2019 at 10:38
  • You 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 Jan 11, 2019 at 12:57

You must log in to answer this question.

Not the answer you're looking for? Browse other questions tagged .