1
1
mirror of https://github.com/systemd/systemd-stable.git synced 2025-08-29 01:50:15 +03:00
Commit Graph

565 Commits

Author SHA1 Message Date
6105f9bb03 shell-completion: fix completion of systemctl --user unset-environment (#37409)
Co-authored-by: Eisuke Kawashima <e-kwsm@users.noreply.github.com>
(cherry picked from commit 6d07d23b022d48898d9a2e7181ab6493d3d61c43)
(cherry picked from commit 11c16d414ebbcb13e39971d90ece4a1e0db183d2)
(cherry picked from commit 003a0bb9e3bfef9ab99ce409ea08d6fb544440d0)
(cherry picked from commit bd47958cdc)
(cherry picked from commit 2403c1ebb9)
(cherry picked from commit 02d6a05230)
2025-05-18 23:10:50 +01:00
0d658a7f15 shell completion: fix machinectl import-{tar,raw}
Signed-off-by: Arthur Zamarin <arthurzam@gentoo.org>
(cherry picked from commit 3eb329bfb5)
(cherry picked from commit aff1099b0a)
(cherry picked from commit 863a7bbfbf)
(cherry picked from commit 845f38a340)
2024-05-09 18:47:40 +02:00
aa090ddec9 Update _udevadm
(cherry picked from commit 3623a7ea83)
(cherry picked from commit 36ecc6f0ad)
(cherry picked from commit b323db294a)
(cherry picked from commit 4c11a62caf)
2024-04-26 02:30:13 +02:00
862700824a man, shell-completion: fix a few typos/language issues
(cherry picked from commit c959e17823)
(cherry picked from commit 4fb223fdc6)
(cherry picked from commit cff6c392c1)
(cherry picked from commit 7ba1a3238e)
2024-04-26 02:30:13 +02:00
19c2983db3 zsh/_journalctl: complete -g, --case-sensitive, 'help' (pseudo-)facility
(cherry picked from commit da9e1f8322)
(cherry picked from commit ffd829531c)
(cherry picked from commit 0ea962ea17)
(cherry picked from commit 4685299c68)
2024-04-26 02:30:13 +02:00
785e0d5d72 analyze: fix -q option
Follow-up to 52117f5af8

(cherry picked from commit 7c0e0bbb6b)
(cherry picked from commit b0d2940997)
(cherry picked from commit a36677b4a4)
(cherry picked from commit 4c16effc39)
2024-01-26 21:35:39 +00:00
274d645bdf bash completion: make systemctl mount-image/bind autocomplete on active services
The verb works only on running service units, so complete on that as the first
parameter, and a local file as the second. The other parameters are inside the
service namespace so we can't autocomplete from the outside, return early.

(cherry picked from commit c24c63e946)
(cherry picked from commit cf76701212)
(cherry picked from commit 13344b62b3)
(cherry picked from commit aef67b7e58)
2024-01-26 21:35:39 +00:00
1e25741909 bash completion: add systemctl service-log-level/target
(cherry picked from commit 79272d3098)
(cherry picked from commit 8bfc0e2d5c)
(cherry picked from commit a16958daaf)
(cherry picked from commit 1102c149aa)
2024-01-26 21:35:39 +00:00
11d5deb7d3 shell-completions: code cleanup
(cherry picked from commit 05ebcbd5c5)
(cherry picked from commit 307a5e8ef4)
(cherry picked from commit 2cf4bbd373)
2023-09-08 16:35:10 +01:00
80be287dba zsh: reintroduce pattern argument to uncached verbs
The systemctl completion previously made use of PREFIX as a pattern
argument to list-unit-files and list-units. This had the problem of
erroneously filtering the results that were stored in the cache, and
erroneously filtering results that might have been requested according
to the users configuration (e.g. _correct completer, certain
matcher-lists or tag-orders, etc.).

Unfortunately, the runtime of list-unit-files increases when no pattern
argument is provided, and systemctl show, used to filter those units,
can become unacceptably slow when provided with too many units to
describe.

Let's re-introduce the pattern argument to list-unit-files and
list-units where necessary in order to alleviate these bottlenecks
without poisining the cache. A 'use-pattern' style is introduced that
may be used to disable this behavior if it is undesired. We can still
expect that certain completions, like `systemctl start <TAB>` will be
slow, like before. To fix this we will need systemd to learn a more
efficient way of filtering the units than parsing systemctl show.

(cherry picked from commit 2cbda74862)
(cherry picked from commit dfc0445cb8)
(cherry picked from commit 7ca3cae97b)
2023-08-10 09:43:05 +01:00
af20c4f05c zsh: use sys_really_all_units for non-template names
The systemctl invocations used for these completions match the ones used
for the _sys_really_all_units parameter, so we should really just use
the cached parameter rather than recomputing the result.

(cherry picked from commit c8e2cd79c1)
(cherry picked from commit 9814972198)
(cherry picked from commit f664081482)
2023-08-10 09:43:05 +01:00
0baf6bc34d Fix zsh completion for "localectl set-locale"
When running:

    $ localectl set-locale LC_MESSAGES=<TAB>

One is prompted with a list of locale fields instead of the list of
valid locales. This is because by calling "compset -P1 '*='", we modify
the $PREFIX special parameter before testing whether it contains an
equal sign. Therefore

    if [[ -prefix 1 *\= ]]

is always false, and we always suggest a list of locale fields to the
user.

Fixes: #27955
(cherry picked from commit 3c6fefd879)
(cherry picked from commit a2ad241994)
2023-07-08 10:42:52 +01:00
e274201190 shell completion: add timesync-status and show-timesync to zsh completion file (#27574)
Fixes #27560

(cherry picked from commit 2ad681f53c)
(cherry picked from commit 951c27ce14)
2023-06-02 13:42:21 +01:00
a8bbd2f4ce zsh: add service-log-{level,target} completions for systemctl
(cherry picked from commit b3d12ac0da)
(cherry picked from commit c31e2fa9c7)
2023-06-02 13:42:21 +01:00
ac7c88ae02 zsh: remove usage of PREFIX in _systemctl
The usage of PREFIX in this completion is mostly counter to the intended
usage of compsys in zsh. It is generally expected that completion code
provide the available completions and tags in that word position so that
compsys, with user configuration, can filter them to the appropriate set.

One egregious error caused by the usage of PREFIX here is the caching of
SYS_ALL_UNITS, which stored only the unit names prematurely filtered by
the completion prefix, affecting all future completions. For example,

  $ systemctl cat nonsense<TAB>

might find no matching units if nonsense* has no matches, but now

  $ systemctl cat <TAB>

will fail in all future completions even though every unit file
is a valid match, because the cached set has been erroneously filtered
by the last prefix.

(cherry picked from commit 8139407ec1)
(cherry picked from commit a25605d01d)
2023-06-02 13:42:21 +01:00
7eefa3f21f coredumpctl: add --file/--root/--image to bash completion
(cherry picked from commit 448ed94dd9)
(cherry picked from commit abf9e916ad)
2023-05-02 21:16:34 +01:00
83548e2d8b coredumpctl: fix bash completion matching
When multi-word matching string is quoted, __contains_word compares
it as a whole to the passed option, so it doesn't work.

(cherry picked from commit 20ed583e35)
(cherry picked from commit dd349a0ede)
2023-05-02 21:16:34 +01:00
6ed30a20be portablectl: add --extension to bash completion
(cherry picked from commit fa84c1ce00)
(cherry picked from commit ae12c1380b)
2023-04-28 16:29:56 +01:00
88f058583b shell-completion: add --xml-interface option of busctl to the rules
Signed-off-by: Masatake YAMATO <yamato@redhat.com>
(cherry picked from commit a5efb0cc2b)
(cherry picked from commit bda5c892a8)
2023-04-28 16:29:56 +01:00
6d8885af57 meson: Install missing bash-completions
(cherry picked from commit 7b2f84e3f2)
2023-02-10 20:28:11 +00:00
9e7cc6f0d2 shell-completion/zsh: rename helper for clarity 2022-10-20 09:58:00 +02:00
4e9183059a shell-completion/zsh: silence error when machinectl is not installed
This fixes a few unrelated issues:
- when ENABLE_MACHINED is false, machinectl is not installed, but _sd_machines
  is still used in a few places that want to complete -M and such.
  Also, bash completion calls machinectl in various places.
  Make missing machinectl mean "no machines" in this case, so
  that no error is generated in the callers.
- machinectl list --full would print multiple lines of output per machine,
  breaking grep, issue introduced in e2268fa437.
  Using --max-addresses=1 would fix the issue, but let's use
  --max-addresses=0 because we now can.
- the lists used in various places were slightly different for no good reason.
- don't use a subshell if not necessary.

The code for bash still uses the same combined list of images and running
machines for various commands. The zsh code uses images for start/clone, and
running machines for the rest. Maybe something to fix in the future.

Replaces #25048.
2022-10-20 09:58:00 +02:00
808ec9df38 bash-completion: add systemd-dissect support 2022-10-19 14:43:50 +02:00
0923b4253c tree-wide: replace "plural(s)" by "plurals"
(s) is just ugly with a vibe of DOS. In most cases just using the normal plural
form is more natural and gramatically correct.

There are some log_debug() statements left, and texts in foreign licenses or
headers. Those are not touched on purpose.
2022-10-17 15:10:53 +02:00
d1d8786c5b analyze: extend the dump command to accept patterns
The new function DumpPatterns() can be used to limit (drastically) the size of
the data returned by PID1. Hence the optimization of serializing data into a
file descriptor should be less relevant than having the possibility to limit
the data when communicating with the service manager remotely.

NB: when passing patterns, the dump command omits the version of the manager as
well as the features and the timestamps.
2022-10-13 07:47:42 +09:00
fd83c98e8a Implement --luks-sector-size for homed 2022-10-07 16:36:04 +02:00
addc84ec91 Merge pull request #24686 from d4nuu8/delta_output
shared/logs-show: add new --output= format "short-delta"
2022-09-23 13:33:55 +02:00
893bcd3d07 shared/logs-show: add new --output= format "short-delta"
This new output formatting option is similar to "short-monotonic" but
also shows the time delta between two messages.

This fixes #24641.
2022-09-23 10:07:03 +02:00
82ff978d0b bash-completion: add missing options to systemd-cryptenroll 2022-09-15 13:40:23 +01:00
c4c9714464 shell-completion: drop unused $mode
Fixes #24473.
2022-08-28 08:11:26 +00:00
4ccde410a3 tree-wide: change --kill-who to --kill-whom
getopt allows non-ambiguous abbreviations, so backwards-compat is maintained, and
people can use --kill-who (or even shorter abbreviations). English is flexible,
so in common speach people would use both forms, even if "whom" is technically
more correct. The advantage of using the longer form in the code is that we
effectively allow both forms, so we stop punishing people who DTGCT¹, but still
allow people to use the spoken form if they prefer.

1. Do the gramatically correct thing
2022-08-26 11:15:44 +09:00
aa2118cb0b bash-completion: add systemd-sysext support 2022-08-22 15:41:38 +01:00
0a152619ac bash-completion: autocomplete cgroup names in systemd-cgtop 2022-08-18 12:58:12 +01:00
5edea3b77e shell-completion: add systemctl list-automounts 2022-07-25 13:37:20 +02:00
02d06ba180 bootctl: add --install-source=auto|image|host
When using --root=/--image= the binaries to install/update will be
picked from the directory/image. Add an option to let the caller
choose.
By default (auto) the image is tried first, and if nothing is found
then the host. The other options allow to strictly try the image
or host and ignore the other.
2022-07-08 16:58:51 +01:00
80a2381d5c bootctl: add --root and --image
Operate on image/directory, and also take files to install from it
2022-07-08 16:58:15 +01:00
85fce6f42c Use https for gnu.org 2022-06-28 16:07:35 +02:00
9a2d94dd27 bash-completion: add systemd-cryptenroll support 2022-06-09 11:47:10 +02:00
36f186a9e0 bash-completion: fix typos in comments 2022-06-09 11:46:50 +02:00
4e5f4733c5 bash-completion: resolvectl: add missing options and verb 2022-05-08 14:14:28 +02:00
8f04a1ca2b meson: also allow setting GIT_VERSION via templates
GIT_VERSION is not available as a config.h variable, because it's rendered
into version.h during builds. Let's rework jinja2 rendering to also
parse version.h. No functional change, the new variable is so far unused.

I guess this will make partial rebuilds a bit slower, but it's useful
to be able to use the full version string.
2022-04-05 22:18:31 +02:00
d90dbba7ec shell-completion: update for udevadm 2022-04-05 04:36:20 +09:00
aa2b0d8d29 udevadm: introduce new 'wait' command
Prompted by https://github.com/systemd/systemd/pull/22717#issuecomment-1067348496.

The new command 'udevadm wait' waits for device or device symlink being
created. This may be useful to wait for a device is processed by udevd
after e.g. formatting or partitioning the device.
2022-04-01 15:13:18 +09:00
f887eab1da meson: build kernel-install man page when necessary 2022-03-31 21:12:05 +09:00
678f2b1667 udevadm: trigger: implement --initialized-match/nomatch arguments
systemd-udev-trigger.service by default triggeres all devices regardless
of whether they were already recognized by systemd-udevd.

There are machines (especially in embedded environments) where
systemd-udev-trigger.service is configured to run at a later stage of
the boot sequence, which can lead to quite a lot of devices being
triggered although they were already recognized by systemd-udevd.

Re-triggering a lot of devices is a relatively expensive operation and
therefore should be avoided if unnecessary.

Therefore this patch introduces --initialized-nomatch, which filters out
devices that are already present in the udev database. For consistance
reasons --initialized-match is implemented as well, which filters out devices
that are *not* already present in the udev database.

Replaces #19949.
2022-03-22 15:54:10 +09:00
1baeee5784 udevadm trigger: introduce --type=all option 2022-03-22 15:27:06 +09:00
873cf95c2f udevadm trigger: introduce --prioritized-subsystem option 2022-03-22 15:27:06 +09:00
de0988f9d2 shell-completion: Add completion for oomctl
Added bash and zsh completions for oomctl arguments and commands.

Related To: #22118
2022-03-18 13:41:19 +00:00
f1c70ed13d shell-completion: Add completion in bootctl
Added new completion for `--make-machine-id-directory`
provideds 3 options(yes no auto)

Closes: #22308
2022-03-18 09:19:56 +00:00
7c4bd9ac98 bus-dump: change capture output to use pcapng (#21738)
This patch changes busctl capture to generate pcapng format
instead of the legacy pcap format files. It includes basic
meta-data in the file and still uses microsecond time
resolution. In future, more things can be added such as
high resolution timestams, statistics, etc.

PCAP Next Generation capture file format is what tshark uses
and is in process of being standardized in IETF. It is also
readable with libpcap.

$ capinfos /tmp/new.pcapng
File name:           /tmp/new.pcapng
File type:           Wireshark/... - pcapng
File encapsulation:  D-Bus
File timestamp precision:  microseconds (6)
Packet size limit:   file hdr: (not set)
Packet size limit:   inferred: 4096 bytes
Number of packets:   22
File size:           21kB
Data size:           20kB
Capture duration:    0.005694 seconds
First packet time:   2021-12-11 11:57:42.788374
Last packet time:    2021-12-11 11:57:42.794068
Data byte rate:      3,671kBps
Data bit rate:       29Mbps
Average packet size: 950.27 bytes
Average packet rate: 3,863 packets/s
SHA256:              b85ed8b094af60c64aa6d9db4a91404e841736d36b9e662d707db9e4096148f1
RIPEMD160:           81f9bac7ec0ec5cd1d55ede136a5c90413894e3a
SHA1:                8400822ef724b934d6000f5b7604b9e6e91be011
Strict time order:   True
Capture oper-sys:    Linux 5.14.0-0.bpo.2-amd64
Capture application: systemd 250 (250-rc2-33-gdc79ae2+)
Number of interfaces in file: 1
Interface #0 info:
                     Encapsulation = D-Bus (146 - dbus)
                     Capture length = 4096
                     Time precision = microseconds (6)
                     Time ticks per second = 1000000
                     Number of stat entries = 0
                     Number of packets = 22
2021-12-25 15:07:40 +09:00