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

64861 Commits

Author SHA1 Message Date
Yu Watanabe
70b53893f1 cryptenroll: update log messages 2023-05-20 14:21:10 +09:00
Yu Watanabe
cefa4a02ab cryptenroll: drop unmet condition 2023-05-20 14:21:10 +09:00
Yu Watanabe
b3bd6ccd1e
Merge pull request #27707 from mrc0mmand/tests
test: provide coverage for a couple of recent-ish issues
2023-05-20 08:40:01 +09:00
Yu Watanabe
294c20198b test: replace Makefile for several tests with symlink to the one for TEST-01-BASIC 2023-05-20 05:42:24 +09:00
Yu Watanabe
396f6900ae
Merge pull request #27676 from ldv-alt/udevadm-verify
udevadm-verify: add support for directory arguments
2023-05-20 05:41:05 +09:00
Yu Watanabe
24d724087f
Merge pull request #27701 from poettering/switch-root-same-file
switch-root: use same_files() logic when checking whether new and old root dir are actually the same
2023-05-20 05:39:28 +09:00
Luca Boccassi
382e18fd95
Merge pull request #27438 from bluca/dump_ratelimit
manager: restrict Dump*() to privileged callers or ratelimit
2023-05-19 21:29:58 +01:00
Frantisek Sumsal
a9ec30ab7e test: check if we correctly handle locales with leading spaces
Provides coverage for #27179.
2023-05-19 21:35:47 +02:00
Frantisek Sumsal
305aa43815 tests: run all functions with testcase_ prefix automagically 2023-05-19 20:03:34 +02:00
Frantisek Sumsal
b74df879fc test: check if we correctly handle invalid UTF-8 in mount stuff
Provides coverage for #27611.
2023-05-19 20:03:34 +02:00
Frantisek Sumsal
928733cd86 test: assorted TEST-13-NSPAWN tweaks 2023-05-19 20:03:34 +02:00
Frantisek Sumsal
c11c50a53f test: check if we can use --merge with --follow
Provides coverage for #24565.
2023-05-19 20:03:34 +02:00
Zbigniew Jędrzejewski-Szmek
a6f3a7eb8a units: order sysinit.target, debug-shell.service after systemd-vconsole-setup
Previous patch to add an implicit dependency effectively orders various getty
services after systemd-vconsole-setup.service. But I think it's cleaner to also
order the service before sysinit.target, like it was before
8125e8d38e3aa099c7dce8b0161997b8842aebdc. There might be units which don't do
use TTYVHangup= but would like to have the console fully initialized.

Also, add a manual ordering to debug-shell.service, because it has
ImplicitDependencies=no. This might delay debug-shell.service a bit, but
systemd-vconsole-setup.service has no dependencies and should be very quick, so
this should not be noticable in practice. Without the ordering, the terminal
might not have a key map loaded, making debug-shell.service hard to use.
2023-05-19 17:47:14 +02:00
Zbigniew Jędrzejewski-Szmek
f78d6ff2ab rules: start systemd-vconsole-setup via unit
We started systemd-vconsole-setup in two ways: via a dbus call from localed to
do systemd-vconsole-setup.service/restart, and from udev, calling the binary
directly. This patch makes udev call
  systemctl restart systemd-vconsole-setup.service
effectively implementing the same method as localed.

Ordering is implemented at the unit level, so we can use --no-block to not
block here.
2023-05-19 17:46:47 +02:00
Zbigniew Jędrzejewski-Szmek
e019ea738d pid1: order units using TTYVHangup= after vconsole setup
The goal of this change is to delay getty services until after
systemd-vconsole-setup has finished. systemd-vconsole-setup starts loadkeys,
and it seems that when loadkeys is interrupted by the TTY hangup call we do
when starting tty services [1], so that loadkeys starts getting EIO from the
ioctl("/dev/tty1", KDSKBENT) syscall it does.

Fixes #26908.

[1] https://github.com/legionus/kbd/issues/92#issuecomment-1554451788

