1
0
mirror of https://github.com/systemd/systemd.git synced 2025-01-10 05:18:17 +03:00
Commit Graph

68628 Commits

Author SHA1 Message Date
Frantisek Sumsal
b2603465d4 coredumpctl: propagate SIGTERM to the debugger process
If we're waiting for the debugger process to exit and receive SIGTERM,
propagate it to all processes in our process group, including the
debugger, so we can follow it up with a proper cleanup.

Resolves: #28772
2023-11-07 15:41:33 +00:00
Yu Watanabe
c4efe0e51e sd-dhcp-client: gracefully ignore OFFER with Rapid Commit option
Fixes #29904.
2023-11-07 16:13:54 +01:00
Lennart Poettering
5568043a84
Merge pull request #29907 from poettering/dispatch-uint64_t-as-string
teach json_dispatch_uint64() to parse decimal strings
2023-11-07 16:13:34 +01:00
Lennart Poettering
8353229e10 update CI 2023-11-07 16:08:06 +01:00
Lennart Poettering
a6906aa579 update TODO 2023-11-07 16:08:06 +01:00
Lennart Poettering
35f58f8c36 man: document /usr/lib/modules/ paths as recommend copy source for kernel-install 2023-11-07 16:08:06 +01:00
Lennart Poettering
758d14767d kernel-install: make "inspect" work more like "add" regarding omission of parameters
This makes "kernel-install inspect" work more "kernel-install add": if
the version or kernel image is specified as "-" or omitted we'll make it
up.
2023-11-07 16:07:57 +01:00
Lennart Poettering
ec1399f567 kernel-install: add add-all verb 2023-11-07 16:07:55 +01:00
Lennart Poettering
9d9e99a8f0 kernel-install: make version/kernel image parameters optional for "add"
Let's make kernel-install a bit easier to use:

If the kernel version is not specified, let's imply "uname -r", so that
we regnerate the entries for the current kernel.

If the kernel image is not specified let's imply using
/usr/lib/modules/$version/vmlinuz, i.e. the location distros like Fedora
drop the kernel into, which we generally recommend people to use.

If the kernel is not found there, don't try to automatically pick the
kernel path, and fail, as before.
2023-11-07 16:07:25 +01:00
Lennart Poettering
658e6cc4ae kernel-install: add command to list installed kernels
This simply dumps the dirs in /usr/lib/modules/ and whether they contain
a vmlinuz binary.
2023-11-07 16:07:05 +01:00
Lennart Poettering
9942f855a9 tree-wide: take in all *our* JSON structures also decimal strings
Let's be friendly in what we accept: whenever we define a JSON
structure, let's also allow decimal strings where we want an integer.

This patch purely replaces JSON_VARIANT_UNSIGNED by
_JSON_VARIANT_TYPE_INVALID in the various JsonDispatch[] tables, so that
we'll happily accept any type in json_dispatch(), so that
json_dispatch_uint64() and related tools can do their thing.

This does not switch over OCI (as a JSON structure not defined by us).
2023-11-07 14:25:40 +01:00
Lennart Poettering
67a3028555 json: teach dispatch logic to also take numbers formatted as strings
JSON famously is problematic with integers beyond 53 bits, because
JavaScript stores everything in double precision floating points.
Various implementations in other languages can deal with signed 64 bit
integers, and a few can deal with unsigned 64bit too (like ours).

Typically program that need more then 53 bit of accuracy encode integers
as decimal strings, to make sure that even if consumers can't really
process larger values they at least won't corrupt the data while passing
it along. This is also recommended by JSON-I (RFC 7493)

To maximize compatibility with other implementations let's add 1st class
parsing support for such objects in the json_dispatch() API.

This makes json_dispatch_uint64() and related calls parse such
integers-formatted-as-decimal-strings as uint64_t. This logic will only
be enabled if the "type" field of JsonDispatch is left unspecified (i.e.
set to negative/_JSON_VARIANT_TYPE_INVALID) though, hence alone does not
change anything in effect.

This purely is about consuming such values, whether we should genreate
them also is a discussion for a separate PR.
2023-11-07 14:25:40 +01:00
Lennart Poettering
6a20a9d286 string-util: add strdup_or_null() helper 2023-11-07 12:23:27 +01:00
Antonio Alvarez Feijoo
14ac242d50 bootspec: fix typo 2023-11-07 11:17:12 +00:00
Iago López Galeiras
e720cebf7c test-execute: add no_new_privs tests for SystemCallFilter
When starting a service with a non-root user and a SystemCallFilter and
other settings (like ProtectClock), the no_new_privs flag should not be set.

Also, test that CapabilityBoundingSet behaves correctly, since we need
to preserve some capabilities to do the seccomp filter and restore the
ones set by the service before executing.
2023-11-07 11:31:53 +01:00
Iago López Galeiras
24832d10b6 core: allow using seccomp without no_new_privs when unprivileged
Until now, using any form of seccomp while being unprivileged (User=)
resulted in systemd enabling no_new_privs.

