1

APUE says

The BSD terminal login procedure has not changed much over the past 35 years. The system administrator creates a file, usually /etc/ttys, that has one line per terminal device. Each line specifies the name of the device and other parameters that are passed to the getty program. When the system is bootstrapped, the kernel creates process ID 1, the init process, and it is init that brings the system up in multiuser mode. The init process reads the file /etc/ttys and, for every terminal device that allows a login, does a fork followed by an exec of the program getty.

My Ubuntu doesn't have /etc/ttys but /etc/tty0

$ ls /etc/tty*
/etc/tty0
$ file /etc/tty0  
/etc/tty0: ASCII text
$ cat /etc/tty0  
tty0

$ dpkg -S /etc/tty0
dpkg-query: no path found matching pattern /etc/tty0

Does /etc/tty0 work the same as /etc/ttys?

In general, what is the relation between /etc/tty0 and /dev/tty0?

Thanks.

Tim
  • 101,790

1 Answers1

3

I don’t think /etc/tty0 is used in Ubuntu, I’m not sure where that file came from on your system.

With sysvinit, the equivalent to /etc/ttys is /etc/inittab. You can see an example of an inittab with getty settings in Debian’s version.

With systemd, there is no single equivalent file. getty setup is managed using the getty@ and getty-serial@ services.

Stephen Kitt
  • 434,908
  • In Unix inittab was only the equivalent to ttys for about three quarters of a decade. In the real System 5 init system, by 1988 this functionality had been removed from inittab and given to the Service Access Facility, which could start/stop services at runtime. https://lists.debian.org/debian-user/2018/11/msg00616.html – JdeBP Dec 01 '18 at 11:36
  • @JdeBP indeed; I was only considering Linux’s history, with sysvinit. (I should address Upstart too, since we’re talking about Ubuntu, but I’m not familiar enough with that.) – Stephen Kitt Dec 01 '18 at 14:47