1
0
mirror of https://github.com/systemd/systemd synced 2024-07-08 20:15:55 +00:00
Commit Graph

73544 Commits

Author SHA1 Message Date
Daan De Meyer
ff45d26de0 mkosi: Make sure the kernel fails loudly on oops/panic/softlockup
Helps with noticing kernel related failures.
2024-05-09 09:57:40 +02:00
Daan De Meyer
f1d2dc187f mkosi: Add raid=noautodetect to kernel command line
Should speed up boot times a little.
2024-05-09 09:57:04 +02:00
Mike Yuan
8f9acf8e10 systemctl-show: make show_memory_available cover memory_available itself
Follow-up for f380473edf

This cleans up the code a bit. Also, before this commit,
if MemoryAvailable is set but show_memory_available
is false, and we have nothing else to output, empty
parenthesis is shown. This can be easily reproduced
on -.slice:

> systemctl status -- -.slice
> ...
> Memory: 1.8G ()
> ...
2024-05-08 21:20:05 +02:00
Luca Boccassi
d2fa7f1310
Merge pull request #32717 from keszybz/very-important-fixes
Whitespace adjustments and comments
2024-05-08 17:21:27 +02:00
Colin Watson
566491c971 docs,man: Avoid some ambiguous uses of "may not"
Like much English text, the systemd documentation uses "may not" in the
sense of both "will possibly not" and "is forbidden to".  In many cases
this is OK because the context makes it clear, but in others I felt it
was possible to read the "is forbidden to" sense by mistake: in
particular, I tripped over "the target file may not exist" in
systemd.unit(5) before realizing the correct interpretation.

Use "might not" or "may choose not to" in these cases to make it clear
which sense we mean.
2024-05-08 17:14:32 +02:00
Lennart Poettering
d6bfc3d889 pidfd: properly detect if libc offers pidfd syscalls and make use of them then
We never updated the meson checks when glibc finally learned about these
syscalls, address that.
2024-05-08 15:36:40 +02:00
Zbigniew Jędrzejewski-Szmek
620682e675 nspawn: whitespace 2024-05-08 15:13:14 +02:00
Zbigniew Jędrzejewski-Szmek
4955d2e367 repart,measure: reword help descriptions
This is a follow-up/extension for ec361ea9ce.
2024-05-08 15:13:14 +02:00
Zbigniew Jędrzejewski-Szmek
0ca9c2c9b8 shared: fix comment
Follow-up for 90db1582a9.
2024-05-08 15:13:14 +02:00
Zbigniew Jędrzejewski-Szmek
3ea527d33c vmspawn: indentation 2024-05-08 15:13:14 +02:00
Mike Yuan
6724a0f0a3 firewall-util-iptables: update ELF note to mention "iptables"
Follow-up for cd7c207795
2024-05-08 15:00:39 +02:00
Luca Boccassi
867e2987a2
Merge pull request #32709 from bluca/machined_ssh
machined: add GetMachineSSHInfo method and varlink interface to register machines
2024-05-08 14:37:55 +02:00
Luca Boccassi
0a9ce6251d
Merge pull request #32708 from DaanDeMeyer/fix-race
Fix race conditions in tests
2024-05-08 14:21:37 +02:00
Maciej S. Szmigiero
7b1768f0a0 hwdb: Add a Logitech MX Master 3S (connected via Bolt Receiver)
The mouse technically has settable DPI between 200 and 8000, with a step of
50, but 1000 DPI is the default setting.
And if someone customizes the mouse DPI setting they can make a custom hwdb
rule too.
2024-05-08 14:20:44 +02:00
Luca Boccassi
667fe27e5d
Merge pull request #32705 from YHNdnzj/hibernate-error
hibernate-util: differentiate some errors from the generic ENOSPC; systemctl: adjust the fallback behavior for sleep operations
2024-05-08 14:19:07 +02:00
Daan De Meyer
1b35ea0cdf
Merge pull request #32710 from YHNdnzj/debug-generator-cleanup
debug-generator: several cleanups
2024-05-08 14:09:56 +02:00
Luca Boccassi
344ededcea
Merge pull request #32234 from poettering/dlopen-name-elf-note
Expose dlopen() dependencies in an ELF section, and add spec for it
2024-05-08 13:56:34 +02:00
MaxHearnden
bd96d63787 Use the correct name of CEL
It's Canonical Event Format, not Common
2024-05-08 13:34:07 +02:00
Sam Leonard
5b44c81ff8 machined: add varlink interface for registering machines
This commit adds the new varlink interface io.systemd.Machine at
/run/systemd/machine/io.systemd.Machine with a single method Register

