systemd Flashcards
which dictates how a systemd-based Linux computer will boot up. An innovation of systemd is that it removed the need to have shell scripts The problem with Bash scripts is that they have to be ran
through the Bash interpreter, and these end up spawning new processes for each command within the shell script. Each one of these processes then have to open up a library file for the functions that a command will need. All in all, this is an inefficient use of time to get services started, which in turn slows down the speed with which the system could boot or a service to start.
systemd unit files
To get around this problem the developers of systemd replaced many of the shell scripts
with equivalent functionality written in C code, which is then compiled to run much faster.
Not all shell scripts could be replaced, but each one that is replaced by C code is a win for speed and efficiency. This does not mean that you cannot use the older System V init scripts anymore.
Systemd still has a compatibility mechanism to read these older script files and still use them.
The caveat is that the older System V init scripts will not enjoy the same robustness that they would get from a patch daemon that works directly with systemd, such as socket activation, parallel startup,
and other features. Nonetheless, the point remains that even though systemd is different, it is still backwards compatible.
bash script problem
what are known as unit files default location where unit files are installed by packages.
instead of bash files systemd utilizes
location of first unit file and it should never be edited
/usr/lib/systemd/system
this unit file is safe to edit any unit files in this location will take precedence
over any other unit files on the system.
/etc/systemd/system
The other location of systemd unit files is the runtime location
/run/systemd/system
can view all of the unit files on your computer by running systemctl and the output of this command is divided up into different sections,each one pertaining to a particular type of unit
list-unit-files
unit that syncs up other units when the computer boots or changes state
target
multi-user system, similar to what runlevel 3 provided
multi-user.target
multi-user system with a desktop environment, similar to what runlevel 5 provided
graphical.target
pulls in a basic system and file system mounts and provides a rescue shell
rescue.target
basic system, used during the boot process before another target takes over
basic.target
system initialization
sysint.target
defines the target unit configuration
man 5 systemd.target
listing of all target units and definitions
man 7 systemd.special