Commit Graph
51 Commits
Author SHA1 Message Date
Zbigniew Jędrzejewski-Szmek ad894f24df bash-completion: use improved filtering to make things faster
(cherry picked from commit 372b221166)
2014-10-30 00:18:35 -04:00
Zbigniew Jędrzejewski-Szmek b5d7c81b89 bash-completion: rework startable/restartable units once more
I tried to use 'systemctl --all list-units' to filter unit files, but
this always filters out unit files which are not loaded. We want to complete
systemctl start with those units too, so this approach is not going to work.

New version is rather slow, but hopefully correct.

(cherry picked from commit 9ff8af5460)
2014-10-30 00:03:38 -04:00
Zbigniew Jędrzejewski-Szmek 54a21e301c shell-completion: propose templates for disable/[re]enable/[re]start
Templates can be [re]enabled, on their own if the have DefaultInstance set,
and with an instance suffix in all cases. Propose just the template name
ending in @, to underline the instance suffix may have to be appended.

Likewise for start/restart.

This means that sometimes superflous units that one will not really
want to operate on will be proposed, but this seems better than
proposing a very incomplete set of names.

https://bugs.freedesktop.org/show_bug.cgi?id=66912
(cherry picked from commit e9a19bd882)
2014-10-26 18:23:47 -04:00
Zbigniew Jędrzejewski-Szmek 26df33449f shell-completion: fix completion of inactive units
Units which not loaded were not proposed properly. OTOH, we should
filter units from get-unit-files by their state if they are currently
loaded. Bring zsh completions in line with bash completion, the same
logic should be used in both implementations.

https://bugzilla.redhat.com/show_bug.cgi?id=1024379
https://bugzilla.redhat.com/show_bug.cgi?id=790768
https://bugs.freedesktop.org/show_bug.cgi?id=84720
(cherry picked from commit f29c77bc01)
2014-10-26 18:23:47 -04:00
Dave Reisner 1016e13e6a completion: filter templates from restartable units
Since c6a373a263, we might encounter unit templates via the
'list-units' verb. These aren't restartable (and we throw errors), so
make sure they're filtered out of the completion options.

fixes downstream bug: https://bugs.archlinux.org/task/41719

