Five exercises covering Linux boot process investigation, systemd target management, X11 and Wayland session identification, display manager configuration, and system localization — the foundation of understanding how Linux starts and presents its interface.
dmesg -T | head -50 (kernel ring buffer, human-readable timestamps)dmesg -T --level=err,warn | head -30journalctl -b --no-pager | head -60systemd-analyze — shows total boot timesystemd-analyze blame | head -20systemd-analyze critical-chainwho -b and uptime -sgrep -E "GRUB_TIMEOUT|GRUB_CMDLINE" /etc/default/grub 2>/dev/nulllsmod | wc -l (count) and lsmod | grep -i nvidia 2>/dev/null (specific module)NetworkManager-wait-online.service, which waits for full network connectivity before continuing. On servers, this is often unnecessary. Disable it safely: systemctl disable NetworkManager-wait-online.service. Another common offender is snapd. The boot time breakdown (firmware + loader + kernel + userspace) is diagnostically useful: if firmware time is high, the BIOS is the bottleneck; if userspace is high, a service is the culprit. The critical chain output directly shows which service was the last dependency holding back the final target — that is your highest-impact optimization candidate.systemctl get-defaultsystemctl list-units --type=targetsystemctl list-unit-files --type=targetsystemctl status default.targetsudo systemctl isolate multi-user.target — the GUI will close if runningsudo systemctl isolate graphical.targetsudo systemctl set-default multi-user.targetsudo systemctl set-default graphical.targetsystemctl get-defaultsystemctl isolate immediately switches to the target and stops all services not in that target's dependency tree. If you isolate to multi-user.target while using a GUI, your desktop session will end. Always verify you have console access or SSH access before isolating on a remote machine. Never isolate to rescue.target on a production system without physical console access — you will lock yourself out.graphical.target does not replace multi-user.target, it extends it. The isolate command is the equivalent of telinit N from SysVinit, but acts on targets. The /etc/systemd/system/default.target symlink is how the default is set — if you ever need to diagnose a broken default, verify which target that symlink points to. On servers, set multi-user.target as default: it saves the memory overhead of the entire display stack (~50-200MB depending on the desktop environment).echo $XDG_SESSION_TYPE — outputs "x11" or "wayland"echo $WAYLAND_DISPLAY — set only in Wayland sessionsecho $DISPLAY — typically set in X11 sessions (e.g., :0)ps aux | grep -E "Xorg|wayland|weston|sway|gnome-shell" | grep -v grepls -la /tmp/.X*-lock 2>/dev/null — X11 creates lock files per displayxdpyinfo 2>/dev/null | head -20 (X11 only; fails on Wayland)which Xorg Xwayland 2>/dev/nulldpkg -l | grep -E "^ii.*xorg|wayland" 2>/dev/null | head -20 or rpm -qa | grep -E "xorg|wayland" 2>/dev/null | head -20XWayland is a compatibility bridge — it provides an X11 server as a Wayland client, allowing X11 apps to run inside a Wayland session at the cost of the security boundary for those apps.cat /etc/X11/default-display-manager 2>/dev/nullsystemctl status display-manager.service — the loaded unit shows the active DMdpkg -l | grep -E "gdm|lightdm|sddm|xdm" 2>/dev/null or rpm -qa | grep -E "gdm|lightdm|sddm"ls -la /etc/systemd/system/display-manager.servicesystemctl cat display-manager.service | head -5sudo dpkg-reconfigure lightdm (interactive) or manually: sudo systemctl disable gdm3 && sudo systemctl enable lightdmsystemctl status display-manager.servicecat /etc/lightdm/lightdm.conf 2>/dev/nullsudo systemctl restart display-manager.service — this will restart the GUI login screensystemctl restart display-manager. On a remote headless server, changing the display manager without physical or console access can leave you locked out if the new DM fails to start correctly. Always test on a non-production machine first.localectl or localetimedatectl — shows local time, UTC time, and timezonetimedatectl list-timezones | grep -E "Tokyo|UTC|New_York" | head -10sudo timedatectl set-timezone UTCtimedatectl | grep "Time zone"localectl list-locales | grep -E "fr_FR|en_US" | head -10sudo localectl set-locale LANG=en_US.UTF-8localectl list-keymaps | grep -E "^fr$|^us$|^de$" | head -10sudo localectl set-keymap frlocalectl — should show locale and keymapdate and date -u (UTC comparison)timedatectl set-timezone UTC on every server. Let your log aggregation tool (Splunk, Elasticsearch, Graylog) convert to local time for display. Also note: LANG controls the locale for the entire system (date formats, number formats, error message language), while LC_ALL overrides all locale settings including LANG. In scripts, always set LANG=C or LC_ALL=C to get predictable English ASCII output regardless of system locale — locale-aware commands like sort behave differently with different locales.