39. SYSTEM INIT: SYSTEMD, SYSTEMV AND UPSTART Flashcards
Learning Objectives
By the end of this chapter, you should be able to:
- Understand the importance of the init process.
- Understand how systemd (and Upstart) arose and how they work.
- Use systemctl to configure and control systemd.
The init Process
What is the first user-level process (or task) run on the system and continues to run until the system is shutdown?
- /sbin/init (usually just called init)
The init Process
Traditionally the init process it has been considered the ___ of all user processes, although technically that is not true, as some processes are started directly by the kernel.
- parent
The init Process
the init process coordinates the?
later stages of the boot process, configures all aspects of the environment, and starts the processes needed for logging into the system. init also works closely with the kernel in cleaning up after processes when they terminate.
The init Process
Traditionally, nearly all distributions based the init process on UNIX’s venerable ___ software. However, this scheme was developed decades ago under rather different circumstances:
- The target was multi-user mainframe systems (and not personal computers, laptops, and other devices)
- The target was a single processor system
- Startup (and shutdown) time was not an important matter; it was far less important than getting things right.
Startup was viewed as a serial process, divided into a series of sequential stages (termed run levels). Each stage required completion before the next could proceed. Thus, startup did not easily take advantage of the parallel processing that could be done on multiple processors or cores.
Secondly, shutdown/reboot was seen as a relatively rare event, and exactly how long it took was not considered important; today Linux systems usually boot in a manner of seconds.
- SysVinit
The init Process
Three most common implementations include? ___, ___ and ___, but all major distributions have now moved to ___.
Modern systems have required newer methods with enhanced capabilities that ___ software provides.
- systemd
- Upstart
- SysVinit
- systemd
Startup Alternatives
To deal with the intrinsic limitations in ___, new methods of controlling system startup were developed. While there are others, two main schemes were adopted by Enterprise distributors.
What are these two main schemes?
- SysVinit
- Upstart
- systemd
Migration to systemd was non-trivial and bugs and missing features could be very disabling, so essential compatibility layers were adopted and still exist for legacy software. Thus, SysVinit utility compatibility wrappers still persist.
The history of systemd development and adoption is rather complicated, and colorful personalities ensured not all the discussion was both friendly and technical. But this holy war is over as far as we are concerned here.
In the following, we will concentrate on systemd, and, for the most part, ignore SysVinit as well as Upstart, which is no longer used in any significant way.
Startup Alternatives
Give a little history on startup alternative schema of Upstart from a high level perspective, not how it works.
Upstart
- Developed by Ubuntu and first included in 2006.
- Adopted in Fedora 9 (in 2008) and in RHEL 6 and its clones.
- Was also used in various embedded and mobile devices.
Startup Alternatives
Give a little history on startup alternative schema of systemd from a high level perspective, not how it works.
systemd
- Fedora was the first major distribution to adopt it in 2011.
- RHEL and SUSE followed.
- Ubuntu 16.04 replaced Upstart with systemd.
- All important Linux distributions are now based on systemd.
systemd Features
The systemd system and session manager for Linux is now dominant in all major distributions. Features include the following:
- Boots faster than previous init systems
- Provides aggressive parallelization capabilities
- Uses socket and D-Bus activation for starting services
- Replaces shell scripts with programs
- Offers on-demand starting of daemons
- Keeps track of processes using cgroups
- Maintains mount and automount points
- Implements an elaborate transactional dependency-based service control logic
- Can work as a drop-in replacement for SysVinit and is compatible with SysVinit scripts.
Note that systemd is backward compatible with SysVinit and the concept of runlevels is supported via runlevel targets. The telinit program is emulated to work with runlevels.
systemd Features
Instead of bash scripts, systemd uses ___ files. In addition, systemd sorts all daemons into their own Linux cgroups (control groups).
- .service
systemd Configuration Files
Although systemd prefers to use a set of standardized configuration files, it can also use distribution-dependent legacy configuration files as a fall-back.
An example of a new configuration file would be /etc/hostname, which would replace /etc/sysconfig/network in Red Hat, /etc/HOSTNAME in SUSE, and /etc/hostname (adopted as the standard) in Debian.
Other files might include:
- /etc/vconsole.conf: default keyboard mapping and console font.
- /etc/sysctl.d/*.conf: drop-in directory for kernel sysctl parameters.
- /etc/os-release: distribution ID file.
Exactly which configuration files will depend on how each distribution sets things up; for example, /etc/vconsole.conf, which configures virtual terminal defaults, does not appear on Ubuntu systems.
systemd is backward compatible with SysVinit, so using old commands will generally work. It supports the use of runlevels conceptually, through the mechanism of a runlevel targets. In addition, telinit is emulated to work with runlevels.
systemctl
systemctl is the main utility for?
It’s basic syntax is?
- managing services
- $ systemctl [options] command [name]
systemctl
What is the command to show the status of everything that systemd controls?
- $ systemctl
systemctl
What is the command to show all available services?
$ systemctl list-units -t service –all