1
0
mirror of https://github.com/systemd/systemd.git synced 2024-12-23 21:35:11 +03:00
Commit Graph

56203 Commits

Author SHA1 Message Date
Lennart Poettering
1d7150ec7f docs: make clear that if you use threaded cgroups you need to do that two levels down from your delegated cgroup
Prompted by: #22486
2022-02-14 19:06:40 +00:00
Luca Boccassi
d74da762a3
Merge pull request #22506 from poettering/devnum-zero-btrfs-block-dev
gpt-auto: some (primarily cosmetic) fixes to backing block device detection in gpt-auto-generator/sd-device
2022-02-14 16:17:04 +00:00
Luca Boccassi
bfba9946a1
Merge pull request #22445 from lnussel/logind
logind: post review fixes
2022-02-14 16:16:39 +00:00
Frantisek Sumsal
fdf9de694f
Merge pull request #22505 from mrc0mmand/more-coverage-tweaks
A couple of coverage-related tweaks
2022-02-14 13:51:08 +00:00
Yu Watanabe
42672c80dc test: check if running in container earlier 2022-02-14 13:46:17 +00:00
Luca Boccassi
d0ebe2a835
Merge pull request #22496 from yuwata/network-cleanups-keep-configuration
network: cleanups for KeepConfiguration= setting
2022-02-14 13:17:23 +00:00
Lennart Poettering
d5cb053cd9 gpt-auto: properly handle case where we can't determine devno of /usr/ fs
get_block_device_harder() returns == 0 if the fs is valid, but it is not
backed by a single devno. (As opposed to returning > 0 if the devno is
valid). Let's catch this case and log a clear message, and don't bother
open the device in that case.

This is mostly cosmetical, as either way, systemd-gpt-auto-generator
doesn't work in scenarios like that.

Prompted-by: #22504
2022-02-14 13:40:59 +01:00
Lennart Poettering
f1ad2c9238 sd-device: refuse opening device mit major/minor of zero early
device nodes with 0 dev_t are not real (and for that reason such inodes
are used as whiteouts in overlayfs, for example), hence refuse them
early. It seems wrong going to sysfs for something we know can't exist
anyway.
2022-02-14 13:40:56 +01:00
Frantisek Sumsal
d282e57e2a test: check for (possibly) missing test coverage
If the test logs contain lines like:

```
...systemd-resolved[735885]: profiling:/systemd-meson-build/src/shared/libsystemd-shared-250.a.p/base-filesystem.c.gcda:Cannot open
```

it means we're possibly missing some coverage since gcov can't write the stats,
usually due to the sandbox being too restrictive (e.g. ProtectSystem=yes,
ProtectHome=yes) or the $BUILD_DIR being inaccessible to non-root users.
2022-02-14 12:20:02 +01:00
Frantisek Sumsal
e4c822e9ac test: set ACLs for the build dir when built with coverage
Otherwise unprivileged processes (like systemd-resolved) can't write
coverage data.
2022-02-14 11:58:54 +01:00
Matija Skala
1b46eb23bc do not call __register_atfork directly
this way it is cleaner and more portable and systemd links against libpthread anyway
2022-02-14 10:49:43 +01:00
Ludwig Nussel
2a3a5288cb systemctl: fix halt -f
Commit adefc8789b always asks logind for shutdown first. So I broke halt
-f which is supposed to issue a direct syscall in that case.
2022-02-14 09:35:12 +01:00
Ludwig Nussel
54141d8ddd logind: more verbose struct initialization 2022-02-14 09:35:12 +01:00
Ludwig Nussel
1831759a70 logind: increase max wall message length to 4096 2022-02-14 09:35:12 +01:00
Ludwig Nussel
d2fc0ecf9a logind: style fixes 2022-02-14 09:35:12 +01:00
Ludwig Nussel
138224fc80 logind: add handle enum to struct
Avoid pointer arithmetic at the expense of repeating the enum value
in the struct.
2022-02-14 09:35:12 +01:00
Evgeny Vereshchagin
74b781de25
Merge pull request #22499 from mrc0mmand/ci-tweaks
A couple of Packit/Super-Linter tweaks
2022-02-13 19:13:05 +03:00
Frantisek Sumsal
ebcccfd950 ci: re-enable s390x Packit builds
The s390x Copr builders are finally[0] 'native' instead of QEMU-emulated,
which makes them pretty quick to be used in PRs.

[0] https://lists.fedoraproject.org/archives/list/copr-devel@lists.fedorahosted.org/message/AR3ZDKET3EXZHV3MSU3UHMO7EIKBGAN2/
2022-02-13 15:06:24 +01:00
Frantisek Sumsal
23a830e46e ci: explicitly disable multi-status for Super-Linter
to, hopefully, get rid of the following error:

