398 Commits

Author SHA1 Message Date
Yu Watanabe
f866ff3df8 tree-wide: replace tab with space, adjust missing or duplicated space 2025-11-24 12:45:06 +01:00
Yu Watanabe
d2b8e42742 meson: exit earlier from the subdirectory when bash/zshcompletiondir is 'no' 2025-11-20 14:50:30 +09:00
Yu Watanabe
c74dc8cf14 meson: sort shell completions 2025-11-20 14:48:33 +09:00
Yu Watanabe
d32ec01223 shell-completion: drop deprecated cgroup controller suggestion 2025-11-17 21:31:51 +09:00
Jelle van der Waa
1e29036afc shell-completion: zsh: add completion for systemd-analyze inspect-elf 2025-11-10 20:10:06 +01:00
Jelle van der Waa
7112e08cec shell-completion: zsh: add missing completions for systemd-analyze
Adds missing simple verbs which already exist in bash completion.
2025-11-10 20:09:42 +01:00
Jelle van der Waa
60c68080b7 shell-completion: zsh: add systemd-analyze architectures completion 2025-11-10 20:09:01 +01:00
Daan De Meyer
5cabeed80b run0: Add --empower
--empower gives full privileges to a non-root user. Currently this
includes all capabilities but we leave the option open to add more
privileges via this option in the future.

Why is this useful? When running privileged development or debugging
commands from your home directory (think bpftrace, strace and such),
you want any files written by these tools to be owned by your current
user, and not by the root user. run0 --empower will allow you to run
all privileged operations (assuming the tools check for capabilities
and not UIDs), while any files written by the tools will still be owned
by the current user.
2025-10-30 15:28:36 +01:00
Daan De Meyer
b1856a6c4a analyze: Add shell completion for dlopen-metadata 2025-10-30 14:11:28 +00:00
Ronan Pigott
6f8e6e50a0 zsh: add completion for dbus bus address
The DBUS_SESSION_BUS_ADDRESS and DBUS_SYSTEM_BUS_ADDRESS parameters have
an interesting syntax thats useful to complete. Let's include a
completion definition for these parameters.
2025-10-27 12:41:42 +00:00
雪叶
c4d708c3aa zsh-completion: add completion for freeze, thaw, condstop 2025-09-22 11:55:29 +01:00
nl6720
fea2518a71 zsh: replace bootctl --no-variables with --variables=
bbeeea4362 replaced the option in bootctl.
2025-09-18 17:00:57 +03:00
Zbigniew Jędrzejewski-Szmek
86048cce95 journalctl: add -W as short for --no-hostname
--no-hostname is one of the switches I use very often. In particular,
when looking at CI logs, the hostname is almost never interesting.
-H is not yet used in journalctl, because journal operates locally, but
will want it if display of remote journals is implemented. Use -W.
2025-09-17 14:27:00 +02:00
Zbigniew Jędrzejewski-Szmek
8b6c1d392e journalctl: fix erroneuous mention of "local" hostnames
--no-hostname applies equally to remote and local logs.

