The Init System¶
The G3 module uses a traditional System V Init system. It is time tested, reliable and does not suffer from the bloat or over complexity of the currently trendy systemd init system. The two downsides to System V Init are that it is a completely serial process so the generation of instant gratification tends to become impatient with boot times that exceed a few nano-seconds. And it does not really handle service dependencies well so system administrators must be vigilent when adding new services to ensure they start in the proper order. Despite these minor issues, Reach Technology is firmly committed to the KISS1 principle.
The System V Init system is predicated on the premise of several “run levels”.
Unlike Windows where you just get maintainance (repair) mode or The Full Monty,
Linux breaks the system state into several functional levels which can greatly
simplify root causing service failures. Additionally, the System V Init system
gives one great control over the order in which system components or services
are launched2. This is accomplished via a series of “rc” directories in /etc
.
Each of these directories contains a series of symbolic links that start with
either S or K followed by a 2 digit number and the name of the init
script that it links to. The S links start a service while the K links
stop it. All of the init scripts live in /etc/init.d
. The table below lists
the various runlevels, the “rc” directory and the purpose of the runlevel3.
Directory |
Description |
---|---|
rcS.d |
The Sysinit run level… initial boot stuff |
rc0.d |
The Halt run level… shutdown services and halt the processor4 |
rc1.d |
The Single User run level… only root can login on the console |
rc2.d |
The Multi User run level… normal users can login on local serial connections |
rc3.d |
The MU with Networking run level… multi-user with networking turned on |
rc4.d |
The MU, Networking, Services run level… add services and remote login over the net |
rc5.d |
The MU, Networking, Services, Applications run level… add applications |
rc6.d |
The Reboot run level… shudown services and warm reboot the processor |
As discussed in more detail in the optional services configuration section,
many of the optional services are easily controlled using the chkconfig
utility.
The tool manipulates the S and K symlinks for the service using information
contained in a specially formatted comment block near the top of the associated
init script.
Please see
Footnotes:
- 1
Keep It Simple, Stupid!
- 2
With great power comes great responsibility! Carelessly changing the order in which services are started or stopped is quite likely to cause errors and/or service/application failures. Note that if you change the order of start/stop of optional services that are controlled by
chkconfig
, you need to ensure that the comment block at the top of the init script is updated to reflect your changes.- 3
A number of “modern” Linux distros have deprecated the multiple run level approach as most desktop users are more familiar with the overly simplistic and inflexible approach promulgated by Windows. Of course, the simpler approach is often easier for Joe Sixpack to deal with, but Reach Technology believes there is signficant value to embedded systems in the flexibility offered by the traditional init system run levels.
- 4
On systems capable of software power control, the system will also power down.