120 likes | 318 Views
Linux Booting. A Typical PC boot. POST (Power on self test) Boot loader (grub, lilo) Kernel Init RC startup scripts. What a Kernel Does?. Logins, Gettys and shells. A getty is a program that spawns a login program. Gettys are “generally” spawned from init.
E N D
A Typical PC boot • POST (Power on self test) • Boot loader (grub, lilo) • Kernel • Init • RC startup scripts
Logins, Gettys and shells • A getty is a program that spawns a login program. • Gettys are “generally” spawned from init. • A shell is the program that the users interact directly with. • A shell provides the user with a command prompt.
init • When it starts up, init reads the /etc/inittab configuration file. While the system is running, it will • re−read it, if sent the HUP signal (kill −1 1 ); this feature makes it unnecessary to boot the system to makechanges to the init configuration take effect. • The /etc/inittab file is a bit complicated. We'll start with the simple case of configuring getty lines.
General Syntax of inittab • id:runlevels:action:process • 1:2345:respawn:/sbin/getty 9600 tty1 • Id-This identifies the line in the file. For getty lines, it specifies the terminal it runs on (the characters after /dev/tty in the device file name). For other lines, it doesn't matter, but it should be unique. • Runlevels-The run levels the line should be considered for. The run levels are given as single digits, without • delimiters.
General Syntax of inittab Con’t • Action- What action should be taken by the line, IE), respawn to run the command in the next field again, when it exits, or once to run it just once. • Process- The command to run.
Linux Run Levels • 0 Halt the system. • 1 Single−user mode (for special administration). • 2 Local Multiuser with Networking but without network service. • 3 Full Multiuser with Networking • 4 Not Used • 5 Full Multiuser with Networking and X (GUI) • 6 Reboot.
RC Startup Scripts • In each run−level you will find a series of scripts that are run on boot up. The location of these scripts will vary between Linux distributions Generally the first script that is executed is • rc.K or rc.S.
rc.0@ rc.4* rc.6* rc.K* rc.M* rc.S* rc.acpid* Rc.alsa* rc.atalk rc.bind rc.cups rc.dnsmasq rc.font.new* rc.hotplug* rc.httpd rc.inet1* rc.inet1.conf rc.inet2* rc.inetd* rc.ip_forward rc.local* rc.modules* rc.mysqld rc.nfsd* rc.pcmcia* rc.portmap RC Startup scripts (Slackware) /etc/rc.d/ rc.samba rc.saslauthd rc.sendmail* rc.serial* rc.sshd* rc.syslog* rc.sysvinit* rc.udev rc.wireless* rc.wireless.conf rc.yp*
rc.0- Runlevel 0 rc.4- Runlevel 4 rc.6- Runlevel 6 rc.K- Single User rc.M- Multi-user rc.S- System rc.bind- DNS Server rc.cups-Print Server rc.inet1-Network Config rc.inet2-Network Service rc.nfsd- Network File System rc.pcmcia-PC support rc.syslog- System log Select “Important” Scripts