As of the March 2012 Indigo release, the initialization sequence was changed to use the runit services framework provided by busybox.
The sequence is now as follows:
- /etc/inittab has an "sv" entry that calls the /sbin/runsvdir-start shell script.
- /sbin/runsvdir-start invokes runsvdir on the /service directory.
- /etc/rc.sh is invoked.
/etc/rc.sh performs the following:
- Kernel drivers are loaded.
- indigo-preinit.sh is sourced if it exists.
- /etc/system_init is run if it exists.
/etc/system_init performs the following:
- Overlay is applied if it exists.
- Additional kernel drivers are loaded.
- For out-of-band management, the management interface is configured.
- Symlinks to the services in /etc/sv that are to be started are added to /service.
- indigo-postinit.sh is sourced if it exists.
Because runsvdir invokes only those services in /service, the presence or absence of symlinks within /service allows us to control which services are started.
For each service in /service, runsvdir invokes runsv, which in turn invokes /service/<service_name>/run. Because runsvdir uses readdir() to walk the /service directory, services are not started in any explicit order.
Each service is invoked from its respective "run" script. As required by runsv, each service is configured run in the foreground and log to stdout.
For each service that requires logging, the /service/<service_name> directory contains a "log" subdirectory:
- /service/<service_name>/log/config is the log configuration file that controls the number of log files and their size
- /service/<service_name>/log/run is a shell script that takes care of copying the log configuration file from /etc/sv/<service_name>/log and starting up the actual logging process svlogd.
Add Comment