Commit Graph

44661 Commits

Author SHA1 Message Date
Zbigniew Jędrzejewski-Szmek 8f7b256665 shared/install: optionally cache the preset list
When doing list-unit-files with --root, we would re-read the preset
list for every unit. This uses a cache to only do it once. The time
for list-unit-files goes down by about ~30%.

unit_file_query_preset() is also called from src/core/. This patch does not
touch that path, since the saving there are smaller, since preset status is
only read on demand over dbus, and caching would be more complicated.
2020-05-05 21:50:31 +02:00
Chris Down 87afd40b5a man: systemd.service: systemd-analyze exit-codes -> exit-status
5238d9a83a renames this to exit-status, but systemd.service was not
updated.

The rest of the doc seems a bit inconsistent in its use of the terms
"exit code" and "exit status", but it's not that confusing, so leave
those alone for now.
2020-05-05 21:38:29 +02:00
Ferran Pallarès Roca a8acbf9748 Add Zowie ZA12 details to mouse hwdb 2020-05-05 19:06:29 +02:00
Zbigniew Jędrzejewski-Szmek c39b7821f6 systemctl: fix --root support in querying presets
We would always look on the host, ignoring --root.
2020-05-05 18:05:32 +02:00
Zbigniew Jędrzejewski-Szmek 4cb1015e6b systemctl: refuse online-only ops with --root
It is super confusing when a command does not support --root, and is called
with it specified, and returns some bogus results. Let's just catch this
early and refuse.
2020-05-05 18:05:23 +02:00
Zbigniew Jędrzejewski-Szmek 9321e23c40 shared/verbs: split out helper to find verbs
It will be used later, but I think it makes the code clearer anyway.

Also change the message about ignoring to include the name for default
verbs.
2020-05-05 18:04:55 +02:00
Zbigniew Jędrzejewski-Szmek d8b065e056 shared/verbs: add a modicum of documentation 2020-05-05 18:04:44 +02:00
Zbigniew Jędrzejewski-Szmek ae98f726ff systemctl: mark log-level,log-target,service-watchdogs as online-only
They were added in 6ab863190d and
38fcb7f766. I don't see a good reason to
exclude them from the online-only check.
2020-05-05 18:04:36 +02:00
Zbigniew Jędrzejewski-Szmek 77102db288 systemctl: fix hint when 'systemctl help' is given
Not all verbs require unit names, but that is beside the point. We need a verb
here, and help is not a valid verb.
2020-05-05 18:04:28 +02:00
Zbigniew Jędrzejewski-Szmek eaf7ac4929
Merge pull request #15645 from poettering/calender-expression-doc-fix
some calendar expression fixes and documentation updates
2020-05-05 16:07:11 +02:00
Frantisek Sumsal 05c7d9bf5b Revert "logs-show: declare [static 2] on all highlight parameters"
This reverts commit 5444520628.

See: https://github.com/systemd/systemd/pull/15706
2020-05-05 16:37:45 +03:00
Zbigniew Jędrzejewski-Szmek 640ebaa952
Merge pull request #15648 from poettering/journalctl-cat-beefup
journalctl: honour --output-fields= in -o cat mode
2020-05-05 14:00:26 +02:00
Lennart Poettering c83347b49d man: migrate more specifier explanations to standard-specifiers.xml
We probably can migrate even more, but for now let's just migrate those
which have the 1:1 identical text everywhere.

