1
0
mirror of https://github.com/systemd/systemd.git synced 2025-03-09 12:58:26 +03:00

64773 Commits

Author SHA1 Message Date
Yu Watanabe
ec0bd9611a
Merge pull request #27684 from mrc0mmand/more-nspawn-tests
test: further extend systemd-nspawn coverage
2023-05-19 03:00:54 +09:00
Dmitry V. Levin
a9802abaee udevadm-verify: add support for directory arguments
When an argument specified to udevadm verify is a directory,
verify all *.rules files in that directory.

Suggested-by: Zbigniew Jędrzejewski-Szmek <zbyszek@in.waw.pl>
2023-05-18 17:00:00 +00:00
Dmitry V. Levin
f366434090 udev-rules: avoid issuing redundant diagnostics in verify mode
When udevadm verify is given an argument that doesn't point to an
existing file, there used to be two diagnostics messages, the first one
at a warning level, and the second one at an error level:

$ build/udevadm verify /no/such/directory
Failed to open /no/such/directory, ignoring: No such file or directory
Failed to parse rules file /no/such/directory: No such file or directory

Fix this by issuing just the error message.
2023-05-18 17:00:00 +00:00
Luca Boccassi
8fb26ccd36 integration test: pass 'noresume' to qemu
When running on Debian/Ubuntu, I get a minute delay or so on every boot
because the local initramfs tries to resume from hibernation. This is
not really useful here, so always skip it
2023-05-18 16:45:55 +01:00
Dmitry V. Levin
75390455cb testsuite-17.11.sh: fix assert_1()
Fix assert_1() to exit with an error status in case of a failed assertion.
2023-05-18 15:45:55 +00:00
Frantisek Sumsal
2de77dbfc7 test: wrap setfacl when running with ASan 2023-05-18 17:30:36 +02:00
Zbigniew Jędrzejewski-Szmek
d0cf9a9562 oomd: shorten message
We can make the message shorter and more direct without changing
the meaning.
2023-05-18 17:20:15 +02:00
Zbigniew Jędrzejewski-Szmek
ed7a6f51ea sd-bus,sd-event: allow querying of description even after fork
This in unnecessarilly unpleasant: the code might report about a bus
connection, e.g. in an error message or assert. Let's let it query
the name of the object.

This partially reverts f4b2933ee7890e5d414ab266d8586f19027a2bd9.
2023-05-18 17:20:15 +02:00
Zbigniew Jędrzejewski-Szmek
aa77ed55e1 sd-bus: do not assert if bus description is not set
The code has an explicit fallback using runtime_scope_to_string(), which
is also documented in the man page. So -ENXIO should only be returned when
the fallback doesn't work, i.e. bus->runtime_scope == -EINVAL.

Fixup for f4b2933ee7890e5d414ab266d8586f19027a2bd9.