There's no need for doing this because:

* We trust the filters we apply
* If User= is set and a process wants to apply a new seccomp filter, it
will need to set no_new_privs itself

An example of application that might want seccomp + !no_new_privs is a
program that wants to run as an unprivileged user but uses file
capabilities to start a web server on a privileged port while
benefitting from a restrictive seccomp profile.

We now keep the privileges needed to do seccomp before calling
enforce_user() and drop them after the seccomp filters are applied.

If the syscall filter doesn't allow the needed syscalls to drop the
privileges, we keep the previous behavior by enabling no_new_privs.
2023-11-07 11:31:53 +01:00
Diego Viola
b3e199cec8 TODO: fix more typos 2023-11-07 10:49:58 +01:00
Diego Viola
3a9e659a0e TODO: fix typos 2023-11-07 17:26:31 +09:00
Mike Yuan
e592bf5d11
Merge pull request #29879 from Flowdalic/cgroup-memory-peak
cgroup: add support for memory.peak
2023-11-07 09:53:57 +08:00
Luca Boccassi
58a2ab5e9d
Merge pull request #29888 from mrc0mmand/network-generator
test: add a couple of tests for systemd-network-generator
2023-11-07 00:10:43 +00:00
Daan De Meyer
04a8c2ce30 kernel-install: Add --root, --image and --image-policy
Currently only supported for the "inspect" verb as "add" and "remove"
require figuring out what to do with plugins.
2023-11-06 22:29:36 +01:00
Tad Fisher
4ca7c94e16 resolve: use exact-match domain as routing domain for single-labels
With ResolveUnicastSingleLabel=yes, a scope's search domains are affixed to the
query even when a routing domain matches the single-label query name,
preventing the use of dotless single-label domains entirely.

This changes dns_scope_name_wants_search_domain() to return false when the
scope contains an exact match of the single-label name in the query, allowing
lookups for dotless domains with ResolveUnicastSingleLabel enabled.
2023-11-06 22:27:12 +01:00
Luca Boccassi
4a5bf4896f
Merge pull request #29882 from keszybz/documentation-cleanup
Documentation cleanup
2023-11-06 21:24:08 +00:00
Frantisek Sumsal
4457a2e0ee test: wait for the "latest" systemd-bsod message
Let's wait for the "latest" message systemd-bsod prints to the console
to appear, otherwise we might be too fast and take a console snapshot
before it contains all the information:

[   44.237788] testsuite-04.sh[1744]: + setterm --term linux --dump --file /tmp/console.dump
[   44.246089] systemd-bsod[1858]: QR code could not be printed, ignoring: Operation not supported
[   44.305692] testsuite-04.sh[1744]: + grep -aq 'The current boot has failed' /tmp/console.dump
[   44.308047] testsuite-04.sh[1744]: + grep -aq 'Service emergency message' /tmp/console.dump
[   44.311200] testsuite-04.sh[1744]: + grep -aq 'Press any key to exit' /tmp/console.dump
[   44.314359] testsuite-04.sh[1744]: + at_exit
[   44.315087] testsuite-04.sh[1744]: + local EC=1
[   44.315945] testsuite-04.sh[1744]: + [[ 1 -ne 0 ]]
[   44.316647] testsuite-04.sh[1744]: + [[ -e /tmp/console.dump ]]
[   44.318305] testsuite-04.sh[1744]: + cat /tmp/console.dump
[   44.319320] testsuite-04.sh[1871]:    The current boot has failed!
[   44.319970] testsuite-04.sh[1871]:    Service emergency message
2023-11-06 21:01:24 +00:00
Yu Watanabe
d377949085 test-network: test MultiPathRoute= via another interface
Prompted by https://github.com/systemd/systemd/pull/14194#issuecomment-1795489641.
2023-11-06 20:59:49 +00:00
Frantisek Sumsal
6bc5de53e8 test: add a couple of tests for systemd-network-generator
Only for ip= stuff, for now.
2023-11-06 21:38:14 +01:00
Luca Boccassi
8691613c68
Merge pull request #29894 from bluca/typo
udev/man typos
2023-11-06 20:29:16 +00:00
Zbigniew Jędrzejewski-Szmek
0155b0657d man/systemd-stub: split and simplify a wall'o'text paragraph 2023-11-06 20:16:34 +01:00
Zbigniew Jędrzejewski-Szmek
cae4ad367d man/networkctl,systemd-soft-reboot: capitalize and add periods
We added version information, so now each bullet point contains multiple
paragraphs, so we need proper sentences.
2023-11-06 20:16:34 +01:00
Zbigniew Jędrzejewski-Szmek
de6d05d78d man: "Documentation" is not part of the title
<ulinks> contents are used to generate a SEE ALSO section at the
bottom of a man page, so we need to include the title, without additional
words, in the content.
2023-11-06 20:16:34 +01:00
Zbigniew Jędrzejewski-Szmek
bf63dadbc6 man: more hyperlinks and other fixes
Closes https://github.com/systemd/systemd/issues/29814.
2023-11-06 20:16:34 +01:00
Zbigniew Jędrzejewski-Szmek
55e40b0be8 tree-wide: s/life-cycle/lifecycle/g 2023-11-06 20:16:34 +01:00
Zbigniew Jędrzejewski-Szmek
f04aac3d5a docs: fix title levels, remove unneded words
The title applies to the whole page, not just the first section.
And there should be just one title ('# foo') in a given document.
2023-11-06 20:16:34 +01:00
Zbigniew Jędrzejewski-Szmek
c8cd6d7bab man: use meaningful titles for <ulink>s
As pointed out in https://github.com/systemd/systemd/issues/29814, we need to
use phrases are are meaningful on their own, because the man page formatter
creates a list at the bottom. With <ulink>see docs</ulink>, we end up with:
  NOTES:
    1. see docs
       https://some.url/page
    2. see docs
       https://some.url/page2
