1
0
mirror of https://github.com/systemd/systemd.git synced 2024-11-01 00:51:24 +03:00
Commit Graph

216 Commits

Author SHA1 Message Date
Zbigniew Jędrzejewski-Szmek
23949111c0
Merge pull request #8863 from evelikov/shell-completion-fixes
Shell completion fixes/perf improvements
2018-06-13 14:09:14 +02:00
Yu Watanabe
1a363edad1 bash-completion/resolvectl: support privatedns command 2018-06-13 11:16:26 +09:00
Emil Velikov
9b536b1af2 shell-completion: systemctl: do not list template units in {re,}start
Template units lacking DefaultInstance cannot be enabled/disabled or
started/restarted.

By adding DefaultInstance the unit can be enabled/disabled but it
still cannot be started/restarted.

Signed-off-by: Emil Velikov <emil.velikov@collabora.com>
2018-06-11 17:15:12 +01:00
Emil Velikov
98476dc8b2 shell-completion: systemctl: pass current word to all list_unit*
Earlier patch added the current word to the performance critical paths.
Here we add it to every place, for consistency sake.

Suggested-by: Yu Watanabe (yuwata)
Signed-off-by: Emil Velikov <emil.l.velikov@gmail.com>
2018-06-11 17:09:58 +01:00
Emil Velikov
c839b729c5 bash-completion: systemctl: pass current partial unit to list-unit*
Pass the partial name of the unit file to list-unit-files and
list-units. This allows for faster completion, since systemctl does
not need to list all the unit files.

For reference:
 - time systemctl list-unit-files -> ~200ms
 - time systemctl list-unit-files netctl* -> ~15ms
 - time systemctl list-units -> ~5ms
 - time systemctl list-units netctl* -> ~5ms