This should fix the following errors during boot:
May 18 16:05:37 fedora systemd-update-utmp[263]: Assertion 'bus->description' failed at src/libsystemd/sd-bus/sd-bus.c:4201, function sd_bus_get_description(). Ignoring.
May 18 16:05:38 fedora systemctl[360]: Assertion 'bus->description' failed at src/libsystemd/sd-bus/sd-bus.c:4201, function sd_bus_get_description(). Ignoring.
May 18 16:05:38 fedora systemctl[363]: Assertion 'bus->description' failed at src/libsystemd/sd-bus/sd-bus.c:4201, function sd_bus_get_description(). Ignoring.
May 18 16:05:38 fedora systemd-update-utmp[372]: Assertion 'bus->description' failed at src/libsystemd/sd-bus/sd-bus.c:4201, function sd_bus_get_description(). Ignoring.
May 18 16:05:38 fedora @ystemctl[387]: Assertion 'bus->description' failed at src/libsystemd/sd-bus/sd-bus.c:4201, function sd_bus_get_description(). Ignoring.
May 18 16:05:40 fedora systemd-update-utmp[477]: Assertion 'bus->description' failed at src/libsystemd/sd-bus/sd-bus.c:4201, function sd_bus_get_description(). Ignoring.
May 18 16:05:41 fedora systemd-homed[509]: Assertion 'bus->description' failed at src/libsystemd/sd-bus/sd-bus.c:4201, function sd_bus_get_description(). Ignoring.
May 18 16:05:41 fedora systemd-logind[510]: Assertion 'bus->description' failed at src/libsystemd/sd-bus/sd-bus.c:4201, function sd_bus_get_description(). Ignoring.
May 18 16:05:41 fedora systemd-update-utmp[529]: Assertion 'bus->description' failed at src/libsystemd/sd-bus/sd-bus.c:4201, function sd_bus_get_description(). Ignoring.
May 18 16:05:42 fedora systemd-user-runtime-dir[531]: Assertion 'bus->description' failed at src/libsystemd/sd-bus/sd-bus.c:4201, function sd_bus_get_description(). Ignoring.
May 18 16:05:42 fedora systemctl[542]: Assertion 'bus->description' failed at src/libsystemd/sd-bus/sd-bus.c:4201, function sd_bus_get_description(). Ignoring.
May 18 16:05:42 fedora systemd-hostnamed[556]: Assertion 'bus->description' failed at src/libsystemd/sd-bus/sd-bus.c:4201, function sd_bus_get_description(). Ignoring.
2023-05-18 17:20:15 +02:00
Zbigniew Jędrzejewski-Szmek
02e0f430a0 meson: rename "dist-check" suite to "dist"
*Now* one of those tests is the longest, let's make them a bit shorter.
2023-05-18 17:18:11 +02:00
Zbigniew Jędrzejewski-Szmek
ec2c6ac051 meson: rename "fuzzers" suite to "fuzz"
Fuzz tests have all the longest names, so by making this name
shorter, we save three columns of screen real estate.
2023-05-18 17:17:13 +02:00
Frantisek Sumsal
0d4519dd84 test: don't mount /sys & /proc if already mounted 2023-05-18 16:50:24 +02:00
Frantisek Sumsal
e85c644ede nspawn: make the error message less confusing
by not printing (null) and dropping the extraneous slash, e.g.:

systemd-nspawn[2049]: Failed to resolve (null)//proc: Permission denied
2023-05-18 16:50:24 +02:00
Frantisek Sumsal
cbd20ab41b test: add a couple of tests for nspawn config files 2023-05-18 16:50:24 +02:00
Frantisek Sumsal
8f4d843afc nspawn: correctly parse a list of interfaces
Interface=/MACVLAN=/IPVLAN= nspawn options take a _list_ of interface
names - this was recently enhanced by 2f091b1b49 to support interface
pairs. Unfortunately, this also introduced a regression where we don't
parse the list as a list, but just as a single value. For example,
having `Interface=sd-shared1 sd-shared2` in an nspawn config file would
throw:

systemd-nspawn[898]: Network interface, interface name not valid: sd-shared1 sd-shared2
systemd-nspawn[898]: /run/systemd/nspawn/testsuite-13.nspawn-settings.1po.nspawn:41: Failed to parse file: Invalid argument

Follow-up to 2f091b1b49.
2023-05-18 16:50:24 +02:00
Frantisek Sumsal
28ed232639 test: create nspawn config files when collecting coverage
Which bind-mounts the $BUILD_DIR into the container. This whole coverage
thing is getting slightly ridiculous.

