1
1
mirror of https://github.com/systemd/systemd-stable.git synced 2025-01-06 13:17:44 +03:00
Commit Graph

53953 Commits

Author SHA1 Message Date
Yu Watanabe
5b47f35d0e test-network: reconfigure interface instead of restarting networkd 2021-10-26 08:20:29 +09:00
Yu Watanabe
b4564f4e8f network: delay dropping addresses or so on reloading .network files
When a .network file is updated but its change is not so big, it is not
necessary to first drop all configs and then reassign later again.
This slightly optimize such situation. First foreignize all configs, and
then drop later when it is not requested by the updated .network file.
2021-10-26 08:20:22 +09:00
Lennart Poettering
1845ba368e homework: replace homegrown "dir-is-empty" check with dir_is_empty_at() 2021-10-26 08:13:15 +09:00
Yu Watanabe
b1ccd7d737
Merge pull request #21097 from poettering/dir-is-empty-fix
dir_is_empty_at() tweaks
2021-10-26 08:12:50 +09:00
Yu Watanabe
8a088877ab test: enable debug logging of systemd-udevd
Otherwise, it is hard to debug when the test fails.
2021-10-26 08:12:10 +09:00
Yu Watanabe
0f96a82311 network: dhcp6pd: do not assign downstream prefix when RADV is requested but not configured yet 2021-10-26 08:11:44 +09:00
Yu Watanabe
928112a487 network: ndisc: fix behavior when DHCPv6Client=always
The man page says that when 'always' is set, the DHCPv6 client always
starts in managed mode, and that means we need to ignore the RA flags.
2021-10-26 08:11:19 +09:00
Yu Watanabe
e817f5b0f9
Merge pull request #21119 from yuwata/network-dhcp6-pd-cleanups
network: dhcp6pd: several cleanups
2021-10-26 08:10:56 +09:00
Yu Watanabe
a84171ce6f libsystemd-network: do not warn when log_dhcp_client() or friends with NULL 2021-10-26 08:09:40 +09:00
Luca Boccassi
2f13844e73 docs/COREDUMP_PACKAGE_METADATA: add architecture field 2021-10-25 23:09:43 +01:00
Lennart Poettering
0dbce03c37 tree-wide: explicitly unpoison getdents64() memory
Apparently memory sanitizer doesn't grok getdents64() properly. Let's
address that by explicitly marken memory initialized by getdents64() as
unpoisoned.
2021-10-25 21:51:37 +02:00
Lennart Poettering
bfc569b060 test: add test for dir_is_empty_at() 2021-10-25 21:51:37 +02:00
Lennart Poettering
d96f21eec2 stat-util: make sure dir_is_empty_at() does something useful in all cases 2021-10-25 21:51:37 +02:00
Lennart Poettering
a068aceafb stat-util: optimize dir_is_empty_at() a bit, by using getdents64()
That way we have a single syscall only for it, instead of the multiple
readdir() and friends do. And we can operate entirely on the stack, no
malloc() implicit.
2021-10-25 21:51:37 +02:00
Lennart Poettering
a4e70ef7ba dirent-util: add FOREACH macro for iterating through getdents64() buffers
We already have a similar loop twice, let's make it easier to read via
an iteration macro.

(The new macro is a bit more careful even, as it verifies the full
dirent fits into the remaining buffer when returning it)
2021-10-25 21:51:37 +02:00
Lennart Poettering
ca664db258 dirent-util: move getdents64() related definitions to common header
We want to reuse getdents64() wherever necessary, let's hence move
definitions useful for that into public code.
2021-10-25 21:50:20 +02:00
Lennart Poettering
b9d0652263 stat-util: specify O_DIRECTORY when reopening dir in dir_is_empty_at()
That way we can fail earlier if the specified fd is not actually a
directory.

(Also, it's not exactly according to standards to open things without
either O_RDONLY/O_RDWR...)
2021-10-25 21:39:05 +02:00
Yu Watanabe
6681eb021a udev: do not try to rename interface if it is already up
See dev_change_name() in kernel's net/core/dev.c.

