runlevels
- In OpenRC and SysVInit, different runlevels represented different states of Linux environment.
- Scripts were configured to run as a runlevel was started or stopped
- Format was
/etc/rc[runlevel].d/[SK][Priority]-[Process]
- E.g.
/etc/rc3.d/S20-NetworkManager
, a script starting withS
in the name, would start NetworkManager when entering runlevel 3. The priority would ensure the file order, soS20-NetworkManager
would run ahead ofS25-my-process
/etc/rc5.d/K10-gnome
, a script starting withK
in the name, would run a script when exiting runlevel 5
- E.g.
Main runlevels:
- Runlevel 0 = Shut down the system
- Runlevel 1 = Rescue system (single user)
- Runlevel 3 = Multiuser system (standard command line system)
- Runlevel 5 = GUI system (e.g. start X11 and a Desktop Environment)
- Runlevel 6 = Restart the system
Not applicable in systemd systems, where control is replaced with unit files