System V style init daemon. Narrowing the search with the additional key phrase of "System V" gives much
better results. The sysvinit package contains init, shutdown, halt and reboot which is everything we need.
The version listed in the LSM entry looks to be pretty old, but there is a primary−site URL that will probably
lead to the latest version.
6.2.3. Checking dependencies
The manpage for init mentions a FIFO called
/dev/initctl
that is required for init to communicate with
other programs in the sysvinit package. We will have to create this file for init to function properly.
6.2.4. Designing a simple GRUB configuration file.
Using a GRUB configuration file is slightly more complex than specifying the bootloader commands
manually. There are directives for features like menus, default selections and timeouts that need to be
specified in the configuration file as well as the familiar kernel loading command. The info page for GRUB
gives much of the necessary information. We may also be able to use the GRUB configuration file on the
development system as a template. However, there is some inconsistency between vendors as to the name and
location of the file. Regardless of what the path is on the development system it should be
/boot/grub/menu.lst
on the Pocket Linux System.
6.2.5. Outlining start−up scripts
Many of the popular GNU/Linux distributions use System V style init scripts. Since we are using a "sysvinit"
daemon it makes sense to use System V style scripts as well. The following documents all touch upon the
System V style init scripts in some way and will serve as references when building the scripts for this project:
The Debian Policy Manual −− available online at http://www.debian.org/doc/debian−policy.
•
The Linux Standard Base specification −− downloadable in many formats from
http://www.linuxbase.org/spec/index.shtml.
•
Essential System Administration, 3rd Edition by Aeleen Frisch −− available at libraries, bookstores or
directly from O'Reilly Publishing at http://www.oreilly.com/.
•
After glancing at one or two of the above references we should have a pretty good idea of how the System V
style system initialization process works. We should also know what it takes to create System V style init
scripts for the Pocket Linux project. Below is a brief list of what needs to be done:
Create an
inittab
file to call an
rc
script with a numerical argument giving the runlevel.
•
Write an
rc
script that uses the runlevel argument to execute the appropriate "K" and "S" scripts.
•
Modify the previously built
local_fs
script to take
start
and
stop
arguments.
•
Create new scripts for
shutdown
and
reboot
.
•
Set up
/etc/rcN.d
directories and links to scripts in
/etc/init.d
.
•
As always, the BASH(1) manpage and the Advanced BASH Scripting Guide are very helpful for writing and
understanding shell scripts.
Pocket Linux Guide
Chapter 6. Automating Startup & Shutdown
29