Fixes #21105.
2021-10-25 20:18:53 +01:00
Yu Watanabe
756f1f5fd0 network: rename function 2021-10-26 02:27:26 +09:00
Yu Watanabe
df8bf72631 network: dhcp6: rename variables 2021-10-26 00:35:22 +09:00
Yu Watanabe
78e50edfd4 network: dhcp6pd: move logic of acquiring subnet prefix into dhcp6_pd_assign_prefix()
Preparation for later commits.
2021-10-26 00:35:22 +09:00
Yu Watanabe
56bbe0ef02 network: dhcp6pd: introduce a simplified and unified method to calculate subnet prefix 2021-10-26 00:35:22 +09:00
Yu Watanabe
f595b2e9b4
Merge pull request #21116 from poettering/test-cleaner
make tests a bit cleaner in regards to oomd handling
2021-10-25 23:16:14 +09:00
Yu Watanabe
1dfdf96716
Merge pull request #21117 from mrc0mmand/last-coverage-related-tweaks
Last batch of coverage-related tweaks
2021-10-25 23:15:47 +09:00
Yu Watanabe
f8aa82e43f
Merge pull request #21077 from poettering/mount-setattr
optimize remounting with mount_setattr() syscall
2021-10-25 23:15:10 +09:00
Yu Watanabe
2db32618fe nspawn: fix build when SECCOMP is disabled
Follow-up for 20e458ae3c.
2021-10-25 19:23:55 +09:00
Frantisek Sumsal
35382a9da3 test: merge coverage reports from previous test runs
Relevant mainly for tests which utilize both QEMU and nspawn.
2021-10-25 11:35:47 +02:00
Frantisek Sumsal
e70103e2d4 test: tweak TriggerLimitIntervalSec= when built with coverage
Collecting coverage causes a significant slowdown in general, but since
this test requires certain timing, we need to tweak the defaults to make
it reliably pass.
2021-10-25 11:02:22 +02:00
Lennart Poettering
1d1ba68816 varlink: don't try to talk to oomd from unit tests
Talking to external daemons we ourselves maintain is a job for the
integration tests, not the unit tests. This communication is likely to
fail hence don#t even bother.

This makes our tests a bit cleaner.
2021-10-25 10:45:22 +02:00
Lennart Poettering
fc594dee98 cgroup: handle gracefully if we can't read oom_kill cgroup attribute 2021-10-25 10:45:22 +02:00
Lennart Poettering
0289948eb4 mount-util: move opening of /proc/self/mountinfo into bind_remount_one_with_mountinfo()
Let's move things around a bit, and open /proc/self/mountinfo if needed
inside of bind_remount_one_with_mountinfo(). That way bind_remount_one()
can become a superthin inline wrapper around
bind_remount_one_with_mountinfo(). Main benefit is that we don't even
have to open /p/s/mi in case mount_setattr() actually worked for us.
2021-10-25 10:41:26 +02:00
Lennart Poettering
874052c501 mount-util: port over bind_remount_recursive_with_mountinfo() to mount_setattr() 2021-10-25 10:41:26 +02:00
Lennart Poettering
4f5644dba6 mount-util: use modern mount_setattr() syscall for bind_remount_one_with_mountinfo()
New kernels have a nice syscall for changing bind mount flags. Let's use
it. This makes the complex libmount based iteration logic unnecessary.
2021-10-25 10:41:26 +02:00
Luca Boccassi
6dbfbc4667 TODO: add note about chase_symlink flag 2021-10-24 17:00:49 +01:00
Yu Watanabe
8e4de611eb
Merge pull request #21108 from mrc0mmand/here-comes-the-coverage
A couple more coverage-related tweaks
2021-10-24 22:54:23 +09:00
Frantisek Sumsal
d2a39812fd test: rename the global service override file for coverage runs
Otherwise we break TEST-15-DROPIN, since it uses
/usr/lib/systemd/system/service.d/override.conf in some of its
sub-tests.
2021-10-23 22:10:24 +02:00
Frantisek Sumsal
8d5b38e568 README: fix CentOS CI badge 2021-10-23 21:46:53 +02:00
Frantisek Sumsal
035af7adfe test: disable ProtectHome= when collecting coverage as well
Depending on the location of the original build dir, either ProtectHome=
or ProtectSystem= may get in the way when creating the gcov metadata
files.

