Systemd Doku
Doku: https://fedoraproject.org/wiki/How_to_debug_Systemd_problems
https://www.digitalocean.com/community/tutorials/understanding-systemd-units-and-unit-files
Systemctl
Alle services listen
systemctl list-units --type=service
Auf "active" filtern
systemctl list-units --type=service --state=active
oder Gesamtüberblick über alle, die gerade laufen
# systemctl list-units --type=service --state=running OR # systemctl --type=service --state=running
Journalctl
Boot Vorgänge auflisten
journalctl –-list-boots
Auflisten aller Boot Vorgänge - 0 ist der neueste
journalctl –-boot [id]
Auswählen eines bestimmten Bootvorgangs
Basic Log Viewing
Auflisten der Logs vor dem letzten Bootvorgang
''journalctl -b -1''
Dasselbe, aber gefiltert auf kernel logs
''journalctl -b -1 -k''
Mit "GG" wird das Ende des jeweiligen Logs erreicht, also die letzten Zeilen vor dem Reboot
To see the logs that the journald daemon has collected, use the journalctl command. When used alone, every journal entry that is in the system will be displayed within a pager (usually less) for you to browse. The oldest entries will be up top:
journalctl If you want to display the timestamps in UTC, you can use the –utc flag: journalctl –utc
===== Journal Filtering by Time =====
While having access to such a large collection of data is definitely useful, such a large amount of information can be difficult or impossible to inspect and process mentally. Because of this, one of the most important features of journalctl is its filtering options. Displaying Logs from the Current Boot
The most basic of these which you might use daily, is the -b flag. This will show you all of the journal entries that have been collected since the most recent reboot.
journalctl -b This will help you identify and manage information that is pertinent to your current environment. In cases where you aren't using this feature and are displaying more than one day of boots, you will see that journalctl has inserted a line that looks like this whenever the system went down: . . . – Reboot – . . .
This can be used to help you logically separate the information into boot sessions. Past Boots
While you will commonly want to display the information from the current boot, there are certainly times when past boots would be helpful as well. The journal can save information from many previous boots, so journalctl can be made to display information easily.