```
 2022-02-13 13:32:12 [ERROR]   Failed to get [GITHUB_TOKEN]!
 2022-02-13 13:32:12 [ERROR]   []
 2022-02-13 13:32:12 [ERROR]   Please set a [GITHUB_TOKEN] from the main workflow environment to take advantage of multiple status reports!
```
2022-02-13 14:59:08 +01:00
Frantisek Sumsal
f94b33803f ci: use the 'slim' version of Super-Linter
The 'slim' version drops certain storage-heavy linters[0] which we don't
use anyway, so let's make the job a bit faster by downloading and using
a smaller image.

[0] https://github.com/github/super-linter#slim-image
2022-02-13 14:54:51 +01:00
Yu Watanabe
e41dcb8221 NEWS: clarify that ForceDHCPv6PDOtherInformation= is removed
Closes #22493.
2022-02-13 11:50:05 +00:00
Yu Watanabe
81db4f3dd8 network: drop managed configs on reconfigure when KeepConfiguration=yes
Otherwise, the managed configs, that is addresses, routes and so on
configured by the previously assigned .network file will not be dropped
on reconfiguring the interface.
2022-02-13 20:01:42 +09:00
Yu Watanabe
07c160a65c network: drop redundant condition
The function `link_drop_foreign_addresses()` is only called in
`link_drop_foreign_config()`, and the same condition is located in the
caller.
2022-02-13 20:01:29 +09:00
Yu Watanabe
74c60fcbec cgroup-util: refuse the case that both path and suffix are empty strings
Fixes CID#1322378.
2022-02-12 11:01:52 +00:00
Jan Janssen
ac3979abd7 boot: Correctly check the return value of CheckEvent
Fixes: #22428
2022-02-11 17:07:05 +00:00
Luca Boccassi
6fb81984ee
Merge pull request #22485 from poettering/cgroup-id-not-support
cgroup: downgrade warnings of "cgroup ID" can't be read (on old kernels)
2022-02-11 17:06:30 +00:00
Evgeny Vereshchagin
d6b99a4a48 ci: run all fuzz targets on CIFuzz
CIFuzz has been kind of broken for a couple months because
coverage reports downloaded from OSS-Fuzz contain absolute
paths while paths to files changed in PRs are relative and they
don't match. It makes it kind of hard for CIFuzz to figure out
what it should run so it runs either all fuzz targets or just new
fuzz targets. Until that issue is fixed let's just always predictably run
all fuzz targets.
2022-02-11 13:21:24 +00:00
Lennart Poettering
5483fca07a pid1: export cgroup ID among per-unit cgroup information
It's really interesting for debugging purposes and we have it already,
hence expose it as dbus property.
2022-02-11 13:36:39 +01:00
Lennart Poettering
a561253f0b cgroup-util: minor modernizations
Rename return parameters to "ret", use ternary op without second
argument, rebreak comments, use isempty() more.
2022-02-11 13:36:39 +01:00
Lennart Poettering
1b42022388 cgroup: downgrade warning if we can't get ID off cgroup
The cgroupid feature was not available in old cgroupvs2 kernels, hence
try to get it but if we can't because it's not supported, then only
debug log about it and proceed.

(We only needs this for cgroup bpf stuff, but that isn't available on
such old kernels anyway)

Fixes: #22483
2022-02-11 13:36:39 +01:00
Zbigniew Jędrzejewski-Szmek
e01e68e70a basic: do not warn in mkdir_p() when parent directory exists
This effectively disables warnings about type/mode/ownership of existing
directories when recursively creating parent directories. (Or files. If there's
a file in a place we expect a directory, the code will later try to create
a file and fail. This follows the general pattern where we do (void)mkdir()
if the mkdir() is immediately followed by opening of a file.)

I was recently debugging an issue with the fstab-generator [1], and it says:
'Directory "/tmp" already exists, but has mode 0777 that is too permissive (0644 was requested), refusing.'
which is very specific but totally wrong in this context.
This output was added in 37c1d5e97d, and I still
think it is worth to do it, because if you actually *do* want the directory, if
there's something wrong, the precise error message will make it much easier to
diagnose. And we can't easily pass the information what failed up the call chain
because there are multiple things we check (ownership, permission mask, type)…
So passing a param whether to warn or not down into the library code seems like
the best solution, despite not being very elegant.

[1] https://bugzilla.redhat.com/show_bug.cgi?id=2051285
2022-02-11 10:05:21 +01:00
Evgeny Vereshchagin
a38f3ceeda resolve: describe mdns event sources
when they go down resolved prints
```
Event source mdns-ipv4 (type io) returned error, disabling
```
instead of
```
Event source n/a (type io) returned error, disabling
```
2022-02-11 07:01:58 +09:00
Frantisek Sumsal
da185cd04d tree-wide: move unsigned to the start of type declaration
Even though ISO C11 doesn't mandate in which order the type specifiers
should appear, having `unsigned` at the beginning of each type
declaration feels more natural and, more importantly, it unbreaks
Coccinelle, which has a hard time parsing `long unsigned` and others:

