systemd-nspawn, systemctlMain Linux components include:
Grub or systemd-boot, loads kernel and starts
init.
Interacts with the hardware, some low-level processes (e.g. wireguard).
Primarily systemd (alternatives include
runit, etc). Starts long-running tasks.
System responsible for securily installing applications into the environemnt.
Session managers, window managers, graphical applications, etc.
/bin - user binaries./sbin - system binaries./lib - .so files, internal binaries,
kernel modules./etc - configuration files./tmp - temporary files, cleared on boot./var - runtime files./opt - locally installed applications./boot - kernels, .efi and such./dev - pseudo. all peripherals and block devices./run - normally tmpfs, used for runtime data like
secrets that shouldn't be written to disk./proc - pesudo. process tree.Describes various components operated on by systemd.
Uses
systemdctl -t helpto see all types,systemctl list-unitsto see all units available on the machine.
Common types:
fstab but systemd.Common targets:
poweroff.target: shutdown.rescue.target: rescue shell.multi-user.taget: nongraphical multiuser.graphical.target: graphical multiuser.reboot.target: reboot.Unit example:
[Unit]
ConditionSecurity=audit
Description=Kernel Auditing
[Service]
ExecStart=@audit-disable audit-start
ExecStop=@audit-stop audit-stop
RemainAfterExit=true
Type=oneshot
[Install]
WantedBy=basic.targetsystemd-nswpawnGives you some interesting controls, integrates with the systemd ecosystem (targets, timers, etc.). Otherwise not much better than any other container runtime.
All systemd services log stdout/stderr (configurable) to
joutnalctl, which also includes logs from systemd
itself.
systemd-run can launch a binary in an environment
controlled by systemd.
Xorg and Wayland are methods of displaying objects to screen. Xorg is a single server and wayland is a protocol, which requires any wayland server. Session managers handle login, run specific window managers from a specific user. Window managers handle displaying windows. Graphical environment (Gnome, KDE, etc.) do all of that.
When building graphical environemnt you should choose between Xorg and Wayland, unless you use a GE which handles that for you.
Just use sddm.
Can be tiling, do window placement, run on Xorg or Wayland.
Tiling on Xorg:
i3 and forksbspmwXmonadTiling on Wayland:
sway and forkshyperlandawesomewmSee terminals for
ttyinternals.
Main function of a terminal is translating keystrokes into
tty actions and displaying its output.
Can run on Wayland or Xorg, provide various features depending on how much you want. Important features include tabs, GPU rendering, ligatures.
Examples:
kitty - also supports images.alacrittystKDE, Gnome and Xfce are primary examples. Run on Wayland, but that's configurable. Chose whichever looks better to you.
pulseaudio and
pipewire.dunst.picom.In graphical environments main avenue of IPC is D-Bus. It allows applications to trigger code execution in other applications, get structured information from them. Example of D-Bus usage is reading currently playing song from a web-browser. KDE, GNOME and other DE's utilize it heavily for communication between different components or for providing interface to lower-level components like power management.
Servers work generally the same apart from not having graphical environment. Newer approach to servers sees them as fully temporary - services should be independent of their environment, servers themselves should be declarative as much as possible. Popularized by cloud computing, this approach makes for simpler deployment, scaling, etc.
Under a declarative approach deployment of a service doesn't require any actions apart from realising saved configuration. Examples of fully declarative tools include Terraform and NixOS.
A concept, meaning that almost the entire FS tree is treated as temporary files. Under this concept, any necessary state is declared ahead of time and stored separately. Containers are impermanent, and this concept can be applied to physical servers too.
Key tools in running a Linux installation include:
find/fdgrep/ripgrepsedConsider vim and tmux.
If storage allows, use backup software like btrbk,
restic or burp. Encrypt backups if needed.