2

I'd like to use a different tty program than agetty on my debian jessie machine (specifically, qingy). The tty creation is controlled by systemd via the (auto-created as I understand) /etc/systemd/system/getty.target.wants/getty@tty1.service

What is the "systemd way" for modifying/controlling/replacing agetty as my default tty?

cleary
  • 224

1 Answers1

2

The systemd way is to create a service template that starts your alternative TTY login service …

[Unit]
Description=Qingy on %I
Documentation=info:qingy
BindTo=dev-%i.device
After=dev-%i.device systemd-user-sessions.service plymouth-quit-wait.service

[Service]
Environment=TERM=linux
ExecStart=/sbin/qingy %I --no-shutdown-screen
Restart=always
RestartSec=0
UtmpIdentifier=%I
TTYPath=/dev/%I
TTYReset=yes
TTYVHangup=yes
TTYVTDisallocate=yes
KillMode=process
IgnoreSIGPIPE=no
KillSignal=SIGHUP

[Install]
WantedBy=getty.target

… and then to make sure that the autovt@.service template is an alias for this instead of for getty@.service, as it is out of the box.

ln -s qingy@.service /etc/systemd/system/autovt@.service
systemctl daemon-reload

(Note that this is not modifying the pre-packaged /lib/systemd/system/autovt@.service that comes in the box. This is using systemd's conventional /etc//lib dichotomy to override it with a local, administrator-defined, one.)

Stop an existing autovt@ttyN.service and let logind auto-start it again, to see this take effect.

Further reading

JdeBP
  • 68,745
  • 1
    autovt@.service can be found under /lib/systemd/system/, the debian qingy package installs to /usr/sbin/qingy (not /sbin/qingy) plus it seems to be broken anyway - I couldn't get the syntax for the binary to run properly. I've ended up attacking the problem from a different (simpler) perspective which was a lightweight dm. I've abandoned a dm at all, use the text/getty login, and a line in my .bashrc checks if I'm in tty1 and if so runs startx. I'm not sure of correct etiquette in marking this resolved or not, because I can't confirm... (sorry stackexchange newbie here) – cleary Dec 10 '15 at 03:16