Running Services at Boot
Although most people consider a computer to be either on or off, in Ubuntu
and Linux in general, there are a number of states in between. Known as
runlevels, they define what system services are started upon boot. These
services are simply applications running in the background that provide some
needed function to a system, such as getting information from the mouse and
sending it to the display; or a service could monitor the partitions to see
whether they have enough free space left on them. Services are typically
loaded and run (also referred to as being started) during the boot process, in
the same way as Microsoft Windows services are. For a while, Ubuntu used a
system known as Upstart instead of the classic and venerable SysVinit;
Upstart had a special backward-compatibility layer that could use runlevels in
the way that Linux veterans are accustomed to doing for services not
otherwise handled by Upstart. Starting in 2015, Ubuntu switched to another
system called systemd. You’ll learn more about runlevels, Upstart, and
systemd later in this chapter.
INIT SYSTEMS
There are many ways to describe init systems, but this quote from a thread
at Reddit.com is hard to beat (capitalization and spelling errors are from the
original):
“To understand the fuss, there are 3 init systems that you should be aware
of: sysvinit, upstart and systemd. SyvVinit is really old, outdated and only
allows for a sequential startup of services, that is, all services started by init
must wait for the previous service to have completed their startup process
before the next can startup. Both upstart and systemd are designed to tackle
the limitations of init, and allows for concurrent service initialization, that
is, multiple services can startup at the same time, as long as they are not
dependent on each other, and allows taking advantage of multi core
processing. They also allow for services to startup and shutdown for
specific events, such as a network connection going up or another service
has started. Upstart was developed by Canonical was initially released in
2006 and was used in Ubuntu, Debian, Fedora, RHEL, CentOS, and many
others. Systemd is a much younger system that was initially released in
2011, however, most major distros has already migrated to using systemd
by default.
“Both Upstart and Systemd are event based, however their architecture and
configuration setup are very different and this is where the worrying comes
from. If the configurations aren’t ported correctly then systems are going to
behave differently to what’s expected and this can lead to issues for many