Dit deel is nog niet vertaald. Je ziet de Engelse tekst.
Wat het doet
systemd-analyze shows how long the boot took (time), which units took the most time (blame) and which chain of units was the slowest (critical-chain). It also checks unit files for errors (verify), tests calendar expressions for timers (calendar) and rates the sandboxing of services (security).
Zo schrijf je het
systemd-analyze [OPTION]... [COMMAND] [ARGUMENT]...Belangrijkste delen
time- Boot time in kernel, initrd and user space.
blame- Units sorted by start time.
critical-chain[UNIT]- The slowest chain of dependencies.
plot- SVG picture of the boot.
dot[PATTERN]- Dependency graph in dot format.
verifyFILE...- Check unit files for errors.
security[UNIT]- Rate the security settings of services.
calendarSPEC...- Test an OnCalendar= expression.
timestampTIME...- Parse a time stamp.
timespanSPAN...- Parse a time span.
cat-configNAME|PATH- Show a config file with all its drop-ins.
unit-paths- Folders where unit files are searched.
unit-files- List unit files and aliases.
conditionCONDITION...- Test Condition=/Assert= lines.
exit-status[STATUS]- Exit status names and numbers.
capability[CAP]- Capability names and numbers.
syscall-filter[SET]- System call sets for SystemCallFilter=.
filesystems[SET]- File system sets.
dump- Full state of the manager (debug).
compare-versionsV1[OP]V2- Compare version strings.
inspect-elf,malloc,fdstore,image-policy,pcrs,srk- Special tools.
Opties 27
Meest gebruikt
Niets past bij dit filter.
Voorbeelden 10
$ als gewone gebruiker# als root (of met sudo)
1How long did the boot take?
systemd-analyze Startup finished in 1.204s (kernel) + 2.810s (initrd) + 9.512s (userspace) = 13.527s multi-user.target reached after 9.480s in userspace.Same as
systemd-analyze time.2Which units are slow?
systemd-analyze blame | headUnits that start in parallel can still look slow here.
3The slowest chain
systemd-analyze critical-chainThe real reason for a slow boot.
4Check a unit file for errors
systemd-analyze verify /etc/systemd/system/hello.serviceShows typos and unknown settings before you start it.
5Test a timer expression
systemd-analyze calendar --iterations=3 'Mon..Fri 02:30'Shows the next 3 run times.
6Rate service security (DevSecOps)
systemd-analyze security systemd-analyze security httpd.serviceLists missing hardening settings with a score.
7Fail a CI check on weak settings
systemd-analyze security --offline=true --threshold=5 ./myapp.serviceExit code not 0 when the score is above 5.
8Picture of the boot
systemd-analyze plot > boot.svgOpen it in a browser.
9See a config with all drop-ins
systemd-analyze cat-config systemd/journald.confThe real settings, from all files.
10Time spans and exit codes
systemd-analyze timespan 1h30m; systemd-analyze exit-status 203203 = EXEC: the program in ExecStart could not be run.
Niets past bij dit filter.
Exitcodes
0 :: Done. 1 :: Error (also verify problems or a score above --threshold).