(cherry picked from commit ec15977a3c)
2014-10-26 18:23:46 -04:00
Eric Cook ab5543f5af shell-completion: prevent mangling unit names (bash)
This fixes the issue noted by Zbigniew in most cases.
if a unit's name is enclosed in single quotes completion still
will not happen after the first `\'.

https://bugs.freedesktop.org/show_bug.cgi?id=78388
(cherry picked from commit c317a1a19c)
2014-10-26 18:23:46 -04:00
Zbigniew Jędrzejewski-Szmek 8c2e21cf4a bash-completion: use list-unit-files to get "all" units
I think that it is better to return good results slightly more slowly,
than partial quickly. Also reading from disk seems fast enough. Even
the delay on first try with completely cold cache is acceptable.

This is just for bash, 'cause zsh was already doing this.

https://bugzilla.redhat.com/show_bug.cgi?id=790768
(cherry picked from commit c6a373a263)
2014-10-26 18:23:46 -04:00
Zbigniew Jędrzejewski-Szmek c2e540291d shell-completion: restore completion for -p
It was broken since systemd was moved out of /bin.

For zsh it was never there.

(cherry picked from commit c0a67aef31)

Conflicts:
	Makefile.am
2014-10-26 18:23:46 -04:00
Zbigniew Jędrzejewski-Szmek 7eb1f731ea shell-completion,man: beef up chassis completions and description
Parameters to hostnamectl command are not optional and should not be marked
as such in the man page.

(cherry picked from commit 1ed7749564)
(cherry picked from commit ba838f7f9b)
2014-07-19 17:24:15 -04:00
Dan Kilman efa946235e bash completion: fix __get_startable_units
(cherry picked from commit a163b64c4b)
(cherry picked from commit cc9db03683)
2014-04-20 10:52:09 -04:00
Lennart Poettering 3c993d002a systemctl: --kill-mode is long long gone, don't mention it in the man page
(cherry picked from commit 0088d63151)
(cherry picked from commit 12a170a495)
2014-04-07 13:30:53 -04:00
Thomas Hindoe Paaboel Andersen 1c01cf8b9d add bash completion for systemd-cat
(cherry picked from commit 207017017d)
2014-03-05 00:52:39 -05:00
Thomas Hindoe Paaboel Andersen 838c834403 add bash completion for systemd-detect-virt
(cherry picked from commit 3bfe58cbd4)
2014-03-05 00:46:30 -05:00
Thomas Hindoe Paaboel Andersen 6772933b7f add bash completion for systemd-cgtop
(cherry picked from commit d9256bac4d)
2014-03-05 00:36:00 -05:00
Thomas Hindoe Paaboel Andersen 7d6ed8b92b add bash completion for systemd-cgls
(cherry picked from commit abdab4f602)
2014-03-05 00:27:48 -05:00
Thomas Andersen a18b0404be bash: add completion for systemd-nspawn
(cherry picked from commit 0d6883b6a8)
2014-03-05 00:26:50 -05:00
Thomas Hindoe Paaboel Andersen 3646a66d09 bootctl: add bash completion
(cherry picked from commit 95fe27d930)
2014-03-05 00:26:49 -05:00
Thomas Hindoe Paaboel Andersen 8d04b9ce22 delta: add bash completion
(cherry picked from commit 0bc8e31b35)
2014-03-05 00:26:49 -05:00
Thomas Hindoe Paaboel Andersen a3772fb0d4 machinectl: add bash completion
(cherry picked from commit e56056e93d)

Default to --no-legend if !on_tty().

Conflicts:
	man/machinectl.xml
	src/machine/machinectl.c
2014-03-05 00:26:49 -05:00
Zbigniew Jędrzejewski-Szmek 14cf8f97d1 shell-completion: fix completion of localectl set-locale
https://bugs.freedesktop.org/show_bug.cgi?id=74157
(cherry picked from commit 627a98d398)
2014-02-23 12:42:02 +00:00
Zbigniew Jędrzejewski-Szmek 1bb3ed6816 bash-completion: fix completion of complete verbs
When doing 'command verb<TAB>', the arguments for verb would be
proposed, but it is too early. We should complete verb first.

https://bugs.freedesktop.org/show_bug.cgi?id=74596
(cherry picked from commit 3ce09b7da2)

Conflicts:
	shell-completion/bash/busctl
	shell-completion/bash/loginctl
	shell-completion/bash/systemctl
	shell-completion/bash/systemd-analyze
2014-02-23 12:42:02 +00:00
Lukas Nykryn e96f97ae44 shell-completion: remove load from systemctl
(cherry picked from commit f89a4474e0)

Conflicts:
	shell-completion/bash/systemctl
2014-02-23 12:42:01 +00:00
Zbigniew Jędrzejewski-Szmek 5db9aa5608 bash-completion: journalctl --file 2014-02-23 12:41:51 +00:00
Zbigniew Jędrzejewski-Szmek 7c185c94af journalctl: add --list-boots to show boot IDs and times
Suggested by David Wilkins <dwilkins@maths.tcd.ie> in
https://bugzilla.redhat.com/show_bug.cgi?id=967521:

> [Specific boot ID is a] bit of a palaver to obtain.  I consulted the
> verbose dump of the journal to discover the _BOOT_ID for the
> timestamp, and then generated the journal dump for that boot using
> journalctl _BOOT_ID=foo -o short-monotonic.
2014-02-23 12:01:38 +00:00
Zbigniew Jędrzejewski-Szmek cd8596ed35 shell-completion: dump has moved to systemd-analyze
Rename NO_OPTION to STANDALONE for consistency with other files.
2014-02-23 12:01:38 +00:00
Dave Reisner d808ca6414 completion/systemctl: add missing list-sockets verb 2013-09-20 14:48:43 -04:00
Zbigniew Jędrzejewski-Szmek 64eed40c07 bash-completion: add systemd-run 2013-09-12 19:36:27 -04:00
Zbigniew Jędrzejewski-Szmek fe05567c31 shell-completions: systemd-analyze set-log-level 2013-08-28 08:04:56 -04:00
Zbigniew Jędrzejewski-Szmek 631c922c68 shell-completion: tell bash about --state 2013-08-12 12:04:49 -04:00
Dave Reisner b5b7ea7503 bash-completion: simplify udevadm completion
The AA is unnecessary and only adds needless complexity. Replace it
with a case statement instead of repeatedly calling __contains_word to
overglorify string equalities.
2013-07-30 13:04:46 -04:00
Dave Reisner a72d698d0d bash-completion: use a better definition of __contains_word
- scope the iterator var
- use the correct, quoted, non-expansion prone positional parameter
  notation
- prevent expansion on RHS of comparison
- remove unneeded explicit returns.

This really should be defined only once...
2013-07-30 13:04:46 -04:00
Harald Hoyer e861b62154 simplify bash completion for kernel-install 2013-07-30 09:46:06 +02:00
Kay Sievers 819da59577 shell-completion: add kernel-install 2013-07-26 02:40:09 +02:00
Jan Janssen a331b5e6d4 journalctl: Add support for showing messages from a previous boot
Hi,

I redid the boot ID look up to use enumerate_unique.

This is quite fast if the cache is warm but painfully slow if
it isn't. It has a slight chance of returning the wrong order if
realtime clock jumps around.

This one has to do n searches for every boot ID there is plus
a sort, so it depends heavily on cache hotness. This is in contrast
to the other way of look-up through filtering by a MESSAGE_ID,
which only needs about 1 seek + whatever amount of relative IDs
you want to walk.

I also have a linked-list + (in-place) mergesort version of this
patch, which has pretty much the same runtime. But since this one
is using libc sorting and armortized allocation, I prefer this
one.

To summarize: The MESSAGE_ID way is a *lot* faster but can be
incomplete due to rotation, while the enumerate+sort will find
every boot ID out there but will be painfully slow for large
journals and cold caches.

You choose :P

Jan
2013-07-16 17:38:12 +02:00
Kay Sievers 9d7d42bc40 udev: add builtin 'keyboard' to manage key mappings 2013-07-10 22:52:55 +02:00
Daniel Albers 98a6e132b5 journalctl,loginctl,systemctl,systemd-cgls: add -l as alias for --full
https://bugs.freedesktop.org/show_bug.cgi?id=65850
2013-06-17 10:33:34 -04:00
Zbigniew Jędrzejewski-Szmek 3f3a438f58 journalctl: add --system/--user flags
--user basically gives messages from your own systemd --user services.
--system basically gives messages from PID 1, kernel, and --system
services. Those two options are not exahustive, because a priviledged
user might be able to see messages from other users, and they will not
be shown with either or both of those flags.
2013-06-10 10:10:06 -04:00
Václav Pavlín 99504dd4c1 systemctl: add commands set-default and get-default
systemctl set-default NAME links the default.target to the given unit,
get-default prints out the path to the currently set default target.
2013-05-30 20:44:41 -04:00
Harald Hoyer bb150966c0 systemd-analyse: add "critical-chain" command
"critical-chain" prints a tree of the critical chain of units

$ ./systemd-analyze critical-chain
graphical.target @1.226s
└─multi-user.target @1.226s
  └─nfs-lock.service @961ms +265ms
    └─rpcbind.service @958ms +1ms
      └─network.target @957ms
        └─NetworkManager.service @434ms +522ms
          └─basic.target @428ms
            └─sockets.target @428ms
              └─dbus.socket @428ms
                └─sysinit.target @427ms
                  └─systemd-tmpfiles-setup.service @411ms +15ms
                    └─local-fs.target @410ms
                      └─boot-efi.automount @410ms
                        └─boot.mount @397ms +9ms
                          └─local-fs-pre.target @192ms
                            └─systemd-udevd.service @187ms +5ms
                              └─systemd-udevd-control.socket @140ms
                                └─-.mount

With the "--fuzz=<ms>" parameter one can display more units around
the critical units.

$ ./systemd-analyze --fuzz=10ms critical-chain
└─multi-user.target @1.226s
  └─nfs-lock.service @961ms +265ms
    ├─rpcbind.service @958ms +1ms
    │ └─network.target @957ms
    │   └─NetworkManager.service @434ms +522ms
    │     ├─basic.target @428ms
    │     │ ├─sockets.target @428ms
    │     │ │ ├─dbus.socket @428ms
    │     │ │ │ └─sysinit.target @427ms
    │     │ │ │   ├─systemd-tmpfiles-setup.service @411ms +15ms
    │     │ │ │   │ └─local-fs.target @410ms
    │     │ │ │   │   └─boot-efi.automount @410ms
    │     │ │ │   │     └─boot.mount @397ms +9ms
    │     │ │ │   │       └─local-fs-pre.target @192ms
    │     │ │ │   │         └─systemd-udevd.service @187ms +5ms
    │     │ │ │   │           ├─systemd-udevd-control.socket @140ms
    │     │ │ │   │           │ └─-.mount
    │     │ │ │   │           └─systemd-udevd-kernel.socket @140ms
    │     │ │ │   └─swap.target @421ms
    │     │ │ │     └─dev-disk-by\x2duuid-....swap @414ms +6ms
    │     │ │ │       └─systemd-journald.socket
    │     │ │ ├─rpcbind.socket @428ms
    │     │ │ └─cups.socket @428ms
    │     │ ├─paths.target @428ms
    │     │ │ └─cups.path @428ms
    │     │ ├─timers.target @427ms
    │     │ │ └─systemd-tmpfiles-clean.timer @427ms
    │     │ └─sysinit.target @427ms
    │     │   └─...
    │     └─dbus.socket @428ms
    │       └─...
    └─network.target @957ms
      └─...
2013-04-26 13:34:22 +02:00
Harald Hoyer 83cb95b530 add bash completion for systemd-analyze 2013-04-24 16:49:33 +02:00
Zbigniew Jędrzejewski-Szmek afba41995d systemctl: show reverse dependencies or before/after ordering
Also update completion scripts a bit.
2013-04-24 00:25:04 -04:00
Harald Hoyer bf83067c1d shell-completion: add shell completion for "systemctl help" 2013-04-22 11:39:19 +02:00
Zbigniew Jędrzejewski-Szmek 90cf049bfe shell-completion: use -a to see "empty" properties 2013-04-17 10:53:18 -04:00
Zbigniew Jędrzejewski-Szmek caffaf5859 bash-completion: --property support
Just bash.
2013-04-17 00:09:16 -04:00
Zbigniew Jędrzejewski-Szmek 20b3f379cf systemctl: allow multiple arguments to --type
This mirrors --property, and is generally useful.

New functionality is used in bash completion.

In case of zsh completion, new functionality is less useful
because of caching. Nevertheless, zsh completion for restart
is made to behave more-or-less the same as bash completion.
At least sockets can be restarted.
2013-04-11 19:11:52 -04:00
Zbigniew Jędrzejewski-Szmek c2e09812e9 shell-completion: show failed units as candidates for start
Also show disabled units as candidates for reenable,
since it works and one may want to do enable-or-reenable
in one line.
2013-04-10 19:47:21 -04:00
Zbigniew Jędrzejewski-Szmek 79c1638303 shell-completion: replace printf with echo
It is faster to use a bash built-in, then to invoke an external
program. The problem of unit names starting with a dash is solved
by prepending a space. Spaces are ignored anyway.

For zsh, replace echo "$unit", which is vulnerable to dashes,
with echo " $unit".
2013-04-10 19:47:16 -04:00
Zbigniew Jędrzejewski-Szmek 9e542e0b3a shell-completion: work on session shell is --user is used
https://bugs.freedesktop.org/show_bug.cgi?id=61695
2013-04-05 11:44:01 -04:00
Harald Hoyer 1535fb7379 shell-completion/bash/journalctl: suppress stderr 2013-03-19 15:04:02 +01:00
Tom Gundersen a3bd8447be udev: make firmware loading optional and disable by default
Distros that whish to support old kernels should set
  --with-firmware-dirs="/usr/lib/firmware/updates:/usr/lib/firmware"
to retain the old behaviour.
2013-03-18 15:19:51 +01:00