It supports all combinations of RegisterMachine[WithSSH,WithNetwork] all
under the same method.
2024-05-08 11:54:31 +01:00
Mike Yuan
f9e2b42b16
debug-generator: clean up logging and such for units passed from creds 2024-05-08 18:43:50 +08:00
Mike Yuan
a3816ea427
debug-generator: don't eat up error if we can't write drop-in
While at it, prepend the drop-in text with
our usual "Automatically generated by ...".
2024-05-08 18:43:50 +08:00
Mike Yuan
2997df9777
debug-generator: drop unneeded empty_to_root 2024-05-08 18:43:49 +08:00
Mike Yuan
221bad6007
debug-generator: use RET_GATHER where appropriate 2024-05-08 18:43:49 +08:00
Mike Yuan
b5636a8f83
debug-generator: enclose function call in if statement when retval
is not used
2024-05-08 18:43:49 +08:00
Daan De Meyer
904b8ae47a TEST-04-JOURNAL: Sleep more in delegated cgroup filtering script
We already changed logs-filtering.service to sleep 2 seconds before
exiting to combat flakyness, let's do the same for the delegated
cgroup filtering payload.

Fixes #32696 (hopefully)
2024-05-08 12:27:35 +02:00
Daan De Meyer
65690de6f9 TEST-81-GENERATORS: Do a lazy unmounts
Otherwise we might fail if PID 1 is currently accessing these files.

Fixes #32692 (hopefully)
2024-05-08 12:27:24 +02:00
Mike Yuan
a688e5fefd
ssh-generator: fix pointer cast type 2024-05-08 18:20:59 +08:00
Lennart Poettering
cd7c207795 tree-wide: add dlopen ELF notes to all dlopen() deps of ours
Use 'recommended' priority for the default compression library, to
indicate that it should be prioritized over the other ones, as it
will be used to compress journals/core files.
Also use 'recommended' for kmod, as systems will likely fail to boot
if it's missing from the initrd.
Use 'suggested' for everything else.

There is one dlopen'ed TPM library that has the name generated
at runtime (depending on the driver), so that cannot be added, as it
needs to be known at build time.
Also when we support multiple ABI versions list them all, as for the
same reason we cannot know which one will be used at build time.

$ dlopen-notes.py build/libsystemd.so.0.39.0 build/src/shared/libsystemd-shared-256.so
libarchive.so.13 suggested
libbpf.so.0 suggested
libbpf.so.1 suggested
libcryptsetup.so.12 suggested
libdw.so.1 suggested
libelf.so.1 suggested
libfido2.so.1 suggested
libgcrypt.so.20 suggested
libidn2.so.0 suggested
libip4tc.so.2 suggested
libkmod.so.2 recommended
liblz4.so.1 suggested
liblzma.so.5 suggested
libp11-kit.so.0 suggested
libpcre2-8.so.0 suggested
libpwquality.so.1 suggested
libqrencode.so.3 suggested
libqrencode.so.4 suggested
libtss2-esys.so.0 suggested
libtss2-mu.so.0 suggested
libtss2-rc.so.0 suggested
libzstd.so.1 recommended

Co-authored-by: Luca Boccassi <bluca@debian.org>
2024-05-08 11:07:36 +01:00
Lennart Poettering
2f6bd11c1a dlfcn: add macro for exporting dlopen() module names in ELF sections
This allows code to declare "weak" dlopen() style deps via an ELF
section following the just added specification.

The idea is that any user of dlopen() will place ELF_NOTE_DLOPEN(…)
somewhere close which will synthesize the note.

Tools such as rpm/dpkg package builders as well as initrd generators
(such as dracut) can then automatically pick up these weak deps of
suggested dependencies for their purposes.

Co-authored-by: Luca Boccassi <bluca@debian.org>
2024-05-08 11:07:36 +01:00
Luca Boccassi
cb7e3126b9 docs: add specification for ELF dlopen metadata
Tool to parse it and to use it for Debian packaging available at
https://github.com/systemd/package-notes

Add 3 levels of priority like Debian does, but using terminology
from RPM as it seems more apt.
We will very likely never use 'required', as we use this functionality
for optional features, but it is worth having it in the spec nonetheless
as we want it to be generalized.
2024-05-08 11:07:36 +01:00
Daan De Meyer
677430b3c7 tmpfiles: Don't fail if file does not exist in item_do()
If the file was removed by some other program, we should just go
to the next one without failing. item_do() is only used for recursive
globs instead of fixed paths so skipping on missing files makes sense
(unlike if the path was fixed where we should probably fail).

Fixes #32691 (hopefully)
2024-05-08 12:01:37 +02:00
Daan De Meyer
a35edc9ad4 TEST-74-AUX-UTILS: Make more robust
Let's run mkfs on the file we create instead of the loop device and
let's use udevadm wait --settle to wait for udev to settle before
doing anything with the loop device

