Chapter 8. Creating system boot scripts

Table of Contents
Preparing the directories and master files
Creating the reboot script
Creating the halt script
Creating the mountfs script
Creating the umountfs script
Creating the sendsignals script
Creating the checkroot script
Creating the sysklogd script
Creating the setclock script (PPC systems only)
Setting up symlinks and permissions
Creating the /etc/fstab file

These bootscripts are started at system boot time. The scripts are responsible for mounting the root file system in read-write mode, activating swap, setting up some system settings and starting the various daemons that our system needs.

Preparing the directories and master files

You need the Sysvinit package again for this section.


cd /etc
mkdir rc0.d rc1.d rc2.d rc3.d rc4.d rc5.d rc6.d init.d rcS.d


#!/bin/sh
# Begin /etc/init.d/rcS

runlevel=S
prevlevel=N
umask 022
export runlevel prevlevel

trap ":" INT QUIT TSTP

for i in /etc/rcS.d/S??*
do
  [ ! -f  "$i" ] && continue;
    $i start       
done

# End /etc/init.d/rcS