So I'm currenly learing sysVinit. I know that at startup /bin/login has to be started in order to display a login prompt but I couldn't find a file that starts it. Is it started by default in terminals specified in inittab or what's going on there?
It is started by getty after the username is input.
- Init starts /bin/agetty (or another getty) on each terminal, according to inittab
- Getty initializes the terminal, shows /etc/issue and the "login:" prompt
- User enters the login name
- Getty execs /bin/login with the username as parameter
- Login shows the password prompt (internal or from PAM)
(Note: login was also used for remote Telnet logins (although not by ssh logins), and the process was similar: telnetd would show the username prompt, and would start login for password prompt.)
In systemd, the process is nearly the same: init starts agetty according to
getty@<tty>.service, and agetty starts login.