
Linux and the Init System
Introduction
- Where it all begins - Init
- Services and System Initialisation
- The System V Init System
- The BSD Init System
- SysVinit 2.64 package
Where it all begins - Init
- The father of all processes
- Spawned from the kernel
- init creates all processes
- Has process ID 1
- Runs processes in /etc/inittab
- Run Levels
- Software configuration
- A selection of processes running concurrently
- Usually set by:
- kernel parameter
- initdefault setting in /etc/inittab
- running telinit
- Predefined run levels
- 0 - Halt
- 1 - Single user mode
- 2 - Multiuser, without NFS
- 3 - Full multiuser mode
- 4 - unused
- 5 - X11
- 6 - reboot
Services and System Initialisation
- Services
- Usually daemons that can be started and stopped
- Don't change the system state
- System Initialisation
- Run once only, usually at boot
- Change the state of the system
- Examples are:
- Register Fixes
- Network Configuration
- Both do different things
- Both are necessary
System V Init System
- Service Centric
- Central idea of services
- Services stored in /etc/rc.d/init.d
- Organised by Run Level
- Links to services in rc.< run level >.d directories
- Services Start and Stop
- Scripts accept 'start' and 'stop' as parameter
- K??service stops services
- S??service starts service
- Control done by single script
- /etc/rc.d/rc
- Ordered Execution
- ?? above is a number
- Initialisation done by /etc/rc.d/rc.*
BSD Init System
- Initialisation Centric
- /etc/rc.d/rc.*
- Scripts are intended to initialise system
- Organised by function
- Run Level Centric
- Organised by run level
- Scripts must stop and start daemons
The SysVInit Package
- The De Facto Standard
- Most distributions use this package
- System V Init Style
- Consistent with FSSTND
- /etc/inittab
- /etc/rc.d/rc?.d/*
- /etc/rc.d/init.d/*
- /var/lock/subsys
- Available as a Package for Most Distributions
- Debian Package
- RPM Package
- Available as a tar.gz
- Current Version 2.64
A Quick Tour
Questions