Init
First the init program opens it's config file "/etc/inittab". Lets have a look at it (open /etc/inittab here).
The first non-commented line in my inittab specifies the default runlevel. Unix runlevels are used to
represent the state of the machine at a given time along with what services are available in the given
state. A short description of each is below:
- 0: halt
- 1: single user, admin recovery mode
- 2: user defined
- 3: console login
- 4: user defined
- 5: graphical login, X11
- 6: reboot
1:2345:respawn:/sbin/getty/ 38400 tty1The first field matches the tty number by tradition, but is supposed to be the execution order for the init program (not important). The next field specifies which runlevels to execute this program in. The next field specifies the action to be taken by this entry, which in our case is respawn. This means, execute the program we specifiy and when it exits, just start the program again indefinitely. The next parameter is the actual program and its parameters. Our program in this case is getty and we specify the baud rate (38400) and port (tty1). This is significant because (as the next couple of commented entries in inittab show) you can use getty to listen to a serial port as well. The next commented entry also shows that you can use a program called mgetty, which knows how to speak to modems, to allow text login via a modem for a dialup user. (try to login to machine with palm pilot here).
![[logo]](logo.png)