ttylogin-starter 1 user commands nosh
ttylogin-starter demand-start ttylogin@.service services on active kernel virtual terminals
`ttylogin-starter` --verbose

## Description

`ttylogin-starter` automatically runs system-control 1 to start a `ttylogin@.service` service on kernel virtual terminals as they are switched-to. It does not apply to user-space virtual terminals or to real terminals.

Conventionally, in the absence of `ttylogin-starter`, TUI login services for all terminals are enabled and disabled in the usual way; and started as a consequence of being wanted by the `multi-user` target. The external configuration file import subsystem will `preset` all relevant `ttylogin@.service` services, using the ttys 5 database (and any presets) to determine whether a TUI login service is enabled or disabled, as explained in system-control 1.

### BSDs

On the BSDs, the conventional mechanism applies to all terminals, virtual and real. `ttylogin-starter` does nothing on the BSDs, except pause forever. It exists for script compatibility only.

### Linux

On Linux, one can alternatively arrange, for just kernel virtual terminals specifically, for TUI login services to be started on-demand, as the terminals are switched to and become the "active" kernel virtual terminal, rather than have them always running. This is done by disabling all kernel virtual terminals and letting `ttylogin-starter` start them on-demand, which it does with the `system-control` start command, ignoring the disabled state of the service.

It does this by looping forever, monitoring the state of the `/sys/class/tty/tty0/active` file with poll 2. This file reports the currently active kernel virtual terminal name. Each time that poll 2 reports a change in the currently active virtual terminal, `ttylogin-starter` starts the TUI login service for that terminal.

If the services do not exist, it makes no attempt to create them.

## Compatibility

Currently, no provision is made for excluding kernel virtual terminals that are used by X servers or by console-fb-realizer 1. `ttylogin-starter` should not be used in conjunction with either of those, and instead the normal service enable/disable mechanism should be employed.

## See also

linux-vt 4

  Kernel virtual terminal switching on Linux

## Author

Jonathan de Boyne Pollard