Commit graph

140 commits

Author SHA1 Message Date
David Herrmann 34b52450c5 hostname: add 'convertible' chassis type
Add the 'convertible' type to the set of allowed chassis. This applies
to all devices that can be transformed by the user from laptop style to
tablet style.

This does not add any auto-detection, yet. It only makes 'set-chassis'
accept 'convertible' as valid input.
2017-02-28 11:54:52 +01:00
Giedrius Statkevičius 15710d4479 shell-completion: include the new coredumpctl options 2017-02-24 21:30:59 +02:00
Namhyung Kim 5badf05f39 shell_completion: Add -r option for coredumpctl 2017-02-14 23:27:16 +09:00
Zbigniew Jędrzejewski-Szmek bef19548a2 systemctl: restore --failed (#5198)
'systemctl --failed' is an extremely common operation and it's nice to have
a shortcut for it.

Revert "man: don't document systemctl --failed" and add the option back to
systemctl's help and shell completion scripts.

This reverts commit 036359ba8d.
2017-02-02 00:23:46 +01:00
llua 644317741a zsh-completion: _journalctl fixes (#5165)
allow _journalctl to work when the rcquotes option is set, broken in ba89f80620.
allow the completion of --file multiple times, which ba89f80620 claims is true.

Fixes #4842
2017-01-27 09:50:40 -03:00
Александр Тихонов 88e4dbd505 Fixi caching in zsh completion (#5122)
I found several issues with zsh completion code:

1. typo in cache filename: "SYS_ALL_PROPRTIES", so cache just not loading from this file
2. cache stored in one file, despite user or system mode. So it can be loaded later in wrong mode
3. most serious problem: broken logic - it retrieves cache when _cache_invalid is true

How to reproduce: type "systemctl --user status <TAB>" and you will see user units. Then press 
control+C and type "systemctl --system status <TAB>" in same session and you'll see user units again
2017-01-21 14:53:09 -05:00
Zbigniew Jędrzejewski-Szmek 99171d2fdf shell-completion: redirect all errors from systemctl to /dev/null
Completion scripts should not generate errors, ever.

https://bugzilla.redhat.com/show_bug.cgi?id=1409649
2017-01-11 16:37:34 -05:00
Doug Christman 07d6181589 zsh-completion: fix typo and rephrase option hints (#4963) 2016-12-23 14:37:28 +01:00
Zbigniew Jędrzejewski-Szmek 869feb3388 analyze: add syscall-filter verb
This should make it easier for users to understand what each filter
means as the list of syscalls is updated in subsequent systemd versions.
2016-11-03 09:35:35 -04:00
llua 6c9414a700 zsh-completion: fix for #4318 (#4394)
Escape unit names for the eval call in _call_program

The value of the Id property is transformed back into a unit name
usable by systemctl.
system-systemd\x5cx2dcryptsetup.slice -> system-systemd\x2dcryptsetup.slice

Also filter units by property via parameter expansion, not a for loop
2016-10-17 14:35:26 +02:00
Davide Cavalca c0f9116d6c shell-completion: add --wait to systemd-run completions (#4140) 2016-09-14 22:38:53 +02:00
Daniel Hahler b2fe35fe58 zsh: _journalctl: also handle --root arg and --key=value style (#3956)
This will now also handle `journalctl --directory=/var/log/journal`
properly.
2016-08-16 12:47:39 -04:00
Daniel Hahler ba89f80620 zsh: _journalctl: do not complete exclusive modes (#3957)
After `journalctl -D /var/log/journal` "--directory", "--file",
"--machine" and "--root" should not be available for completion, because
they are exclusive.  But multiple `--file` arguments are allowed.
2016-08-16 12:42:41 -04:00
Daniel Hahler e09d0d46c2 zsh: _systemctl: do not attempt to use "--system" by default (#3951)
In 68c4f6d the following was added:

    local -a _modes; _modes=("--user" "--system")
    local _sys_service_mgr=${${words:*_modes}[(R)(${(j.|.)_modes})]:---system}

With the following comment:

> If neither are on the line, --system is set; for system services to be
> completed.

But it does not work as documented:

    % _modes=(--user --system)
    % words=()
    % echo ${${words:*_modes}[(R)(${(j.|.)_modes})]:---system}

However, it should not use `--system` in that case anyway, so this patch
removes the part that should cause a default to be used and adds some
comments.
2016-08-13 10:42:55 -04:00
Daniel Hahler d551b8fcf7 zsh: _journalctl: improve support for handling mode args (#3952)
This only completes fields from `journalctl --user` in _journal_fields when `--user`
is used.

It also changes $_sys_service_mgr to include both `--system` and `--user`,
because `journalctl` behaves different from `systemctl` in this regard.
No attempt is made to filter out invalid combinations, e.g. when using both
`--directory` and `--system` (see https://github.com/systemd/systemd/issues/3949).
2016-08-13 10:41:22 -04:00
Daniel Hahler 21d84318c3 zsh: _journalctl: handle --user in _journal_none
This uses the same mechanism from _systemctl to inject `--user` into the
`journalctrl -F _EXE` call to list executables.
Before this patch the "commands" section would list executables from
system units always.
2016-08-11 18:52:13 +02:00
Daniel Hahler 56ef545c24 zsh: _filter_units_by_property: respect --user
Use `$_sys_service_mgr` to handle `--user`, so that `systemctl --user
stop` will correctly filter the active (user) units.  Before this patch,
only user units that also exist as system units and are stoppable there
would be listed.
2016-08-11 18:46:31 +02:00
Lennart Poettering 29a753df76 journalctl: add new output mode "short-full" (#3880)
This new output mode formats all timestamps using the usual format_timestamp()
call we use pretty much everywhere else. Timestamps formatted this way are some
ways more useful than traditional syslog timestamps as they include weekday,
month and timezone information, while not being much longer. They are also not
locale-dependent. The primary advantage however is that they may be passed
directly to journalctl's --since= and --until= switches as soon as #3869 is
merged.

While we are at it, let's also add "short-unix" to shell completion.
2016-08-03 19:45:07 -04:00
Alessandro Puccetti 2a624c36e6 doc,core: Read{Write,Only}Paths= and InaccessiblePaths=
This patch renames Read{Write,Only}Directories= and InaccessibleDirectories=
to Read{Write,Only}Paths= and InaccessiblePaths=, previous names are kept
as aliases but they are not advertised in the documentation.

Renamed variables:
`read_write_dirs` --> `read_write_paths`
`read_only_dirs` --> `read_only_paths`
`inaccessible_dirs` --> `inaccessible_paths`
2016-07-19 17:22:02 +02:00
ntzrmtthihu777 b010a6a1ae zsh-completion: fix option ordering in set-x11-keymap (#3646) 2016-07-15 04:59:45 -04:00
Alessandro Puccetti 14ca5c9cb4 nspawn-completion: implementation of shell completion of --notify-ready (#3679)
Relative to: https://github.com/systemd/systemd/pull/3474
2016-07-08 17:44:20 +02:00
Christian Rebischke b2bb19bbda machinectl: Added stop as alias for poweroff (#3406) 2016-06-06 17:06:20 +02:00
Zbigniew Jędrzejewski-Szmek ed1190498f tree-wide: remove uses of --failed
It has been replaced by --state=failed.
2016-05-08 20:27:33 -04:00
Felipe Sateler 673fca32be zsh-completion: remove non-portable uses of \s in awk (#3063) 2016-04-19 00:23:01 -04:00
Felipe Sateler c54318c66f Add zsh completion for networkctl (#3062) 2016-04-18 23:27:42 +02:00
Zbigniew Jędrzejewski-Szmek e81eb2874e systemd-resolve: initial shell completion
v2:
- use /sys/class/net to list interfaces,
  also copy the same code to systemd-nspawn
v3:
- do not propose "any" twice for --type
2016-02-18 11:50:53 -05:00
Daniel Mack 50f48ad37a cgroup: remove support for NetClass= directive
Support for net_cls.class_id through the NetClass= configuration directive
has been added in v227 in preparation for a per-unit packet filter mechanism.
However, it turns out the kernel people have decided to deprecate the net_cls
and net_prio controllers in v2. Tejun provides a comprehensive justification
for this in his commit, which has landed during the merge window for kernel
v4.5:

  https://git.kernel.org/cgit/linux/kernel/git/torvalds/linux.git/commit/?id=bd1060a1d671

As we're aiming for full support for the v2 cgroup hierarchy, we can no
longer support this feature. Userspace tool such as nftables are moving over
to setting rules that are specific to the full cgroup path of a task, which
obsoletes these controllers anyway.

This commit removes support for tweaking details in the net_cls controller,
but keeps the NetClass= directive around for legacy compatibility reasons.
2016-02-10 16:38:56 +01:00
Zbigniew Jędrzejewski-Szmek 8cd095cc27 shell-completion: fix header 2016-02-06 17:54:48 -05:00
Lennart Poettering aabf5d4243 systemctl: rename "reload-or-try-restart" verb to "try-reload-or-restart"
But also keep the old name as (undocumented) compatibility around.

The reload-or-try-restart was documented to be a NOP if the unit is not running, since the previous commits this is
also implemented. The old name suggests that the "try" logic only applies to restarting. Fix this, by moving the "try-"
to the front, to indicate that the whole option is a NOP if the service isn't running.
2016-01-28 18:57:04 +01:00
Douglas Christman 655fd9d71f zsh-completion: Escape results for journalctl --unit
Escape colons and backslashes in unit names.
This gives correct completions for units with names like
    systemd-backlight@backlight:acpi_video0.service
and
    systemd-fsck@dev-disk-by\x2duuid-...
2016-01-25 18:10:31 -05:00
Lennart Poettering b43d75c378 importd: drop dkr support
The current code is not compatible with current dkr protocols anyway,
and dkr has a different focus ("microservices") than nspawn anyway
("whole machine containers"), hence drop support for it, we cannot
reasonably keep this up to date, and it creates the impression we'd
actually care for the microservices usecase.
2015-12-10 16:54:41 +01:00
Filipe Brandenburger b4c14404b3 execute: Add new PassEnvironment= directive
This directive allows passing environment variables from the system
manager to spawned services. Variables in the system manager can be set
inside a container by passing `--set-env=...` options to systemd-spawn.

Tested with an on-disk test.service unit. Tested using multiple variable
names on a single line, with an empty setting to clear the current list
of variables, with non-existing variables.

Tested using `systemd-run -p PassEnvironment=VARNAME` to confirm it
works with transient units.

Confirmed that `systemctl show` will display the PassEnvironment
settings.

Checked that man pages are generated correctly.

No regressions in `make check`.
2015-11-11 07:55:23 -08:00
Zbigniew Jędrzejewski-Szmek 36b4a7ba55 Remove snapshot unit type
Snapshots were never useful or used for anything. Many systemd
developers that I spoke to at systemd.conf2015, didn't even know they
existed, so it is fairly safe to assume that this type can be deleted
without harm.

The fundamental problem with snapshots is that the state of the system
is dynamic, devices come and go, users log in and out, timers fire...
and restoring all units to some state from the past would "undo"
those changes, which isn't really possible.

Tested by creating a snapshot, running the new binary, and checking
that the transition did not cause errors, and the snapshot is gone,
and snapshots cannot be created anymore.

New systemctl says:
Unknown operation snapshot.
Old systemctl says:
Failed to create snapshot: Support for snapshots has been removed.

IgnoreOnSnaphost settings are warned about and ignored:
Support for option IgnoreOnSnapshot= has been removed and it is ignored

http://lists.freedesktop.org/archives/systemd-devel/2015-November/034872.html
2015-11-10 19:33:06 -05:00
Evgeny Vereshchagin dcebcd7ade shell-completion: systemd-run: add the property RuntimeDirectory 2015-10-27 05:18:12 +03:00
Evgeny Vereshchagin 64fa5643df shell-completion: systemd-run: add the property ProtectHome 2015-10-26 00:22:34 +00:00
Zbigniew Jędrzejewski-Szmek 5ef80f3bbb zsh-completion: journalctl --identifier
Fixes #1549.
2015-10-25 10:49:19 -04:00
Evgeny Vereshchagin 4e79ac4425 shell-completion: systemd-run: add the property ProtectSystem 2015-10-24 22:49:46 +00:00
Nicolas Cornu 7e7cd2526d shell-completion: systemd-run: add new property EnvironmentFile 2015-10-21 16:18:59 +02:00
Nicolas Cornu 5ffd7671cc Add zsh completion on systemd-run's properties 2015-10-21 15:51:09 +02:00
Lennart Poettering b3ccac01cc zsh: don't mention /etc/mtab
The file is obsolete, use /proc/self/mounts instead.

Also, yuck, the code is so awful...
2015-10-09 17:20:32 +02:00
Zbigniew Jędrzejewski-Szmek 840b2c0e77 shell-completion: use systemctl --state=help
This way completion lists should stay up to date.

Also use systemctl -t help to list types in zsh, as was already
done in bash.
2015-09-28 15:10:03 -04:00
Nicolas Cornu cade10ccef zsh completion: update busctl 2015-08-15 13:58:05 +02:00
Eric Cook fb9d85b71a zsh-completion: _loginctl/_systemd/_systemd-inhibit improvements
_loginctl: respects the verbose style. which allows a user to get
the pre d5df0d950f behavior of not showing a description for sessions
and users, by default they aren't shown.

zstyle ':completion:*' verbose true
or
zstyle ':completion:*:loginctl*:*' verbose true # or similar
Will show the descriptions.

zstyle ':completion:*' verbose true
and
zstyle ':completion:*:loginctl*:*' verbose false # or similar
Won't show descriptions for loginctl only

_systemd: complete pids for systemd-notify's --pid option.
display a message of the expected argument for other options.

_systemd-inhibit: complete block & delay for --mode
display a message of the expected argument for --who/--why
2015-06-22 18:07:32 -04:00
Eric Cook 38cf1e292b zsh-completion: _systemd-nspawn - add more argument completion
filenames will be completed for --image/-i/--bind/--bind-ro/--tmpfs
network interfaces for --network-(interface|macvlan|ipvlan|bridge)
users for --user/-u, yes & no for --register, x86 * x86-64 for
--personality

display a message of the expected argument for --machine/-M/--uuid
--slice/-S/--port/-p/--selinux-*/-Z/-L/--setenv

Allow completing commands(and their options) of the host system for COMMAND
2015-06-21 21:59:26 -04:00
Eric Cook b0fe29ff9e zsh-completion: _loginctl - general bug fixes
1) the iterator `fun' has an local scope. after running the completer,
it will no longer be defined.

2) use _describe instead of calling compadd. Using compadd without
calling _description or something similar before, restricts the
user's ability to customize what is presented to them.
zstyle ':completion:*' format 'Completing %d'
  - now displays an header showing what is being completed.
zstyle ':completion::complete:loginctl-*::users' users user1 user2
  - allows the user to manually specify which users is offered
zstyle :completion::complete:loginctl-kill-user:\* \
ignored-patterns '(100<0-4>|user1)'
  - selectively ignore some users when completing loginctl kill-user
    <tab>
Sessions, UIDs now have descriptions when selecting them.

3) removed the call to _loginctl_all_seats in _loginctl_attach(), since
_loginctl_seats calls it a second time, right before adding matches.
There isn't a noticeable difference doing this.
2015-06-17 07:41:24 -04:00
Daniel Hahler a0ab162a09 zsh-completion: optimize _filter_units_by_property
Optimize _filter_units_by_property by calling `systemctl` only once with
a list of units, and not once per unit.

I could not reproduce the "Unknown unit" error mentioned in a FIXME,
which might have made this necessary previously.
2015-06-06 12:54:41 +02:00
Daniel Mack d4cb023490 Merge pull request #5 from systemd-mailing-devs/1432910411-14517-1-git-send-email-llua@gmx.com
zsh-completion: a more style/tag aware _systemctl
2015-06-02 17:57:43 +02:00
Daniel Mack ad2274289b Merge pull request #4 from systemd-mailing-devs/1431989131-25145-1-git-send-email-llua@gmx.com
zsh-completion: fix completion of --user services
2015-06-02 17:43:29 +02:00
Daniel Mack c521a430fd zsh-completion: fix typo in _bootctl
The command is 'install', not 'instal'. Fix that typo.
2015-06-01 12:07:19 +02:00
Ronny Chevalier da090dfd0b zsh-completion: update bootctl 2015-05-30 11:19:35 +02:00