Startup Scripts

A common task for many shell programmers is writing system startup scripts. In this section, you will develop a basic system startup script that can be reused (after a little editing). Before you begin, let's look at a little background into the UNIX system startup and initialization.

System Startup

When a UNIX system starts, the first program to be executed is init (usually located in /sbin). This program is responsible for system startup and initialization. In early versions of UNIX, init was aided in this by the script /etc/rc. This script handled all of the nitty-gritty details of system initialization such as checking the disks, starting the networking layers, and enabling console and remote login programs.

When a system ...

Get Sams Teach Yourself Shell Programming in 24 Hours, Second Edition now with the O’Reilly learning platform.

O’Reilly members experience books, live events, courses curated by job role, and more from O’Reilly and nearly 200 top publishers.