```
init_defs_builtins: /usr/lib64/coccinelle/standard.h
init_defs: /home/mrc0mmand/repos/systemd/coccinelle/macros.h
HANDLING: src/shared/mount-util.c
: 1: strange type1, maybe because of weird order: long unsigned
```

Most of the codebase already "complies", so let's fix the remaining
"offenders".
2022-02-10 21:00:22 +01:00
Frantisek Sumsal
4ba5594390 test: document how to manually run Ubuntu CI stuff
Every time I need it I have to first relearn autopkgtest and find where
all the necessary stuff lives, so let's document it somewhere close to
systemd for (at least) future me.
2022-02-10 13:53:10 +00:00
Frantisek Sumsal
b034f02c62 test: accept GC'ed units in newer LVM
Since lvm 2.03.15 the transient units are started without `-r`, thus
disappearing once they finish and breaking the test (which expects them
to remain loaded after finishing). Let's accept `LoadState=not-found` as
a valid result as well to fix this.

Follow-up to: d10d562bd4
See: https://sourceware.org/git/?p=lvm2.git;a=commit;h=fbd8b0cf43dc67f51f86f060dce748f446985855
2022-02-10 13:26:11 +00:00
Yu Watanabe
2d88df457a
Merge pull request #22471 from yuwata/network-bridge-vlan-protocol
network: bridge: fix vlan protocol
2022-02-10 20:40:04 +09:00
Yu Watanabe
ac7e18be76
Merge pull request #22452 from yuwata/network-ipv6ll
network: use sysctl to set IPv6LL address generation mode when the interface is already up
2022-02-10 20:38:56 +09:00
Yu Watanabe
b6d5dab7bb test-network: add missing tests for bridge properties 2022-02-10 18:04:34 +09:00
Yu Watanabe
6eb35be8e0 network: bridge: fix endian of vlan protocol
Fixes #22469.
2022-02-10 17:47:17 +09:00
Yu Watanabe
2becdbccd1 test-network: add testcase for re-generating IPv6LL address 2022-02-10 17:35:48 +09:00
Joerie de Gram
77d65e5659 network: attempt to trigger kernel IPv6LL address generation
Try to ensure kernel IPv6 link local address generation occurs by
setting the per-if addr_gen_mode sysctl when the link is already up,
instead of the netlink interface (IFLA_INET6_ADDR_GEN_MODE).

The netlink setting is sufficient in cases where the interface is not
yet up when networkd configures an interface - bringing the interface
up will trigger in-kernel address generation.

If the interface is already up, yet the interface has no IPv6LL assigned
setting IFLA_INET6_ADDR_GEN_MODE has no effect.

Writing the addr_gen_mode sysctl is a best effort attempt at triggering
address generation regardless of interface state because it also works
in cases where the interface is already up.

Fixes #22424.
2022-02-10 17:35:41 +09:00
Yu Watanabe
2b25f4eb23 network: move link_set_ipv6ll_stable_secret() to networkd-ipv6ll.c 2022-02-10 17:34:06 +09:00
Yu Watanabe
05b8fc498e network: skip to set IPv6LL address generation mode if the requested mode is already set 2022-02-10 17:34:06 +09:00
Yu Watanabe
6614116458 network: use log_link_warning_errno() or friends where applicable 2022-02-10 17:34:06 +09:00
Yu Watanabe
7d0d832d67 network: monitor current IPv6LL address generation mode 2022-02-10 17:34:06 +09:00
Yu Watanabe
80f2647dfb network: introduce two helper functions for setting IPv6LL address generation mode 2022-02-10 17:34:02 +09:00
Alvin Šipraga
19ff06b3a4
udev/net: support Match.Firmware= in .link files (#22462)
In cbcdcaaa0e ("Add support for conditions on the machines firmware")
a new Firmware= directive was added for .netdev and .network files.
While it was also documented to work on .link files, in actual fact the
support was missing. Add that one extra line to make it work, and also
update the fuzzer directives.
2022-02-10 16:19:28 +09:00
Anita Zhang
56eb88761e
Merge pull request #22467 from mrc0mmand/TEST-64-lvm-static-autoactivation
test: lvm 2.03.15 dropped the static autoactivation
2022-02-09 17:10:06 -08:00
Frantisek Sumsal
d10d562bd4 test: lvm 2.03.15 dropped the static autoactivation
so install the respective generator only if we're running with older
lvm versions.

See: https://sourceware.org/git/?p=lvm2.git;a=commit;h=ee8fb0310c53ed003a43b324c99cdfd891dd1a7c
2022-02-09 22:36:25 +01:00
Federico Ceratto
68174bf051
Clarify protocol used in systemd-journal-upload (#22465)
* Clarify protocol used in systemd-journal-upload
2022-02-09 20:34:29 +00:00