1
0
mirror of https://github.com/systemd/systemd synced 2024-07-05 17:39:42 +00:00
Commit Graph

617 Commits

Author SHA1 Message Date
Lennart Poettering
3d8ba7b83f nspawn: optionally tint the background color of a container 2024-01-23 16:45:37 +01:00
Lennart Poettering
0db917f759
Merge pull request #31019 from poettering/hostnamed-full-os-release
hostnamed: expose full /etc/os-release data in hostnamectl's --json= output
2024-01-23 12:28:41 +01:00
Ivan Shapovalov
9a887b1421 shell-completion/zsh: complete hidden images when word starts with "."
Show hidden images in the completion results, but only if the current
word starts with ".", such that
- `machinectl clone <Tab>` will only offer non-hidden images, but
- `machinectl clone .<Tab>` will offer both hidden and non-hidden images
2024-01-23 04:01:11 +01:00
Ivan Shapovalov
57d389c3fb shell-completion/zsh: improve and expand machinectl completion 2024-01-23 01:55:05 +01:00
Lennart Poettering
2bf618331d hostnamectl: add -j switch for quick json output
We already support -j as shortcut for JSON mode in various tools. Let's
add one more. We probably should add this systematically (at least where
it doesn't conflict with an existing -j switch with other purpose). But
I am too lazy to add that now.
2024-01-22 14:39:22 +01:00
Antonio Alvarez Feijoo
43aaa1b3d3
bash-completion: add missing options to systemd-dissect 2024-01-19 15:50:15 +01:00
Antonio Alvarez Feijoo
c13d9199d6
bash-completion: add missing options to systemd-cryptenroll 2024-01-19 15:49:52 +01:00
Mike Yuan
ea54517476
loginctl: add --json= and -j, decouple list-* from --output=
--output= is documented to only affect journal output in *-status.
Let's use --json= and -j standard options for list-* instead.
2024-01-17 11:30:04 +08:00
Frantisek Sumsal
45a3c02564 shell-completion: add new systemd-id128 options 2024-01-11 18:35:37 +01:00
Antonio Alvarez Feijoo
7c0e0bbb6b
analyze: fix -q option
Follow-up to 52117f5af8
2024-01-09 09:05:50 +01:00
Frantisek Sumsal
178c8c24ec shell-completion: provide completion for journalctl --namespace=
Resolves: #30381
2024-01-05 19:21:51 +01:00
Frantisek Sumsal
2fe03e25fb shell-completion: fix mixed indent 2024-01-05 19:21:51 +01:00
Frantisek Sumsal
68f66a1713 journalctl: implement --list-namespaces
Apart from being useful on its own, this will be used in the following
commit for shell completions.
2024-01-05 19:21:51 +01:00
Sergei Zhmylev
25aa35d465 journalctl: add --exclude-identifier option 2024-01-04 23:21:39 +01:00
Luca Boccassi
cfb912abaf bash completion: add systemd-analyze architectures
Follow-up for fb8cc599ed
2023-12-27 17:52:06 +01:00
Luca Boccassi
c24c63e946 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.
2023-12-27 17:48:05 +01:00
Luca Boccassi
79272d3098 bash completion: add systemctl service-log-level/target 2023-12-27 16:59:03 +01:00
Arthur Zamarin
8546a4af00
bash-completion: add missing option to systemd-confext
Signed-off-by: Arthur Zamarin <arthurzam@gentoo.org>
2023-12-21 23:23:13 +02:00
Arthur Zamarin
bd97ae259d
bash-completion: add missing option to systemd-cgls
Signed-off-by: Arthur Zamarin <arthurzam@gentoo.org>
2023-12-21 23:13:35 +02:00
Arthur Zamarin
fabe596e7e
bash-completion: add missing option to systemd-cat
Signed-off-by: Arthur Zamarin <arthurzam@gentoo.org>
2023-12-21 23:07:05 +02:00
Daan De Meyer
dedb925eaf meson: Always build bootctl
bootctl is rather useful to have, even if on a system without UEFI,
as it has a number of verbs that are unrelated to UEFI (e.g kernel-identify),
and more importantly, it supports --root to operate on directory trees
(which could be intended to be deployed on UEFI) so let's make sure we
always build it.
2023-10-25 16:49:24 +02:00
Antonio Alvarez Feijoo
acb7d23d8f
bash-completion: add missing commands and options to systemd-dissect 2023-09-25 16:46:11 +02:00
Ronan Pigott
47f20650b7 zsh: busctl: fix flags parsing for properties
I'm not quite sure what the original intent of this line was, but it
doesn't work in the one call-site the "required" argument is actually
used. The "writable" flag was indexed as a scalar leaving only the
"e" to compare against.

Instead, let's just sort the parsed flags and compare the whole thing.
Also substitute "required" as a pattern, so that pattern based
comparisons may be supported.
2023-09-09 01:28:07 +01:00
Frantisek Sumsal
97e2785292 shell-completions: add missing systemctl verbs/options
Resolves: #29048
2023-09-04 11:49:51 +02:00
Frantisek Sumsal
05ebcbd5c5 shell-completions: code cleanup 2023-09-04 11:49:26 +02:00
Ronan Pigott
2cbda74862 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.
2023-08-08 01:57:45 -07:00
Ronan Pigott
c8e2cd79c1 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.
2023-08-07 18:00:04 -07:00
Luca Boccassi
b0d3095fd6 Drop split-usr and unmerged-usr support
As previously announced, execute order 66:

https://lists.freedesktop.org/archives/systemd-devel/2022-September/048352.html

The meson options split-usr, rootlibdir and rootprefix become no-ops
that print a warning if they are set to anything other than the
default values. We can remove them in a future release.
2023-07-28 19:34:03 +01:00
Frantisek Sumsal
283f3bd588 shell-completion: include units in 'verify' completions
Resolves: #28500
2023-07-24 20:02:55 +01:00
Ronan Pigott
9ec0808370 zsh: use glob matching for template names
Template names can be learned from the filesystem, so there isn't a need
to parse the output of systemctl list-unit-files in this case. This
should accelerate the completion of some verbs like enable.
2023-07-19 15:07:39 -07:00
Ronan Pigott
ae6fb82cd9 zsh: remove unit property caching
The existing caching policy isn't very sensible for this cache. We could
write a different policy, but I don't think there is much value in
caching these values, as in my experience the command used to generate
them is quick.
2023-07-19 14:27:45 -07:00
Ronan Pigott
110ba0ccf9 zsh: update default caching policy for units
The existing caching policy was completely bogus.

In the first stanza, despite the comment, the pattern given would
consider the cache invalid if it was more than 1 hour old.

The second stanza was also incorrect, since the output of `systemctl
--all` is not unit file paths, but unit names. When they were being
tested against the cachefile mtime, the test would always fail becuase
of the nonexistant file (hopefully).

In fact it's not very useful to test if the unit files have newer mtime
in this case anyway, since we are only caching their names. Also,
`systemctl --all` is an unfortunately slow operation to be used in
testing for the cache validity — we want this operation to at least be
faster than rebuilding the cache.

I've rewritten this stanza with my best guess at its original intent. It
now checks against the mtime of the parent directories in the search
path, which should be updated and cause the cache to rebuild when we
add, remove, or rename any unit files.
2023-07-19 14:27:45 -07:00
Ronan Pigott
8a8caeccb2 zsh: stop forcing unit file cache rebuilds
Rebuilding whenever the cached parameter is not set forces each new
shell to rebuild the cache, which often defeates the purpose of caching
in the first place.
2023-07-17 16:38:25 -07:00
Ronan Pigott
087f777a1c zsh: default to system manager when not specified
This used to work correctly, before the change was reverted in
e09d0d46c2. In fact it is important to specify the manager explicity
in the completion because the argument is reused in the caching
policies. An empty argument here caused the completion to create
separate caches with and without the --system parameter. We can simplify
the given pattern a little here too.
2023-07-17 16:35:29 -07:00
Ronan Pigott
d0fc94a192 zsh: suppress aliases and shell functions when calling systemctl
This prevents any errors in case the user had aliased some arguments
following systemctl.
2023-07-17 16:20:03 -07:00
Ronan Pigott
3b4c6009c0 zsh: typo in systemctl completions 2023-07-17 16:08:58 -07:00
Luca Boccassi
09c857a02a shell-completion: add show-cache to bash 2023-07-07 13:41:15 +01:00
Luca Boccassi
7df82b8d64 shell-completion: add whoami to bash 2023-07-07 13:40:12 +01:00
Luca Boccassi
1386e34bae shell-completion: add soft-reboot to bash 2023-07-07 13:39:21 +01:00
Christian Hesse
77d4986415 shell-completion/zsh/resolvectl: add show-cache
Make zsh shell-completion aware of show-cache.
2023-07-07 14:05:11 +02:00
Christian Hesse
6864f9b9e9 shell-completion/zsh/systemctl: add whoami
Make zsh shell-completion aware of whoami.
2023-07-07 14:02:41 +02:00
Christian Hesse
050d6d711a shell-completion/zsh/systemctl: add soft-reboot
Make zsh shell-completion aware of soft-reboot.
2023-07-07 13:57:03 +02:00
Daniel P. Berrangé
f460fec915 detect-virt: add --list-cvm option
The --list-cvm option reports the known types of confidential virtualization
technology that can be detected.

Related: https://github.com/systemd/systemd/issues/27604
Signed-off-by: Daniel P. Berrangé <berrange@redhat.com>
2023-07-06 12:20:04 +01:00
Daniel P. Berrangé
5e0c61f64d detect-virt: add --cvm option
The --cvm option detects whether the OS is running inside a confidential
virtual machine.

Related: https://github.com/systemd/systemd/issues/27604
Signed-off-by: Daniel P. Berrangé <berrange@redhat.com>
2023-07-06 12:20:04 +01:00
Kiran Vemula
5ed91481ab resolved: added serve stale feature implementation of RFC 8767
serve stale feature to keep the DNS resource records beyond TTL to return them as stale records in case of upstream server is not reachable or returns negative response.
SD_RESOLVED_NO_STALE flag has been added to disable serving stale records via dbus.
added serve stale test cases to TEST-75-RESOLVED
Fixes: #21815
2023-06-16 10:20:15 +01:00
Lennart Poettering
5bc4570fd4
Merge pull request #26728 from keszybz/meson-update
Meson version update
2023-06-13 23:38:41 +02:00
Yu Watanabe
80dc9ad98c meson: bump required version to 0.56.0 2023-06-12 11:01:58 +02:00
Cyril Roelandt
3c6fefd879 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
2023-06-07 13:54:12 +01:00
Yu Watanabe
1bf3dd4153 udev: downgrade log level about style issues
And add --no-style switch that make style issues not critical.
2023-06-05 11:37:26 +09:00
Ronan Pigott
110789987d zsh: amend completion for networkctl edit 2023-05-22 12:14:04 +01:00