This change is a separate commit to make it easy to backport.
2025-09-17 14:26:23 +02:00
Yu Watanabe
5bb434e317 shell-completion: support -i option for journalctl
Follow-up for dde54b8a85.
2025-08-26 19:24:39 +01:00
Zbigniew Jędrzejewski-Szmek
9fa08842b7 shell-completion: drop deprecated systemd-efi-options from suggestions 2025-07-28 19:08:50 +01:00
Eisuke Kawashima
c2b0f637c2 fix(shell-completion): discard error messages 2025-07-14 20:24:26 +09:00
Eisuke Kawashima
01e769bc2e fix(SC2162): add -r to read 2025-07-14 20:24:26 +09:00
Eisuke Kawashima
12e64a4848 style(shell-completion): remove unnecessary backslashes 2025-07-14 20:24:25 +09:00
Eisuke Kawashima
5300aa7a1d style(shell-completion): remove trailing semicolons 2025-07-14 20:24:25 +09:00
Eisuke Kawashima
dfe6b3fa38 style(shell-completion): expand hard tabs and fix indentation 2025-07-14 20:24:25 +09:00
Eisuke Kawashima
2da41c4b51 fix(shell-completion): fix help string 2025-07-14 20:24:25 +09:00
Eisuke Kawashima
4571a1d77a shell-completion: update systemd-run 2025-07-11 19:04:44 +02:00
Zbigniew Jędrzejewski-Szmek
63770fa1d3 systemd-run: add --no-pager, use pager for --help 2025-07-11 19:01:42 +09:00
Eisuke Kawashima
dc6e9c548b zsh-completion: generate completion for systemd-run from systemd-analyze
continuation of #37641
2025-07-10 11:39:06 +02:00
Zbigniew Jędrzejewski-Szmek
d971936bf4 shell-completions: add systemd-analyze transient-settings
The zsh completions only complete one type argument, even though multiple
args are allowed. But the same issue occurs with other completions, e.g.
for options. I don't know how to solve this.
2025-07-03 21:03:26 +02:00
peelz
7c8070c781 zsh: remove _files prefixes
Prefixes would be nice, but they appear to be very buggy.

A few examples:
- `udevadm test-builtin net_setup_link /sys<TAB><TAB>`: `/sysblock/`
- `udevadm test-builtin net_setup_link /sys/<TAB><TAB>`: `/sys/bin/`
- `journalctl /dev<TAB>`: `/dev//dev/`
2025-07-02 12:48:42 +01:00
Zbigniew Jędrzejewski-Szmek
7d247d3cb8 meson: drop explicit custom_target names
[1] says:
> Since 0.60.0 the name argument is optional and defaults to the basename of
> the first output
We specify >= 0.62 as the supported version, so drop the duplicate name in all cases
where it is the same as outputs[0], i.e. almost all cases.