which is not very useful :(

Also, the text inside the tag should not include punctuation.

Python helper:
  from xml_helper import xml_parse
  for p in glob.glob('../man/*.xml'):
       t = xml_parse(p)
       ulinks = t.iterfind('.//ulink')
       for ulink in ulinks:
           if ulink.text is None: continue
           text = ' '.join(ulink.text.split())
           print(f'{p}: {text}')
2023-11-06 20:16:34 +01:00
Daan De Meyer
e94f0af168 Revert "mkosi: Use cache and build subdirectories"
We're not going ahead with the corresponding change in mkosi
after all so revert the preparatory change in systemd as well.

This reverts commit f756bcdf17.
2023-11-06 20:10:34 +01:00
Luca Boccassi
93c2d8d5c4 test: fix build without SBAT_DISTRO
Follow-up for c9bebec872
2023-11-06 19:05:47 +00:00
Luca Boccassi
dfb4a66fd0 man: fix typo
allows to -> allows one to
2023-11-06 18:50:30 +00:00
Luca Boccassi
a6b8ecf304 udev: ressize -> result_size
Lintian flags it as a typo of 'resize', so rename it and make it clearer too
2023-11-06 18:48:25 +00:00
Florian Schmaus
324ec6b5d2 run: include peak memory in output
Fixes #28542.

Signed-off-by: Florian Schmaus <flo@geekplace.eu>
2023-11-06 18:10:06 +01:00
Florian Schmaus
0531bded79 core: include peak memory in unit_log_resources()
Signed-off-by: Florian Schmaus <flo@geekplace.eu>
2023-11-06 18:08:33 +01:00
Florian Schmaus
6c71db763c cgroup: add support for memory.peak
Linux's Control Group v2 interfaces exposes memory.peak, which contains the
"max memory usage recorded for the cgroup and its descendants since the
creation of the cgroup."

This commit adds a new property "MemoryPeak" for units and makes "systemctl
show" display this value if it is available.

Fixes #29878.

Signed-off-by: Florian Schmaus <flo@geekplace.eu>
2023-11-06 18:08:33 +01:00
Frantisek Sumsal
cc5244716b network-generator: allow specifying MAC address without MTU
Also, don't panic when both optional arguments are empty. This should
make the syntax compatible-ish with the dracut one from dracut.cmdline(7).

Resolves: #29855
2023-11-06 17:46:59 +01:00
Frantisek Sumsal
923599523c network-generator: correctly handle IPv6 DNS servers in ip=
IPv6 addresses in the ip= assignment need to be enclosed in [], which
was handled for all IP-related fields except for the two optional DNS
fields.
2023-11-06 17:45:57 +01:00
Peter Hutterer
351072ed71 login: switch an if condition to a switch statement
No functional changes but makes the code more readable once we expand
the list of device types.
2023-11-06 17:42:28 +01:00
Lennart Poettering
4685947138 update TODO 2023-11-06 17:42:28 +01:00
jjimbo137
b55ca26f5b
tcrypt: try all entered passphrases instead of just the first one (#29837)
Previously only the first entered passphrase would be used.  Add the ability to check all the passwords entered by the user.  The total number of passwords entered is still limited by passphrase entry limit.
2023-11-06 16:39:01 +00:00
Antonio Alvarez Feijoo
4697ee9f43 bootctl: fix -q option
Follow up to 14e6e444dd
2023-11-06 16:36:38 +00:00
Antonio Alvarez Feijoo
1bc116a14a man/bootctl: fix --dry-run entry
Fixes 8702496bfb
2023-11-06 16:35:31 +00:00
Antonio Alvarez Feijoo
4e72e15647 man/measure: document --uname
Follow up to b6f2e68602
2023-11-06 16:35:18 +00:00
Yu Watanabe
3296b13b26
Merge pull request #29675 from DaanDeMeyer/kernel-install-json
kernel-install: Add --json option for inspect verb
2023-11-07 01:07:03 +09:00