BusyBox init
BusyBox has a minimal init
program that uses an /etc/inittab
configuration file to start programs at bootup and stop them at shutdown. The actual work is done by shell scripts, which, by convention, are placed in the /etc/init.d
directory.
init
begins by reading /etc/inittab
. This file contains a list of programs to run, one per line, in this format:
<id>::<action>:<program>
The roles of these parameters are:
id
: The controlling terminal for the commandaction
: When and how to run the programprogram
: The program to run along with all its command-line arguments
The actions are:
sysinit
: Runs the program wheninit
starts before any of the other types of actions.respawn
: Runs the program and restarts it if it terminates. It is used to run a program as a daemon.askfirst
: The same asrespawn
, but it prints the message Please press Enter to activate this console to the console and runs...