[1] https://mesonbuild.com/Reference-manual_functions.html#custom_target
2025-06-28 17:14:50 +02:00
Ronan Pigott
88036a47e4 zsh: complete positional devpath in udevadm info/trigger 2025-06-13 11:23:59 +01:00
Eisuke Kawashima
39c3638445 zsh-completion: improve systemd-run
- add missed options
- improve completion for property
2025-05-28 09:50:53 +02:00
Eisuke Kawashima
b9df3d6447 shell-completion: improve completion of systemd-tmpfiles 2025-05-16 14:04:09 +09:00
Eisuke Kawashima
6d07d23b02 shell-completion: fix completion of systemctl --user unset-environment (#37409)
Co-authored-by: Eisuke Kawashima <e-kwsm@users.noreply.github.com>
2025-05-13 09:04:52 +09:00
Yu Watanabe
c53d155d8d udevadm: introduce --revert option to call io.systemd.service.Revert 2025-04-12 05:08:16 +09:00
Yu Watanabe
a6c4a7098d shell-completion/udevadm: support dissect_image builtin
Follow-up for a8b2302bc1.
2025-04-09 08:56:40 +09:00
Yu Watanabe
6f2f4ceadf shell-completion: add factory_reset udev builtin command 2025-03-17 12:42:28 +09:00
Yu Watanabe
c06a630f0c nspawn: introduce --cleanup option to clear propagation and unix-export directories
This is useful when the previous invocation is unexpectedly killed.

Otherwise, if systemd-nspawn is killed forcibly, then unix-export
directory is not cleared and unmounted, and the subsequent invocation
will fail. E.g.
===
[   18.895515] TEST-13-NSPAWN.sh[645]: + machinectl start long-running
[   18.945703] systemd-nspawn[1387]: Mount point '/run/systemd/nspawn/unix-export/long-running' exists already, refusing.
[   18.949236] systemd[1]: systemd-nspawn@long-running.service: Failed with result 'exit-code'.
[   18.949743] systemd[1]: Failed to start systemd-nspawn@long-running.service.
===
2025-03-16 11:02:09 +09:00
Yu Watanabe
ac722389a7 udevadm-test: allow to dump result in json format
This adds --json=MODE option for 'udevadm test' command.
When specified, all messages, except for the final result, will be
written to stderr, and the final result is shown in JSON format to
stdout. It may be useful for parsing the test result.
2025-02-08 01:39:35 +09:00
Yu Watanabe
295741c0d1 udevadm-verify: document '--resolve-names=late' and accept 'never' as is
When '--resolve-names=late', systemd-udevd resolves user/group names
during each event being processed, and does not verify names on parse.
When '--resolve-names=never', systemd-udevd refuses any user/group names
on parse. Hence, the parser of udev rules behaves diffrently. Let's not
convert 'never' -> 'late' silently, and use the specified option as is.

This also updates man page and shell completion for --resolve-names
option.
2025-02-02 15:55:01 +09:00
Yu Watanabe
7f2175eabb udevadm: introduce cat command
This introduces 'udevadm cat' command, that shows udev rules files or
udev.conf, which may be useful for debugging.

Closes #35818.
2025-01-23 22:23:45 +09:00
Yu Watanabe
c3d526d765 shell-completion/udevadm: add net_driver
Follow-up for 2b5b25f123.
2025-01-23 22:23:45 +09:00
Yu Watanabe
90cf374e45 run: add --job-mode= argument (#34708)
systemctl has a --job-mode= argument, and adding the same argument to
systemd-run is useful for starting transient scopes with dependencies.
For example, if a transient scope BindsTo a service that is stopping,
specifying --job-mode=replace will wait for the service to stop before
starting it again, while the default job mode of "fail" will cause the
systemd-run invocation to fail.
2025-01-23 18:11:30 +09:00
Gavin Li
706a953504 run: add --job-mode= argument
systemctl has a --job-mode= argument, and adding the same argument to
systemd-run is useful for starting transient scopes with dependencies.
For example, if a transient scope BindsTo a service that is stopping,
specifying --job-mode=replace will wait for the service to stop before
starting it again, while the default job mode of "fail" will cause the
systemd-run invocation to fail.
2025-01-23 02:08:32 -05:00
Yu Watanabe
c1b7db56e5 udevadm-test: allow to specify extra directories to load udev rules files
This adds -D/--extra-rules-dir=DIR switch for 'udevadm test' command.
When specified, udev rules files in the specified directory will be also
loaded. This may be useful for debugging udev rules by copying some udev
rules files to a temporary directory.
2025-01-22 20:46:42 +00:00
Yu Watanabe
25a2e4738b udevadm-control: allow to enable/disable trace logging in systemd-udevd
Should be useful for debugging udev rules.
2025-01-21 04:12:18 +09:00
Yu Watanabe
8846df63fa udevadm-test: introduce -v/--verbose option to show verbose log messages
Currently this does not show any extra log messages. In later commits,
more verbose log messages will be added.
2025-01-18 04:19:52 +09:00
Duncan Overbruck
c8342feb07 shell-completions: add systemctl sleep 2025-01-16 09:33:15 +01:00
Federico Giovanardi
7fd45eec37 udev: add option to trigger parent devices despite filters
This commit add the `-i` option to `udevadm trigger` that force it to
match parent devices even if they're excluded from filters.
The rationale is that some embedded devices have a huge number of
platform devices ( ~ 4k for MX8 ) they are there because they're defined
in the device tree but there isn't any action or udev rules associated
with them.

So at boot a significant time is spend triggering and processing rules
for devices that don't produce any effect and we would like to filter
them by calling:

```
udevadm trigger --type=device --action=add -s block -s tty
```

instead of the normal

```
udevadm trigger --type=device --action=add
```

so we can use filter to filter out only subsystems for we we know that
we have rules in place that do something useful.

On the other side action / rules are not triggered until the parent is
triggered ( which is part of another subsystem), so the additional option
will allows udev to complete the coldplug with only the devices we care.

Example on iMX8:

.Without the new option
```
root@dev:~# udevadm trigger --dry-run  -s block --action=add -v
/sys/devices/platform/bus@5b000000/5b010000.mmc/mmc_host/mmc0/mmc0:0001/block/mmcblk0
/sys/devices/platform/bus@5b000000/5b010000.mmc/mmc_host/mmc0/mmc0:0001/block/mmcblk0/mmcblk0boot0
/sys/devices/platform/bus@5b000000/5b010000.mmc/mmc_host/mmc0/mmc0:0001/block/mmcblk0/mmcblk0boot1
/sys/devices/platform/bus@5b000000/5b010000.mmc/mmc_host/mmc0/mmc0:0001/block/mmcblk0/mmcblk0p1
/sys/devices/platform/bus@5b000000/5b010000.mmc/mmc_host/mmc0/mmc0:0001/block/mmcblk0/mmcblk0p2
/sys/devices/platform/bus@5b000000/5b010000.mmc/mmc_host/mmc0/mmc0:0001/block/mmcblk0/mmcblk0p3
/sys/devices/platform/bus@5b000000/5b010000.mmc/mmc_host/mmc0/mmc0:0001/block/mmcblk0/mmcblk0p4
```

.With the new option
```
root@dev:~# udevadm trigger --dry-run -i -s block --action=add -v
/sys/devices/platform
/sys/devices/platform/bus@5b000000
/sys/devices/platform/bus@5b000000/5b010000.mmc
/sys/devices/platform/bus@5b000000/5b010000.mmc/mmc_host/mmc0
/sys/devices/platform/bus@5b000000/5b010000.mmc/mmc_host/mmc0/mmc0:0001
/sys/devices/platform/bus@5b000000/5b010000.mmc/mmc_host/mmc0/mmc0:0001/block/mmcblk0
/sys/devices/platform/bus@5b000000/5b010000.mmc/mmc_host/mmc0/mmc0:0001/block/mmcblk0/mmcblk0boot0
/sys/devices/platform/bus@5b000000/5b010000.mmc/mmc_host/mmc0/mmc0:0001/block/mmcblk0/mmcblk0boot1
/sys/devices/platform/bus@5b000000/5b010000.mmc/mmc_host/mmc0/mmc0:0001/block/mmcblk0/mmcblk0p1
/sys/devices/platform/bus@5b000000/5b010000.mmc/mmc_host/mmc0/mmc0:0001/block/mmcblk0/mmcblk0p2
/sys/devices/platform/bus@5b000000/5b010000.mmc/mmc_host/mmc0/mmc0:0001/block/mmcblk0/mmcblk0p3
/sys/devices/platform/bus@5b000000/5b010000.mmc/mmc_host/mmc0/mmc0:0001/block/mmcblk0/mmcblk0p4
```
Boot time reduction with this is place is ~ 1 second.
2024-12-16 15:43:52 +01:00
Luca Boccassi
a91c739a24 busctl: various bugfixes + tweaks (#34928)
Fixes: #34048
Replaces: #34796
Follow-up for: #33961
2024-10-29 18:15:16 +00:00
Zbigniew Jędrzejewski-Szmek
99996d5f5e Merge pull request #34245 from bluca/logind_drop_weak_delay_inhibitor
logind: drop new delay-weak inhibitor
2024-10-29 17:13:11 +01:00
Lennart Poettering
8187515aab busctl: rename --num-matches= → --limit-messages=
We should avoid unnecessary abbreviations for such messages, and this
puts a maximum limit on things, hence it should indicate this in the
name.

Moreover, matches is a bit confusing, since most people will probably
call "busctl monitor" without any match specification, i.e. zero
matches, but that's not what was meant here at all.

Also, add a brief switch for this (-N) since I figure in particular
"-N1" might be a frequent operation people might want to use.

Follow-up for: 989e843e75
See: #34048
2024-10-29 16:50:06 +01:00