Follow-up to:
    * 02d7e73013
    * 6c9efba677
2021-10-23 21:27:20 +02:00
Yu Watanabe
096a154acc
Merge pull request #21082 from yuwata/network-dhcp6-pd-trivial-cleanups
network: DHCPv6 PD: several trivial cleanups
2021-10-23 23:58:22 +09:00
Anssi Hannula
37e4637a9e efivars: skip writing if variable is already in wanted state
In order to minimize EFI variable NVRAM wear, do not rewrite variables
if they are already in the wanted state (i.e. same data and attributes).

This allows e.g. performing repeat calls of "bootctl install" (which
always rewrites the EFI boot entry) without consuming EFI NVRAM write
cycles.
2021-10-23 23:57:56 +09:00
Lennart Poettering
aa0379f16f homed: don't drop caches on activation
We should drop caches if we are configured to do so in all cases where
we are done with home dir operations: except if that operation is
activation, because in that case we are not destroying anything, but
leaving it on.

Hence, turn off the flag that reminds us that we should drop caches
before exiting, once activation completed fully,

Follow-up for 86019efa44
2021-10-23 17:26:26 +09:00
Yu Watanabe
20e458ae3c nspawn: ignore --suppress-sync=yes when seccomp is disabled
Follow-up for 4a4654e024.

Fixes #21090.
2021-10-22 23:43:20 +02:00
Lennart Poettering
dbf1aca619 nspawn: bump RLIMIT_NOFILE for nspawn payload similar to how host PID 1 does it for its payload
We try to pass containers roughly the same rlimits as the host gets from
the kernel. However, this means we'd set the RLIMIT_NOFILE to 4K. Which
is quite limiting though, and is something we actually departed from in
PID1: since 52d6207578 we raise the limit
substantially for all userspace.

Given that nspawn is quite often invoked without proper PID1, let's raise the
limits for container payloads the same way as we do from the real PID1
to its service payloads.
2021-10-22 23:42:55 +02:00
Lennart Poettering
a07ab1dd8c update TODO 2021-10-22 19:20:13 +02:00
Jan Janssen
e6cab77eca sd-boot: Add keys to reboot into firmware interface
This is useful if the auto-firmware setting has been disabled. The
keys used here are based on what the majority of firmware employ in
the wild.
This also ensures there's a chance for the user to discover this in
case they were too slow during POST or simply used the wrong ones.
2021-10-22 19:12:55 +02:00
Lennart Poettering
784c249f41
Merge pull request #21094 from poettering/userns-split
util-lib: split out userns allocation into new helper function
2021-10-22 19:12:21 +02:00
Lennart Poettering
7afef7ed14
Merge pull request #21093 from poettering/homework-trivial-tweaks
homed trivial refactoring
2021-10-22 19:12:01 +02:00
Lennart Poettering
a5bf435ed7 update TODO 2021-10-22 17:57:13 +02:00
Lennart Poettering
a972ab0f25
Merge pull request #21079 from poettering/fd-reopen-directory-tweak
fd-util: when re-opening a directory with fd_reopen() go via openat(……
2021-10-22 17:41:17 +02:00
Lennart Poettering
43cac49092 process-util: move sync() out of freeze()
We are using this for creating userns namespaces, and we really
shouldn't try to sync there. Moreover the use of free() in shutdown code
doesn't need it anyway, since it just sync()ed right before anyway. Only
the third user of freeze() we have actually needs the syc(), hence do it
there and nowhere else.
2021-10-22 16:37:10 +02:00