From ceb67d42f511ab0ee62bed0c8744460e74c216bc Mon Sep 17 00:00:00 2001 From: Simon Barth Date: Mon, 10 Nov 2025 21:57:24 +0100 Subject: [PATCH 1/3] man: Fix systemd-analyze exit-status example output The output of `systemd-analyze exit-status` changed in commit e04ed6db6b44681b7a7876b9c4a1e6adaf877670, so that the exit-status class for EXIT_SUCCESS and EXIT_FAILURE is "libc" instead of "glibc". This commit makes the example output in the man-page match the actual output again. --- man/systemd-analyze.xml | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/man/systemd-analyze.xml b/man/systemd-analyze.xml index fb95a3ec53..927748bdc5 100644 --- a/man/systemd-analyze.xml +++ b/man/systemd-analyze.xml @@ -464,7 +464,7 @@ $ eog targets.svg <command>systemd-analyze exit-status <optional><replaceable>STATUS</replaceable>...</optional></command> This command prints a list of exit statuses along with their "class", i.e. the source of the - definition (one of glibc, systemd, LSB, or + definition (one of libc, systemd, LSB, or BSD), see the Process Exit Codes section in systemd.exec5. If no additional arguments are specified, all known statuses are shown. Otherwise, only the @@ -475,8 +475,8 @@ $ eog targets.svg $ systemd-analyze exit-status 0 1 {63..65} NAME STATUS CLASS -SUCCESS 0 glibc -FAILURE 1 glibc +SUCCESS 0 libc +FAILURE 1 libc - 63 - USAGE 64 BSD DATAERR 65 BSD From 62aba7c5cdb657f0194674b97fa216ce324bdb35 Mon Sep 17 00:00:00 2001 From: Simon Barth Date: Mon, 10 Nov 2025 22:27:57 +0100 Subject: [PATCH 2/3] shell-completion: bash: Add systemd-analyze filesystems --- shell-completion/bash/systemd-analyze | 17 +++++++++++++++++ 1 file changed, 17 insertions(+) diff --git a/shell-completion/bash/systemd-analyze b/shell-completion/bash/systemd-analyze index 8d05544941..a6861013b8 100644 --- a/shell-completion/bash/systemd-analyze +++ b/shell-completion/bash/systemd-analyze @@ -56,6 +56,15 @@ __get_architectures() { systemd-analyze --no-legend --no-pager architectures 2>/dev/null | { while read -r a b; do echo " $a"; done; } } +__get_filesystem_sets() { + local line + systemd-analyze filesystems --no-pager 2>/dev/null | while IFS= read -r line; do + if [[ $line == @* ]]; then + printf '%s\n' "$line" + fi + done +} + _systemd_analyze() { local i verb comps mode local cur=${COMP_WORDS[COMP_CWORD]} prev=${COMP_WORDS[COMP_CWORD-1]} words cword @@ -86,6 +95,7 @@ _systemd_analyze() { [TRANSIENT_SETTINGS]='transient-settings' [UNIT_SHELL]='unit-shell' [UNIT_GDB]='unit-gdb' + [FILESYSTEMS]='filesystems' ) local CONFIGS='locale.conf systemd/bootchart.conf systemd/coredump.conf systemd/journald.conf @@ -265,6 +275,13 @@ _systemd_analyze() { else comps=$( __get_services $mode ) fi + + elif __contains_word "$verb" ${VERBS[FILESYSTEMS]}; then + if [[ $cur = -* ]]; then + comps='--help --version --no-pager' + else + comps=$( __get_filesystem_sets ) + fi fi COMPREPLY=( $(compgen -W '$comps' -- "$cur") ) From a049825708d0c2835df6784faf0c397e1fb3988f Mon Sep 17 00:00:00 2001 From: Simon Barth Date: Tue, 11 Nov 2025 20:59:30 +0100 Subject: [PATCH 3/3] shell-completion: bash: Add systemd-analyze calendar options Add completion for the systemd-analyze calendar options --iterations and --base-time. --- shell-completion/bash/systemd-analyze | 8 +++++++- 1 file changed, 7 insertions(+), 1 deletion(-) diff --git a/shell-completion/bash/systemd-analyze b/shell-completion/bash/systemd-analyze index a6861013b8..a863af7aff 100644 --- a/shell-completion/bash/systemd-analyze +++ b/shell-completion/bash/systemd-analyze @@ -77,7 +77,7 @@ _systemd_analyze() { ) local -A VERBS=( - [STANDALONE]='time blame unit-files unit-paths exit-status compare-versions calendar timestamp timespan pcrs nvpcrs srk has-tpm2 smbios11 chid image-policy' + [STANDALONE]='time blame unit-files unit-paths exit-status compare-versions timestamp timespan pcrs nvpcrs srk has-tpm2 smbios11 chid image-policy' [CRITICAL_CHAIN]='critical-chain' [DOT]='dot' [DUMP]='dump' @@ -96,6 +96,7 @@ _systemd_analyze() { [UNIT_SHELL]='unit-shell' [UNIT_GDB]='unit-gdb' [FILESYSTEMS]='filesystems' + [CALENDAR]='calendar' ) local CONFIGS='locale.conf systemd/bootchart.conf systemd/coredump.conf systemd/journald.conf @@ -282,6 +283,11 @@ _systemd_analyze() { else comps=$( __get_filesystem_sets ) fi + + elif __contains_word "$verb" ${VERBS[CALENDAR]}; then + if [[ $cur = -* ]]; then + comps='--help --version --iterations --base-time' + fi fi COMPREPLY=( $(compgen -W '$comps' -- "$cur") )