Forget about run-levels.
When run-levels were introduced in AT&T Unix System 3 (Yes, /etc/inittab
arrived in System 3 not System 5.) there were mutterings in the BSD world, and the BSDs never adopted this system.
All of these years later, most parts of the System 5 world have now done away with run-levels.
IBM thought that people could forget about run-levels in 1990. In IBM AIX version 3.1, because of the advent of the System Resource Controller, the number of run levels used in practice shrunk to just 1, run level number 2. Run levels 1 and 3 to 9 were "reserved" from that point onwards.
Some two decades later in the Linux operating system world, the systemd people declared run-levels to be "obsolete" in their doco (twice).
The van Smoorenburg rc
scripts in /etc/init.d/
that one might think involve run-levels are processed by a backwards compatibility mechanism that turns them into native service units; which largely ignores the provided run-level information, contained in both the scripts themselves and in the /etc/rc.d/
subdirectories, and just directly hardwires some targets in its code.
Like the IBM SRC before it, and like many other systems (such as Solaris' SMF, MacOS's launchd, Laurent Bercot's s6-rc, Gerrit Pape's runit-init, or the nosh system management toolset); systemd does not employ the concept of run-levels.
There are instead better mechanisms, of various kinds, in these systems.
runit has the concept of switching amongst several scan directories.
s6-rc has the concept of switching the "live state".
The nosh system-control
has the concept of target service bundles that want/
or conflict/
with other service bundles.
The Solaris SMF has "milestones" such as milestone/multi-user-server
, milestone/self-assembly-complete
, and milestone/name-services
.
… and so on.
The idea of run-levels was in fact only used natively by two system management systems in the Linux world, van Smoorenburg init
+rc
(which was a clone, that was made a decade afterwards, of the AT&T system) and Joachim Nilsson's finit.
BusyBox init has an /etc/inittab
configuration file, but (as commentary in the file itself explains) that is different to the more common one, and employs no notion of run-levels.
Upstart had a compatibility runlevel
event, but it was a compatibility shim and not a native part of the system management.
The one operating system bucking the trend was TrueOS.
Based upon FreeBSD, which still itself uses Mewburn rc
and FreeBSD init
(neither of which have a run-level mechanism), it adopted OpenRC to replace Mewburn rc
.
Ironically, it thereby added run-levels to a BSD seven years after the System 5 side of the universe had finally consigned run-levels to the dustbin of history.