Previous Page | Next Page

  1. Introduction
  2. Abbreviated Boot
  3. The Boot Process
  4. Startup and Run Levels
  5. Initialization Scripts
  6. Runlevel Scripts
  7. Login Process
  8. Bash Shell
  9. Filesystems
  10. LILO, Kernel and Root Filesystem
  11. The Kernel
  12. Passwords, Users, Groups, and Quotas
  13. The Environment
  14. The /etc/sysconfig directory
  15. The /proc filesystem
  16. Process Control
  17. Devices
  18. Daemons Services
  19. Inetd and Network Services
  20. Programs and Libraries
  21. Security and PAM
  22. The printer services
  23. Mouse support with gpm
  24. Mail
  25. News
  26. UUCP
  27. LDAP
  28. NFS and RPC
  29. Samba, NetBIOS, WINS, nmbd
  30. Identd (auth)
  31. Telnet and FTP
  32. Apache web server
  33. DNS and named
  34. How X Works
  35. X Scripts
  36. Support for Text
  37. Keymapping for Programs
  38. Keycode Table
  39. Example Keymap File
  40. Terminfo Commands
  41. VT100 ESC sequences
  42. Kernel Revisited
  43. Configuration Files
  44. Credits

Linux Run level scripts

The runlevel scripts are used to bring up many system and networking functions. Since some functions are interdependent on other functions there is some required order in which these scripts must be run in order to bring the system up and to bring it gracefully down. Each runlevel has its own set of start(S) and kill(K) scripts but all these scripts are supported in the directory /etc/rc.d/init.d. This is because the start and kill scripts are soft links to the files in the /etc/rc.d/init.d directory.

The rc script Program

