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/[email protected]

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

cleary
  • 214
  • 2
  • 9

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 [email protected] template is an alias for this instead of for [email protected], as it is out of the box.

ln -s [email protected] /etc/systemd/system/[email protected]
systemctl daemon-reload

(Note that this is not modifying the pre-packaged /lib/systemd/system/[email protected] 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
  • 66,967
  • 12
  • 159
  • 343
  • 1
    **[email protected]** 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