(Also, let's add the % entry to all specifier tables)
2020-05-05 11:33:13 +02:00
Zbigniew Jędrzejewski-Szmek 90f1f8188b
Merge pull request #15701 from poettering/systemctl-json-table
systemctl: optionally output tables as json
2020-05-05 11:05:00 +02:00
ianhi cae97f3b60 correct evdev dimensions for T490 trackpad
The original source of these dimensions had swapped the x y dimension
arguments to touchpad-edge-detector. The correct dimensions are
x = 100 mm, y = 68 mm
2020-05-05 10:30:43 +02:00
Diego Escalante Urrelo 4723f9ef16 hwdb: Fix brightness keys for Logitech K811
Closes: #15698
2020-05-05 10:28:54 +02:00
Lennart Poettering 5fe4d1b514 shutdown: fix spacing in shutdown error message 2020-05-05 10:23:47 +02:00
Lennart Poettering 5444520628 logs-show: declare [static 2] on all highlight parameters 2020-05-05 09:22:27 +02:00
Lennart Poettering e0e3d38726 man: document the new -o cat feature 2020-05-05 09:22:27 +02:00
Lennart Poettering 4d5d1bba73 journalctl: optionally, show a different field than MESSAGE in -o cat mode
Fixes: #15621
2020-05-05 09:22:26 +02:00
Lennart Poettering 54ff74d273 journal: use set_contains() where appropriate 2020-05-05 09:04:30 +02:00
Motiejus Jakštys 5c4deb9a5c nspawn: mount custom paths before writing to /etc
Consider such configuration:

    $ systemd-nspawn --read-only --timezone=copy --resolv-conf=copy-host \
        --overlay="+/etc::/etc" <...>

Assuming one wants `/` to be read-only, DNS and `/etc/localtime` to
work. One way to do it is to create an overlay filesystem in `/etc/`.
However, systemd-nspawn tries to create `/etc/resolv.conf` and
`/etc/localtime` before mounting the custom paths, while `/` (and, by
extension, `/etc`) is read-only. Thus it fails to create those files.

Mounting custom paths before modifying anything in `/etc/` makes this
possible.

Full example:

```
$ debootstrap buster /var/lib/machines/t1 http://deb.debian.org/debian
$ systemd-nspawn --private-users=false --timezone=copy --resolv-conf=copy-host --read-only --tmpfs=/var --tmpfs=/run --overlay="+/etc::/etc" -D /var/lib/machines/t1 ping -c 1 example.com
Spawning container t1 on /var/lib/machines/t1.
Press ^] three times within 1s to kill container.
ping: example.com: Temporary failure in name resolution
Container t1 failed with error code 130.
```

With the patch:

```
$ sudo ./build/systemd-nspawn --private-users=false --timezone=copy --resolv-conf=copy-host --read-only --tmpfs=/var --tmpfs=/run --overlay="+/etc::/etc" -D /var/lib/machines/t1 ping -qc 1 example.com
Spawning container t1 on /var/lib/machines/t1.
Press ^] three times within 1s to kill container.
PING example.com (93.184.216.34) 56(84) bytes of data.

--- example.org ping statistics ---
1 packets transmitted, 1 received, 0% packet loss, time 0ms
rtt min/avg/max/mdev = 110.912/110.912/110.912/0.000 ms
Container t1 exited successfully.
```
2020-05-05 09:02:57 +02:00
Lennart Poettering 2edc7aea7a man: expand on the star…end/repetition time expressions
And attempt to explain what is requested in #15030, but still be
concise.

Fixes: #15030
2020-05-05 08:57:14 +02:00
Lennart Poettering c9c9f6f450 calendarspec: be more graceful with two kinds of calendar expressions
This changes the calendarspec parser to allow expressions such as
"00:05..05", i.e. a range where start and end is the same. It also
allows expressions such as "00:1-2/3", i.e. where the repetition value
does not fit even once in the specified range. With this patch both
cases will now be optimized away, i.e. the range is removed and a fixed
value is used, which is functionally equivalent.

See #15030 for an issue where the inability to parse such expressions
caused confusion.

I think it's probably better to accept these gracefully and optimizing
them away instead of refusing them with a plain EINVAL. With a tool such
as "systemd-analyze" calendar it should be easy to figure out the
normalized form with the redundant bits optimized away.
2020-05-05 08:57:14 +02:00
Lennart Poettering 05851cb9df calendarspec: minor simplification 2020-05-05 08:57:14 +02:00
Lennart Poettering 3c6f0300ae calendarspec: drop _pure_ from static function
For static functions the compiler should be able to determine this on
its own, let's not add needless decorators.
2020-05-05 08:57:14 +02:00
Lennart Poettering 80b19994a4 calendarspec: pack our flags a bit 2020-05-05 08:57:14 +02:00
Lennart Poettering a4d6d711cf calendarspec: encode that it's OK to store µs in 'int's 2020-05-05 08:57:14 +02:00
Lennart Poettering 49cd06fa2d systemctl: optionally output tables in JSON format 2020-05-05 08:15:04 +02:00
Lennart Poettering e21b76cd68 format-table: generate better JSON field names
Let's try to mangle table contents a bit to make them more suitable as
JSON field names. Specifically when we see "foo bar" convert this to
"foo_bar" as field name, as variable/field names are generally assumed
to be without spaces.
2020-05-05 08:13:58 +02:00
Anita Zhang 848cfa74d2
Merge pull request #15636 from poettering/sensitivity-training
be more careful when setting json variant + dbus message sensitive flag
2020-05-04 17:48:13 -07:00
Anita Zhang 53491f7fe7
Merge pull request #15647 from benzea/benzea/graphical-use-app-prefix
docs: Change prefix for desktop applications to app-
2020-05-04 16:28:51 -07:00
Michal Koutný 05d9125ece mkosi: Fix openSUSE image declaration
User accounts of given names are necessary for the build script and
tests to succeed.

(Fixup of #15527, too keen cleaning of dependencies and cached image
caused this.)
2020-05-04 22:12:58 +02:00
Lukas Klingsbo 8049c79b65 Add Kensington SlimBlade Trackball 2020-05-04 18:48:01 +02:00
Piotr Drąg 793452e0ba catalog,po: update Polish translation 2020-05-04 17:13:02 +02:00
Frantisek Sumsal 111e71c431 test: fix potential use-after-free
CID#1428676.
2020-05-04 17:10:18 +02:00
Evgeny Vereshchagin 80cf50120c
Merge pull request #15422 from nolange/add_zstd_coredump
coredump: add zstandard support for coredumps
2020-05-04 14:57:39 +03:00
Norbert Lange 8012d5c08e install libzstd-dev for CI builds 2020-05-04 10:59:43 +02:00
Norbert Lange ef5924aa31 coredump: add zstandard support for coredumps
this will hook libzstd into coredump,
using this format as default.
2020-05-04 10:59:43 +02:00
Lennart Poettering ddd6a22a0f basic: add STRCASE_IN_SET() which is to STR_IN_SET() what strcaseeq() is to streq() 2020-05-04 10:11:19 +02:00
Zbigniew Jędrzejewski-Szmek fc021a5bbf logind,importd,hostnamed,localed,timedated,machined,resolved: add option parsing stubs
--help and --version are implemented in the usual style.
help() prints full path, since the program is not expected to
be in $PATH.
2020-05-03 10:55:51 +02:00
Zbigniew Jędrzejewski-Szmek 7ae473268c manager: add highlighting to --help
Also change the summary line to a bit more concise.
2020-05-03 10:55:51 +02:00
Zbigniew Jędrzejewski-Szmek 53f7f7fcf2 util-lib: add stub parser for --help, --version 2020-05-03 10:55:51 +02:00
Zbigniew Jędrzejewski-Szmek ab09bf9007 importd: wrap long lines 2020-05-03 10:55:51 +02:00
Zbigniew Jędrzejewski-Szmek b49ca3bc37 sd-bus: use STR_IN_SET() in one more place 2020-05-03 10:55:51 +02:00
Zbigniew Jędrzejewski-Szmek 2b6a1d155d bus-introspect: move xml string defines into the .c file 2020-05-03 10:55:51 +02:00
Zbigniew Jędrzejewski-Szmek 61d0df3919 bus-introspect: write <interface> from within introspect_write_interface() 2020-05-03 10:55:51 +02:00
Frantisek Sumsal 2d4f8cf467 man: fix few spelling errors
Reported by Fossies.org.
2020-05-03 10:23:25 +02:00
Michal Koutný 2e4086060b test: Fix build with !HAVE_LZ4 && HAVE_XZ
HUGE_SIZE was defined inconsistently.

> In file included from ../src/basic/alloc-util.h:9,
>                  from ../src/journal/test-compress.c:9:
> ../src/journal/test-compress.c: In function ‘main’:
> ../src/journal/test-compress.c:280:33: error: ‘HUGE_SIZE’ undeclared (first use in this function)
>   280 |         assert_se(huge = malloc(HUGE_SIZE));
2020-05-02 20:04:36 +00:00
Evgeny Vereshchagin 9494b39dac cifuzz: upload artifacts only when the "run fuzzers" step fails 2020-05-02 11:20:30 +02:00