Fixes #32680 (hopefully)
2024-05-08 11:35:15 +02:00
Sam Leonard
1f815bf164 machined: add GetMachineSSHInfo method
Also adds three properties:
- VsockCid: the VSOCK CID of the VM
- SshAddress: the address of the VM in a format SSH can connect to
- SshPrivateKeyPath: the path to the SSH private key to use to connect
  to the VM.

GetMachineSSHInfo is essentially a convenience method to query both the
SshAddress and SshPrivateKeyPath properties at once.
2024-05-08 09:56:42 +01:00
Sam Leonard
885317f1ab machined: split manager linking out of machine_new into machine_link 2024-05-08 09:52:15 +01:00
Sam Leonard
71a15f37af machined: expose machine_freep in machine.h 2024-05-08 09:52:15 +01:00
Sam Leonard
8fcf504b8c shared/json: add json_dispatch_absolute_path 2024-05-08 09:52:15 +01:00
Daan De Meyer
b438ebd7bc TEST-07-PID1: Fix race in aux-scope subtest
Currently test-aux-scope.service can get killed by the test before
it's had a chance to setup its signal handler. Make it Type=notify
to fix the race.

Fixes #32670 (hopefully)
2024-05-08 10:20:20 +02:00
Mike Yuan
18303adcd3 man/run0: remove the --user example for --machine=
run0's --user= option is different from other tools,
and the whole point of run0 is to connect to the system
manager. So the example is spurious.
2024-05-08 10:08:53 +02:00
Zbigniew Jędrzejewski-Szmek
a4f0e0da35 preset-all: continue on errors, report more errors
Firstly, if we encounter an error when iterating over the directory, gather
the error but continue. This is unlikely to happen, but if it happens, then
it doesn't seem very useful to break the preset processing at a random
point. If we can't process a unit — too bad, but since we already might
have processed some units earlier, we might as well try to process the
remaining ones.

Secondly, add missing error codes for units that are in a bad state to the
exclusion list. Those, we report them in the changes list, but consider the
whole operation a success. (-ETXTBSY and -ENOLINK were missing.)

Thirdly, add a message generator for -ENOLINK.

Fixes https://github.com/systemd/systemd/issues/21224.
2024-05-08 08:18:55 +02:00
Mike Yuan
4f344de792
systemctl: do not fall back to StartUnit automatically for sleep operations
In the majority of cases, this is caused by
sleep_supported() returning error. Hence it's
very likely that it would fail again, so
the fallback is not really useful. Instead,
honor the --force option for these verbs.
2024-05-08 13:45:49 +08:00
Mike Yuan
3fce141c1b
hibernate-util,logind: also differentiate the case of misconfigured resume 2024-05-08 12:55:25 +08:00
Mike Yuan
40eb83a8fe
hibernate-util,logind: emit a clear error if the specified resume dev is missing
Currently, SLEEP_NOT_ENOUGH_SWAP_SPACE (ENOSPC) is returned
on all sorts of error conditions. But one important case
that's worth differentiating from that is when the resume device
is manually specified yet missing.

Closes #32644
2024-05-08 12:54:13 +08:00
Luca Boccassi
3473c842fa
Merge pull request #32684 from YHNdnzj/pr-followups
Follow-ups for recently merged PRs
2024-05-07 21:05:04 +02:00
Daan De Meyer
4c4b7ee5db
Merge pull request #32681 from DaanDeMeyer/skipped-no-journal
test: Don't keep journals for skipped tests
2024-05-07 20:49:49 +02:00
Daan De Meyer
0d13ca5544 test: Mark TEST-21-DFUZZER as slow and skip it by default
The test is not really useful without sanitizers, so let's mark it
as slow and not run it by default in CI.
2024-05-07 19:06:42 +02:00
Daan De Meyer
f1f87f3b2e test: Add infra to mark integration tests as slow
Some integration tests take much more time than others, let's add
a test param that can be used to configure this and integrate it
with the slow-tests meson option.
2024-05-07 19:06:42 +02:00
Daan De Meyer
a77f65d0c9 ci: Print a helpful link to download and view a failed test's journal 2024-05-07 19:06:39 +02:00
Mike Yuan
8aed85875d
repart: correct timespec_store usage too 2024-05-08 00:19:38 +08:00
Mike Yuan
158681f0f9
basic/mkdir: use timespec_store instead of _nsec for mkdir_p_root_full
Follow-up for 34c3d57474

O_RDONLY is dropped when O_DIRECTORY is specified, since
it's unnecessary and even arguably confusing here, as
the dir is modified.
2024-05-08 00:18:27 +08:00
Mike Yuan
026335e9aa
core/service: use switch for service_enter_start
Plus, add an assertion to ensure we're actually
using the start timestamp for the correct pid.
2024-05-08 00:17:54 +08:00