Initially I wanted to add ordering dependencies to individual units, but
TTYVHangup= can be added to other various external units too. The solution with
an implicit dependency should cover those cases too.
2023-05-19 17:46:30 +02:00
Lennart Poettering
3530fd8913 namespace-util: use inode_same_at() instead of FORMAT_PROC_FD_PATH()
Doesn't matter much, but this makes it leas magic and independent of
/proc/ mounts. (Well, it actually doesn't, since the right-hand path is
also in /proc/, but still...
2023-05-19 17:42:41 +02:00
Lennart Poettering
563e684689 stat-util: rename files_same() → inode_same()
Let's be more accurate about what this function does: it checks whether
the underlying reported inode is the same. Internally, this already uses
a better named stat_inode_same() call, hence let's similarly name the
wrapping function following the same logic.

Similar for files_same_at() and path_equal_or_same_files().

No code changes, just some renaming.
2023-05-19 17:42:41 +02:00
Lennart Poettering
5268188de1 switch-root: check if old and new root fs is same via files_same_at() 2023-05-19 17:42:31 +02:00
Lennart Poettering
676ade310a stat-util: add _at() variant for files_same() 2023-05-19 17:41:08 +02:00
Frantisek Sumsal
e47622a61c journalctl: make --follow work with --merge again
Set --boot with --follow only if it's not already set and if --merge is
not used, since it's not compatible with --boot.

Follow-up to 2dd9285bac.
Resolves: #24565
2023-05-19 23:48:13 +09:00
Lennart Poettering
75edb7ca96
Merge pull request #27700 from poettering/switch-root-sync
switch-root: add sync() before getting rid of auxiliary mounts of old root
2023-05-19 07:27:23 -07:00
Luca Boccassi
d936595672 manager: restrict Dump*() to privileged callers or ratelimit
Dump*() methods can take quite some time due to the amount of data to
serialize, so they can potentially stall the manager. Make them
privileged, as they are debugging tools anyway. Use a new 'dump'
capability for polkit, and the 'reload' capability for SELinux, as
that's also non-destructive but slow.

If the caller is not privileged, allow it but rate limited to 10 calls
every 10 minutes.
2023-05-19 15:18:23 +01:00
Luca Boccassi
53d6987f9e ratelimit: add ratelimit_left helper 2023-05-19 15:17:35 +01:00
Frantisek Sumsal
2808a9fc36
Merge pull request #27698 from mrc0mmand/test-tweaks
test: a couple of performance-related tweaks
2023-05-19 15:29:35 +02:00
Zbigniew Jędrzejewski-Szmek
ce0fe01f22 units: order getty units after getty-pre.target unconditionally
Those two units had this ordering conditionalized on HAVE_SYSV_COMPAT. This
seems strange. 45e27532971ac84e835a2879df510a581f933fcd added the ordering
differently for those two files without any comment, and I think it was just
pasted or scripted erroneously.
2023-05-19 15:22:45 +02:00
Zbigniew Jędrzejewski-Szmek
64fe2aeaf7 vconsole-setup: reduce variable scope, shorten things 2023-05-19 15:21:52 +02:00
Lennart Poettering
5221b55bb3 switch-root: sync() before MNT_DETACH unmounting all old mounts
As discussed here:

https://github.com/systemd/systemd/pull/27670#discussion_r1196716794
2023-05-19 14:31:11 +02:00
Lennart Poettering
b7106af465 tree-wide: remove (void) cast around sync()
The call is void anyway, it doesn't return an failure indication. Hence,
no need to cast void to (void)...

(We got this right in most cases, but forgot some)
2023-05-19 14:21:21 +02:00
Lennart Poettering
9287925a0d update TODO 2023-05-19 14:04:07 +02:00
Lennart Poettering
2191bcbbd6
Merge pull request #27670 from poettering/switch-root-umount-all
umount all mounts during MS_MOVE switch root
2023-05-19 05:03:23 -07:00
Frantisek Sumsal
038efe6df1 test: build the SELinux test module on the host
Let's save some time and build the SELinux test module on the host
instead of a possibly unaccelerated VM. This brings the runtime of
TEST-06-SELINUX from ~12 minutes down to a ~1 minute.
2023-05-19 11:45:11 +02:00
Frantisek Sumsal
daeb95a1d8 test: drop generated stuff from the final coverage report
Let's drop stuff from the current $BUILD_DIR from the final coverage
report, as it's all generated files (mostly gperf) which we don't
really care about and it makes the Coveralls report confusing, since it
reports "source not available" for all such files.
2023-05-19 11:07:07 +02:00
Frantisek Sumsal
ff40235b9b test: make the stress test slightly less stressful on slower machines
Without acceleration this part of the test takes over 10 minutes (!),
which feels quite unnecessary. Let's cut down the number of stuff we
dump to the journal in such case, but keep the original value if we run
with acceleration (since in that case it takes less than 10 seconds).
2023-05-19 10:48:15 +02:00
Yu Watanabe
b4e2fcb6bb core/device: downgrade error when units specified in SYSTEMD_WANTS= not found
Closes #27693.
2023-05-19 15:25:28 +08:00
Yu Watanabe
d0e3ae838f unit: add conditions and deps to make oomd.socket and .service consistent
Fixes #27690.
2023-05-19 08:58:56 +02:00
Yu Watanabe
47f4ddaf28
Merge pull request #27686 from keszybz/make-boot-output-nicer
Make boot output nicer
2023-05-19 03:50:45 +09:00
Edson Juliano Drosdeck
60ca859bf0
hwdb: fix Positivo CG15D key toggle touchpad and programmable keys (#27689) 2023-05-19 03:06:42 +09:00
Yu Watanabe
65f2ff7998
Merge pull request #27685 from keszybz/the-semiannual-excercise-in-output-narrowing
The semiannual excercise in output narrowing
2023-05-19 03:04:47 +09:00
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