While the list-units time itself is unaffected, now a shorter list is
produced. Thus as we pass it to `systemctl show' (via
__filter_units_by_properties) the execution time will be decreased even
further.

v2: Update list-units hunk in commit message, add quotes around $2*
v3: Remove funky indentation, quote all $cur instances

Signed-off-by: Emil Velikov <emil.velikov@collabora.com>
2018-06-11 17:09:55 +01:00
Emil Velikov
aedd48160f bash-completion: systemctl: use systemctl --no-pager
Signed-off-by: Emil Velikov <emil.velikov@collabora.com>
2018-06-11 17:09:53 +01:00
Yu Watanabe
37e21077a3 bash-completion: add completion for portablectl 2018-05-28 18:15:06 +09:00
Yu Watanabe
aea447c9f8 bash-completion: also suggest template unit files
Fixes #9041.
2018-05-28 18:15:00 +09:00
Yu Watanabe
4f150c407f bash-completion: suggest bus properties instead of configuration items for 'systemctl -p'
Closes #5137.
2018-05-28 18:13:52 +09:00
Luca Boccassi
49805b3d81 journalctl: add with-unit mode
When dealing with a large number of template instances, for example
when launching daemons per VRF, it is hard for operators to correlate
log lines to arguments.
Add a new with-unit mode which, if available, prefixes unit and user
unit names when displaying its log messages instead of the syslog
identifier. It will also use the full timestamp with timezones, like
the short-full mode.
2018-05-25 14:45:34 +02:00
Lennart Poettering
6f8fa29465
Merge pull request #8981 from keszybz/ratelimit-and-dbus
Ratelimit renaming and dbus error message fix
2018-05-18 21:38:30 +02:00
Yu Watanabe
d231d569d8 bash-completion: add missing options and commands of timedatectl
Follow-up for 6129ec852e.
2018-05-15 10:52:45 +02:00
Zbigniew Jędrzejewski-Szmek
0887b0548b bash-completion: redirect introspection errors to null
If completion is attempted on an invalid path, busctl might respond with an error.
This shouldn't be seen, introspection is supposed to just fail silently.
2018-05-14 08:37:19 +02:00
Yu Watanabe
581ab53740 bash-completion: analyze: support cat-config verb
Follow-up for 854a42fb2e.
2018-05-11 04:11:56 +09:00
Yu Watanabe
7ee19d2643 bash-completion: analyze: add --no-pager for some verbs 2018-05-11 03:33:55 +09:00
Yu Watanabe
bd188ff0ee bash-completion: add completion for resolvectl 2018-04-19 03:26:54 +09:00
Zbigniew Jędrzejewski-Szmek
11a1589223 tree-wide: drop license boilerplate
Files which are installed as-is (any .service and other unit files, .conf
files, .policy files, etc), are left as is. My assumption is that SPDX
identifiers are not yet that well known, so it's better to retain the
extended header to avoid any doubt.

I also kept any copyright lines. We can probably remove them, but it'd nice to
obtain explicit acks from all involved authors before doing that.
2018-04-06 18:58:55 +02:00
Yu Watanabe
7f9c3ecad8 bash-completion: busctl: make variables local 2018-03-30 17:13:52 +09:00
Yu Watanabe
4cbb7c500a bash-completion: busctl: do not suggest "-" for signature
Fixes #8371.
2018-03-30 17:08:14 +09:00
Yu Watanabe
1e58b1dc40 bash-completion: busctl: suggests only writable properties for set-property 2018-03-30 17:06:50 +09:00
Mario Limonciello
e68c79db91 Rename suspend-to-hibernate to suspend-then-hibernate
Per some discussion with Gnome folks, they would prefer this name
as it's more descriptive of what's happening.
2018-03-28 15:11:10 -05:00
Mario Limonciello
c58493c00a Introduce suspend-to-hibernate (#8274)
Suspend to Hibernate is a new sleep method that invokes suspend
for a predefined period of time before automatically waking up
and hibernating the system.

It's similar to HybridSleep however there isn't a performance
impact on every suspend cycle.

It's intended to use with systems that may have a higher power
drain in their supported suspend states to prevent battery and
data loss over an extended suspend cycle.

Signed-off-by: Mario Limonciello <mario.limonciello@dell.com>
2018-03-08 14:17:33 +01:00
Zbigniew Jędrzejewski-Szmek
ecd3717a74 shell-completion: add --global and unit-paths 2018-02-09 12:27:34 +01:00
Yu Watanabe
90657286fc analyze: merge {get,set}-log-{level,target} to log-{level,target} (#8020)
Also, service-watchdogs now shows current watchdog state when
no optional argument is provided.
2018-01-27 13:51:32 +01:00
Jan Klötzke
21a6abdf0e bash-completion: systemd-analyze: add service-watchdogs verb 2018-01-22 21:39:57 +01:00
Yu Watanabe
68c7139a4b bash-completion: timedatectl: suggests hostname and machine name 2018-01-10 23:21:26 +09:00
Yu Watanabe
e352389a02 bash-completion: run: add missing options 2018-01-10 23:21:22 +09:00
Yu Watanabe
14aeb7ce7f bash-completion: resolve: add missing options 2018-01-10 23:20:52 +09:00
Yu Watanabe
86b4188d5e bash-completion: nspawn: add missing options 2018-01-10 23:20:45 +09:00
Yu Watanabe
51bcbb6030 bash-completion: detect-virt: add missing option 2018-01-10 23:19:20 +09:00
Yu Watanabe
82ebb6ba1f bash-completion: cgls: suggests units 2018-01-10 23:19:00 +09:00
Yu Watanabe
7c3940f6ce bash-completion: analyze: add missing options and verbs 2018-01-10 23:18:49 +09:00
Yu Watanabe
035dd8c0a3 bash-completion: systemctl: add missing options and verbs 2018-01-10 23:18:16 +09:00
Yu Watanabe
f568dcd101 bash-completion: networkctl: 'list' and 'lldp' can take links 2018-01-10 23:17:41 +09:00
Yu Watanabe
6d92077e39 bash-completion: machinectl: add missing options and verbs 2018-01-10 23:17:32 +09:00
Yu Watanabe
fe56e4ba47 bash-completion: loginctl: add missing options and verbs 2018-01-10 23:16:41 +09:00
Yu Watanabe
f822279e62 bash-completion: localectl: add a missing option and verbs 2018-01-10 23:16:36 +09:00
Yu Watanabe
29e08b9e9e bash-completion: kernel-install: update default path to kernel image 2018-01-10 23:16:29 +09:00
Yu Watanabe
41053e9bdf bash-completion: journalctl add missing options
Also, this deprecates '--this-boot' option.
2018-01-10 23:16:14 +09:00
Yu Watanabe
afcb2246be bash-completion: hostnamectl: add a missing option 2018-01-10 23:15:45 +09:00
Yu Watanabe
245c1e6802 bash-completion: coredumpctl: support more options 2018-01-10 23:15:21 +09:00
Yu Watanabe
cdb8ec2d37 bash-completion: busctl: support more options and verbs 2018-01-10 23:11:00 +09:00
Yu Watanabe
92360836a0 bash-completion: bootctl: support more options and verbs 2018-01-10 23:10:19 +09:00
Zbigniew Jędrzejewski-Szmek
3a726fcd08 Add license headers and SPDX identifiers to meson.build files
So far I avoided adding license headers to meson files, but they are pretty
big and important and should carry license headers like everything else.
I added my own copyright, even though other people modified those files too.
But this is mostly symbolic, so I hope that's OK.
2017-11-19 19:08:15 +01:00
Zbigniew Jędrzejewski-Szmek
7059062c2f Add SPDX license headers to shell completion scripts 2017-11-19 19:08:15 +01:00
Zbigniew Jędrzejewski-Szmek
1ec57f3394 build-sys: s/ENABLE_RESOLVED/ENABLE_RESOLVE/
The configuration option was called -Dresolve, but the internal define
was …RESOLVED. This options governs more than just resolved itself, so
let's settle on the version without "d".
2017-10-04 12:09:51 +02:00
Zbigniew Jędrzejewski-Szmek
349cc4a507 build-sys: use #if Y instead of #ifdef Y everywhere
The advantage is that is the name is mispellt, cpp will warn us.

$ git grep -Ee "conf.set\('(HAVE|ENABLE)_" -l|xargs sed -r -i "s/conf.set\('(HAVE|ENABLE)_/conf.set10('\1_/"
$ git grep -Ee '#ifn?def (HAVE|ENABLE)' -l|xargs sed -r -i 's/#ifdef (HAVE|ENABLE)/#if \1/; s/#ifndef (HAVE|ENABLE)/#if ! \1/;'
$ git grep -Ee 'if.*defined\(HAVE' -l|xargs sed -i -r 's/defined\((HAVE_[A-Z0-9_]*)\)/\1/g'
$ git grep -Ee 'if.*defined\(ENABLE' -l|xargs sed -i -r 's/defined\((ENABLE_[A-Z0-9_]*)\)/\1/g'
+ manual changes to meson.build

squash! build-sys: use #if Y instead of #ifdef Y everywhere

v2:
- fix incorrect setting of HAVE_LIBIDN2
2017-10-04 12:09:29 +02:00
Lucas Werkmeister
ef5a8cb1a7 analyze: add get-log-level, get-log-target verbs
They’re counterparts to the existing set-log-level and set-log-target
verbs, simply printing the current value to stdout. This makes it
slightly easier to temporarily change the log level and/or target and
then restore the old value(s).
2017-09-07 23:55:59 +02:00
Lucas Werkmeister
4146ac2a4c shell-completion: add systemd-analyze set-log-target
The `systemd-analyze set-log-target` command was added in v227 (commit
2ca2a91cf1), but was missing from the shell completion specifications.
2017-09-07 23:47:33 +02:00
Yu Watanabe
6bda23dd6a bash-completion: use the first argument instead of the global variable (#6457)
Without this fix:

$ systemctl start <tab>
Display all 135 possibilities? (y or n)
$ __get_startable_units --system | wc -l
224

the number of the suggestions are quite different, as __get_startable_units --system does
not filter already started units. With this fix,

$ systemctl start <tab>
Display all 135 possibilities? (y or n)
$ __get_startable_units --system | wc -l
123
$ __get_template_names --system | wc -l
12

the number of the suggestions matches one the function returns.
For consistency with the other internal functions, it should use the first argument
instead of the global variable $mode.

[zj: add commit message to make it sound like we know what we're doing]
2017-07-27 07:22:54 -04:00