Initialization Scripts System Startup

Or continue with multi−user startup by entering [Ctrl−D] 2. If [Ctrl−D] is entered, the system continues with the multi−user startup, as in the previous case.

4.2.6 Initialization Scripts

Once the init process is born, the system startup is determined by a series of rc initialization scripts which define a detailed procedure to bring the system into the multi−user mode. This is the most common case, although other system modes run−levels are also possible. These files control all custom−defined and site−dependent items there are multiple rc initialization scripts, and they are executed sequentially. Generally, rc initialization scripts represent Bourne shell script files, executable at any time and on any UNIX platform. The Bourne shell is the default shell, and it is available at the very early system stage on every UNIX platform. The rc initialization scripts do not differ from any other shell script, except at the time of their execution. This, by the way, is why the prefix rc is used in their description, as well as in the name. However, they can also be executed from the command line at any time, and administrators can make full use of this opportunity: on System V, individual function−specific initialization scripts are often used to stop and start specific UNIX functions during regular system production. On modern UNIX platforms, sometimes Korn shell rc initialization scripts are also included for example, on the HP−UX platform which indicated the early availability of the Korn shell. Understanding rc initialization scripts is a vital part of system administration — this is the place for system customization. A system administrator must be familiar with these files, their locations and, in many cases, their contents. Only then is full control over the system startup possible, and quick corrective action can follow any problem encountered during system boot time. Each modification in the initialization scripts must be done very carefully with respect for the basic administrative rule: save original script files before making any changes. If this rule is not followed, various problems can ensue. Despite the fact that rc initialization scripts on both UNIX platforms BSD and System V serve the same purpose, the mechanisms by which they are initiated and executed are quite different. These differences require great attention, knowledge, and skills from system administrators working in a heterogeneous environment, which is very common today. Today, the System V rc approach prevails — the System V organization of the rc initialization scripts offers more flexibility and other administrative advantages. We will discuss System V initialization in greater detail after a quick survey of the BSD−style initialization.

4.3 BSD Initialization

4.3.1 The BSD rc Scripts

Originally, the BSD initialization was controlled only by two rc initialization scripts: etcrc and etcrc.local. A general system initialization was supported by the etcrc script, while the etcrc.local script referred to a local site, i.e., to issues that should be customized probably a more appropriate script name would be rc.site to avoid any possible confusion toward the logical association with a network−local relationship. During system booting to the multi−user mode, init executed the rc script, which in turn executed the rc.local script. If a single−user boot was performed, scripts were only partially executed; the remaining parts were executed when the single−user shell was exited. 95