Follow-up to 3b2823a749, but for non-machinectl containers.
2023-05-18 16:50:24 +02:00
Frantisek Sumsal
d5a6ff8c18 test: cover --bind-user= 2023-05-18 16:50:24 +02:00
Frantisek Sumsal
74696ba5ef test: add a couple of sanity tests for --port= 2023-05-18 16:50:24 +02:00
Frantisek Sumsal
cf260f799f test: drop "check" from test case names 2023-05-18 16:50:24 +02:00
Frantisek Sumsal
f0193b4b63 test: exercise a couple of error paths in nspawn's OCI code as well 2023-05-18 16:50:24 +02:00
Frantisek Sumsal
7244c6db42 nspawn: clean up & unify cleanup handlers
Also, make them follow our naming conventions.
2023-05-18 16:50:24 +02:00
Zbigniew Jędrzejewski-Szmek
e2e736cbbd fuzz: rename long samples
With those long filenames, output doesn't fit on the terminal.
2023-05-18 15:23:27 +02:00
Zbigniew Jędrzejewski-Szmek
fbecfbe224 mkosi: use wildcard to shorten things 2023-05-18 15:23:27 +02:00
Dimitri John Ledkov
4aa37ad301 Revert "resolved: address DVE-2018-0001"
DVE-2018-0001 has been fixed by the vendor, and this workaround is no longer
needed. Removal of this workaround improves performance as queries used to be
retried more than necessory.

This reverts 1ed4e584f3a03f47d2313314b6b5a78c9dc6f135.
This reverts https://github.com/systemd/systemd/pull/18638

Keep .clamp_feature_level_servfail name, as imho it is more descriptive than
just .clamp_feature_level, especially if we ever need to add similar
workarounds as the one we had for DVE-2018-0001.

However note that there is another retry which was added in
8a33aa199dc1cea14494469ac9d7d08dc6721df1 - seems to be working around Stubby
resolver behaviour.

Fixes: #26967
2023-05-18 12:20:12 +01:00
Frantisek Sumsal
797424245e nspawn: use ASSERT_PTR() more 2023-05-18 11:08:56 +02:00
Mateusz Poliwczak
cb4e5d5155 nss-resolve: report EAI_NODATA 2023-05-18 17:57:06 +09:00
Matt Johnston
bf422cf900 busctl: Add space before "tree" paths for copying
This allows a double-click on the path in a terminal to select the
whole path. Otherwise the leading '-' character is also included in
the copied path.

```
New output:
./busctl tree org.freedesktop.network1
`- /org
  `- /org/freedesktop
    |- /org/freedesktop/LogControl1
    `- /org/freedesktop/network1
      |- /org/freedesktop/network1/link
      | |- /org/freedesktop/network1/link/_31
      | |- /org/freedesktop/network1/link/_32