The script file /etc/rc.d/rc is run for the appropriate runlevel (typically 3 or 5) This file does the following:

  1. It gets the previous and current system runlevels.
  2. If the word confirm is in the file "/proc/cmdline" if sets up to run the scripts below in user confirmation mode.
  3. All kill files (files whose first letter is 'K') in the subdirectory "/etc/rc.d/rc3.d" (assuming the previous runlevel was 3) are run. The parameter stop is usually passed on the command line to the kill script.
  4. All startup files (files whose first letter is 'S") in the subdirectory "/etc/rc.d/rc5.d" (assuming the current runlevel is 5) are run. The parameter start is usually passed on the command line to the kill script.

These runlevel scripts are used to bring up (or down) various system services such as cron and gpm along with networking services from the network cards through Samba, and servers like DNS, DHCP, and NFS. A directory listing of the files in the /etc/rc.d/init.d will reveal the many possible services that the system can support.

drwxr-xr-x   2 root     root         4096 May  5 10:00 .
drwxr-xr-x  10 root     root         4096 Apr 28 04:08 ..
-rwxr-xr-x   1 root     root          766 Sep 13  1999 amd
-rwxr-xr-x   1 root     root         1231 Sep 20  1999 apmd
-rwxr-xr-x   1 root     root          827 Sep  9  1999 arpwatch
-rwxr-xr-x   1 root     root          989 Aug 16  1999 atd
-rwxr-xr-x   1 root     root         4816 Sep 20  1999 autofs
-rwxr-xr-x   1 root     root         1011 Dec 20 08:21 bootparamd
-rw-------   1 root     root      1101824 Mar  2 11:25 core
-rwxr-xr-x   1 root     root         1031 Sep 10  1999 crond
-rwxr-xr-x   1 root     root          975 Apr 28 04:19 dhcpd
-rwxr-xr-x   1 root     root         7386 Sep 20  1999 functions
-rwxr-xr-x   1 root     root         1417 Aug 16  1999 gated
-rwxr-xr-x   1 root     root         1261 Sep 24  1999 gpm
-rwxr-xr-x   1 root     root         3129 Sep 20  1999 halt
-rwxr-xr-x   1 root     root          865 Sep 21  1999 httpd
-rwxr-xr-x   1 root     root         1151 Sep 13  1999 identd
-rwxr-xr-x   1 root     root         1463 Sep 10  1999 inet
-rwxr-xr-x   1 root     root         1924 Aug 30  1999 innd
-rwxr-xr-x   1 root     root         6029 Sep 24  1999 isdn
-rwxr-xr-x   1 root     root         1203 Sep  5  1999 keytable
-rwxr-xr-x   1 root     root          449 Sep 11  1999 killall
-rwxr-xr-x   1 root     root         1172 Sep 24  1999 kudzu
-rwxr-xr-x   1 root     root         1890 Sep 13  1999 ldap
lrwxrwxrwx   1 root     root           43 Dec 17 05:25 linuxconf -> /usr/lib/linuxconf/redhat/scripts/linuxconf
-rwxr-xr-x   1 root     root         1176 Sep 10  1999 lpd
-rwxr-xr-x   1 root     root         1104 Sep 10  1999 mars-nwe
-rwxr-xr-x   1 root     root         1171 Sep 24  1999 mcserv
-rwxr-xr-x   1 root     root         1331 Sep 24  1999 named
-rwxr-xr-x   1 root     root         3217 Sep 20  1999 netfs
-rwxr-xr-x   1 root     root         6573 Sep 21  1999 network
-rwxr-xr-x   1 root     root         2257 Sep 24  1999 nfs
-rwxr-xr-x   1 root     root         1722 Sep 24  1999 nfslock
-rwxr-xr-x   1 root     root         1603 Sep 20  1999 nscd
-r-xr-xr-x   1 root     root         3439 Sep 27  1999 pcmcia
-rwxr-xr-x   1 root     root         1086 Sep 10  1999 portmap
-rwxr-xr-x   1 root     root         2435 Sep 26  1999 postgresql
-rwxr-xr-x   1 root     root         1260 Sep 25  1999 pulse
-rwxr-xr-x   1 root     root          955 Sep 26  1999 pxe
-rwxr-xr-x   1 root     root         1532 Feb  4  1999 random
-rwxr-xr-x   1 root     root         1270 Sep 10  1999 routed
-rwxr-xr-x   1 root     root          780 Sep 22  1999 rstatd
-rwxr-xr-x   1 root     root          974 Sep 22  1999 rusersd
-rwxr-xr-x   1 root     root          941 Aug 16  1999 rwalld
-rwxr-xr-x   1 root     root          882 Sep  9  1999 rwhod
-rwxr-xr-x   1 root     root         1549 Sep  1  1999 sendmail
-rwxr-xr-x   1 root     root         1451 Apr 15  1999 single
-rwxr-xr-x   1 root     root         1177 Sep 25  1999 smb
-rwxr-xr-x   1 root     root          851 Aug 31  1999 snmpd
-rwxr-xr-x   1 root     root         2306 Sep 11  1999 squid
-rwxr-xr-x   1 root     root         1027 Dec 21 14:04 syslog
-rwxr-xr-x   1 root     root         1033 Jan 10 06:40 xfs
-rwxr-xr-x   1 root     root         1212 Aug 16  1999 xntpd
-rwxr-xr-x   1 root     root         1575 Sep 22  1999 ypbind
-rwxr-xr-x   1 root     root         1084 Aug 17  1999 yppasswdd
-rwxr-xr-x   1 root     root         1137 Aug 17  1999 ypserv

These services are can be functionally categorized as a system service or a network service. They are described in more detail in the section on Daemons and Services. For more information on how some of the script files for these services run, read the Linux startup Manual. Normally any of these services may be stopped, started, restarted, or status be checked by typing the name of one of these services (with the correct path) followed by the word stop, start, restart, or status respectively. For example the line:

/etc/rc.d/init.d/nfs restart

will restart network file sharing assuming it was running. To see the status type:

/etc/rc.d/init.d/nfs status

The rc.local Script Program

The file "/etc/rc.d/rc3.d/S99.local" is a link file to the file "/etc/rc.d/rc.local". This file doesn't do much except for setting up the "/etc/issue" and "/etc/issue.net" files to reflect the system version when a user begins a terminal or telnet session. This is where most administrators will put any system customizations they want to make.