```
2023-05-18 17:55:03 +09:00
Yu Watanabe
837dfea5ed
Merge pull request #27673 from YHNdnzj/restartsteps-transient
core,bus-unit-util: add missing RestartSteps and RestartMaxDelaySec to bus_append_service_property
2023-05-18 17:54:33 +09:00
Yu Watanabe
7aeafa93df README: drop busybox requirement
Follow-up for 5656759d0617594ee8e850a258a21d3e187bf02c.
2023-05-18 10:51:49 +02:00
Yu Watanabe
f0485be000
Merge pull request #27677 from mrc0mmand/test-followups
test: get rid of the busybox stuff
2023-05-18 17:47:02 +09:00
Mike Yuan
2200cf47ce Revert (partially) "man: Clarify when OnFailure= activates after restarts (#7646)"
This reverts part of commit bd2538b50ba283c9ce39142d5d16d90184a55b90,
specifically changes to the description of service state between auto-restarts.

Fixes #27594
2023-05-18 15:10:26 +09:00
Frantisek Sumsal
a6dac790c8 test: explicitly use bash
To avoid unexpected surprised in CIs with different default shell.
2023-05-17 23:22:54 +02:00
Frantisek Sumsal
5656759d06 test: get rid of the busybox stuff
It already required a lot of workarounds, since the busybox utilities
often work differently than their "full" counterparts, and putting
the container together using our "tools" is quite simple anyway.
2023-05-17 23:22:54 +02:00
Mike Yuan
a559ea1535
bus-unit-util: add missing RestartSteps and RestartMaxDelaySec to bus_append_service_property
Follow-up for be1adc27fc61ba723bd0392199f7b82ef9f1c970
2023-05-18 00:23:49 +08:00
Mike Yuan
e9f17fa8dd
core: rename RestartSecMax to RestartMaxDelaySec 2023-05-18 00:23:49 +08:00
Frantisek Sumsal
c01f0184b9 test: mangle the machine ID only for the QEMU test part
systemd-nspawn doesn't like invalid machine IDs and refuses to boot with one:

TEST-74-AUX-UTILS RUN: Tests for auxiliary utilities
...
Spawning container TEST-74-AUX-UTILS--3 on /var/tmp/systemd-test-TEST-74-AUX-UTILS_3/root.
Press Ctrl-] three times within 1s to kill container.
Failed to read machine ID from container image: Structure needs cleaning
E: nspawn failed with exit code 1

Follow-up to b4d42a82eb.
2023-05-17 15:10:22 +01:00
Zbigniew Jędrzejewski-Szmek
ffcdd3194d
Merge pull request #27669 from keszybz/man-fixes-254
Some simple man page fixes to reduce the list of issues tagged for v254
2023-05-17 14:12:33 +02:00
Zbigniew Jędrzejewski-Szmek
a190e0c301
Merge pull request #27671 from keszybz/manpage-fixes-254-2
man: fixes for assorted issues reported by the manpage-l10n project
2023-05-17 14:12:08 +02:00
Zbigniew Jędrzejewski-Szmek
8fb350049b man: fixes for assorted issues reported by the manpage-l10n project
Fixes #26761.
2023-05-17 12:25:01 +02:00
Zbigniew Jędrzejewski-Szmek
f90360eb74 man/tmpfiles: fix off-by-one in example
Reported and diagnosed by gitterman. Fixes #26617.
2023-05-17 11:18:37 +02:00
Zbigniew Jędrzejewski-Szmek
2f76f1cfae man: explain allowed values for /sys/power/{disk,state}
Also fix the grammar: "neither" can only be used with two values, and
here we have an inderminate number >= 1.

Fixes #26460.
2023-05-17 11:18:26 +02:00
Zbigniew Jędrzejewski-Szmek
42eccfec6e man: say that ProtectClock= also affects reads
Fixes #26413: the docs said that the filter prevents writes, but it just a
filter at the system call level, and some of those calls are used for writing
and reading. This is confusing esp. when a higher level library call like
ntp_gettime() is denied.

I don't think it's realistic that we'll make the filter smarter in the near
future, so let's change the docs to describe the implementation.

Also, split out the advice part into a separate paragraph.
2023-05-17 11:17:39 +02:00
Lennart Poettering
268d1244e8 switch-root: when switching root via MS_MOVE unmount all remaining mounts first
Let's try to unmount anything left, since if we don't they will remain
as "shadow" mounts, hidden underneath our new root.

This is only necessary when we transition into a new root via MS_MOVE.
If we do so via pivot_root() this is not necessary as the kernel will
get rid of the mounts anyway for us.
2023-05-17 10:30:47 +02:00
Lennart Poettering
4e9ef660e6 test: add test for umount_recursive() 2023-05-17 10:29:53 +02:00
Lennart Poettering
ef742415e6 mount-util: make "prefix" parameter optional for umount_recursive()
When switching root via MS_MOVE there's no need to filter the mount
table by prefix
2023-05-17 10:29:05 +02:00
Lennart Poettering
84bcb394c8 mount-util: extend umount_recursive() to optionally take list of dirs to exclude from the unmounting 2023-05-17 10:28:09 +02:00
Lennart Poettering
890c14e343 mount-util: keep fd to /proc/self/mountinfo continously open in umount_recursive()
That way, if we end up unmounting /proc/ in our loop we can still
operate correctly, since we don't have to go through /proc/ again to
open the mount table again.
2023-05-17 10:26:51 +02:00
Yu Watanabe
89572df859
Merge pull request #27664 from mrc0mmand/test-merge
test: let's merge more tests together
2023-05-17 09:53:58 +09:00
Frantisek Sumsal
7c6fa5bf16 test: move runas() to the shared utility library 2023-05-16 23:07:45 +02:00
Frantisek Sumsal
e71bac7222 test: make shellcheck happy again
No functional changes.
2023-05-16 23:07:45 +02:00