Commit Graph
83747 Commits
Author SHA1 Message Date
Mike Yuan d25c8ee7f9 core: console status fixes (#39029) 2025-09-19 20:30:11 +02:00
Lennart Poettering de5d773ddf small refactorings of the machine-credential code (#38982)
This is ultimately preparation for #38764, but makes a lot of sense on
its own.
2025-09-19 18:28:39 +02:00
Lennart Poettering 6aaff2d532 repart: some smaller tweaks (#38995) 2025-09-19 17:43:52 +02:00
Lennart Poettering 597eed0aa8 dlopen() libaudit (#38998)
Split out of #38861
2025-09-19 17:43:33 +02:00
Lennart Poettering 9ecc969855 core: fix status output suppression
This fixes two things: first of all it ensures we take the override
status output field properly into account, instead of going directly to
the regular one.

Moreover, it ensures that we bypass auto for both notice + emergency,
since both have the same "impact", and, don't limit this for notice
only.
2025-09-19 17:32:48 +02:00
Lennart Poettering 8e9b722b4a unit: line-break overly long parameter list + add assert() 2025-09-19 17:32:48 +02:00
Lennart Poettering 84ba8721de job: shorten code 2025-09-19 17:32:48 +02:00
Lennart Poettering 9b72c358d4 machine-credential: add low-level machine_credential_add() as common back-end for machine_credential_set() + machine_credential_load() 2025-09-19 17:08:03 +02:00
Lennart Poettering 9dd33dce76 machine-credential: replace machine_credentials_contains() by machine_credential_find() 2025-09-19 17:07:50 +02:00
Lennart Poettering 0dc73c5253 machine-credential: include the high-level not the low-level string-util.h 2025-09-19 16:48:41 +02:00
Lennart Poettering 2f5fb752a6 repart: tweak byte value output
So far, when outputing information about copy progress we'd suppress the
digit after the dot if it is zero. That makes the progress bar a bit
"jumpy", because sometimes there are two more character cells used than
other times. Let's just always output one digit after the dot here
hence, to avoid this.
2025-09-19 16:46:07 +02:00
Lennart Poettering 222dcf3bc2 repart: add some line breaks 2025-09-19 16:36:34 +02:00
Lennart Poettering bc54521855 repart: never use a grain size below sector size 2025-09-19 16:36:34 +02:00
Lennart Poettering 6db162492b openssl-util: make openssl_load_private_key()'s ret_ui parameter optional 2025-09-19 16:36:34 +02:00
Lennart Poettering 722d3f712a audit: shortcut some audit syscalls if we are compiled without audit support anyway 2025-09-19 16:30:13 +02:00
Lennart Poettering 4d8c5c657a build: make libaudit dep dlopen() 2025-09-19 16:30:13 +02:00
Daan De Meyer 93ed79c0b0 core: Expose oom kills and managed oom kills as properties (#38906)
It can be useful for users to know this information so let's expose it
as properties so it can be queried.
2025-09-19 16:19:19 +02:00
Daan De Meyer 8796164189 tree-wide: Remove unused includes (#39023) 2025-09-19 16:07:04 +02:00
Daan De Meyer 9adb4685df tree-wide: Remove unused includes 2025-09-19 14:46:55 +02:00
Daan De Meyer d4da97400c test: Add tests for systemd's kernel oom kill handling 2025-09-19 13:54:54 +02:00
Daan De Meyer 9cf6ad16dd core: Expose oom kills and managed oom kills as properties
It can be useful for users to know this information so let's expose
it as properties so it can be queried.
2025-09-19 13:54:54 +02:00
Daan De Meyer e03e5056db core: Use oom_group_kill attribute if OOMPolicy=kill
For managed oom kills, we check the user.oomd_ooms property which
reports how many times systemd-oomd recursively killed the entire
cgroup. For kernel OOM kills, we check the oom_kill property from
memory.events which reports how many processes were killed by the
kernel OOM killer in the corresponding cgroup and its child cgroups.
For units with Delegate=yes, this is problematic, becase OOM kills
in child cgroups that were handled by the delegated unit will still
be treated as unit OOM kills by systemd.

Specifically, if systemd is managing the delegated cgroup and
memory.oom.group=1 is set on both the service cgroup and the child
cgroup, if the child cgroup is OOM killed and this is handled by systemd
running inside the delegated units, when the unit exits later, it will
still be treated as oom-killed because oom_kill in memory.events will
contain the OOM kills that happened in the child cgroup.

To allow addressing this, the oom_group_kill property was added to the
memory.events and memory.events.local files which allows reading how many
times the entire cgroup was oom killed by the kernel if memory.oom.group=1.
If we read this from memory.events.local, we know how many times the unit's
entire cgroup (plus child cgroups) got oom killed by the kernel. This matches
what we report for systemd-oomd managed oom kills and avoids reporting the
unit as oom-killed if a child cgroup was oom killed by the kernel due to
having memory.oom.group=1 set on it.

Since this is only available from kernel 5.12 onwards, we fall back to
reading the oom_kill field from memory.events if the oom_group_kill property
is not available.
2025-09-19 13:54:54 +02:00
Daan De Meyer db35a83fe9 mkosi: Add stress-ng to sanitizer wrapper programs 2025-09-19 13:54:54 +02:00
Yu Watanabe e37e64e942 man/varlink: fix typo
Follow-up for 04e2cb8928.
2025-09-19 20:25:26 +09:00
Yu Watanabe cbdbf68a72 man/repart: fix typo
Follow-up for 49dcc89ddc.
2025-09-19 20:24:09 +09:00
Yu Watanabe 2672108a1e creds-util: fix typo
Follow-up for 9be0a94b98.
2025-09-19 20:23:05 +09:00
Yu Watanabe b0f6d31f6f varlink: flag -> flags
Follow-up for 86fd19af14.
2025-09-19 20:21:22 +09:00
Luca Boccassi 12ef7e0a2c docs: use '_' as separator for OSC page
Make it consistent with other pages

Fixes https://github.com/systemd/systemd/issues/39019
2025-09-19 20:11:46 +09:00
Mike Yuan 01184496a2 virt: revert to detect chroot by comparing with / rather than /proc/PID/root
This partially reverts d6267b9b18

So, arch-chroot currently uses a rather cursed setup:
it sets up a PID namespace, but mounts /proc/ from the outside
into the chroot tree, and then call chroot(2), essentially
making it somewhere between chroot(8) and a full-blown
container. Hence, the PID dirs in /proc/ reveal the outer world.
The offending commit switched chroot detection to compare
/proc/1/root and /proc/OUR_PID/root, exhibiting the faulty behavior
where the mentioned environment now gets deemed to be non-chroot.

Now, this is very much an issue in arch-chroot. However,
if /proc/ is to be properly associated with the pidns,
then we'd treat it as a container and no longer a chroot.
Also, the previous logic feels more readable and more
honestly reported errors in proc_mounted(). Hence I opted
for reverting the change here. Still note that the culprit
(once again :/) lies in the arch-chroot's pidns impl, not
systemd.

Fixes https://gitlab.archlinux.org/archlinux/packaging/packages/systemd/-/issues/54
2025-09-19 13:09:34 +02:00
Yu Watanabe c3c42b30dd firewall-util: remove iptables/libiptc backend support (#38976)
This removes iptables/libiptc backend support in firewall-util, as
already announced by 5c68c51045.
Then, this drops meaningless `FirewallContext` wrapper.
2025-09-19 19:54:17 +09:00
Daan De Meyer 3111327ca4 include: Add missing IWYU pragmas 2025-09-19 12:44:29 +02:00
Daan De Meyer 1403faeb15 tree-wide: Fix two curl warnings 2025-09-19 11:32:04 +02:00
Lennart Poettering bdd8728c91 various: port remaining users of setmntent() to libmount (#38929) 2025-09-19 09:26:06 +02:00
Yu Watanabe fbbbff01fb various tweaks for systemd-creds & related (#38979) 2025-09-19 16:21:12 +09:00
Yu Watanabe 542552612b chase: tweaks to chase_open()/chase_openat() (#38984) 2025-09-19 16:11:24 +09:00
Yu Watanabe 9a8f2b628d chattr-util/acl-util: add helpers that tells us if an inode type can do chattr/acl (#39003)
Split out of #38728 but I think this makes things more readable in
general and makes sense on its own.
2025-09-19 15:50:18 +09:00
Yu Watanabe 8835034df8 importd: some minor tweaks (#39008) 2025-09-19 15:48:14 +09:00
Lennart Poettering 625c2e10c6 importd: port to PidRef 2025-09-19 15:45:46 +09:00
Lennart Poettering 93dea63fab fileio: modernize xopendirat() a bit 2025-09-19 08:39:32 +02:00
ners 7b7f0983e0 localectl: use XKB path specified from environment variable 2025-09-19 15:37:52 +09:00
Yu Watanabe 56f003d164 firewall-util: rename firewall-util-nft.c to firewall-util.c 2025-09-19 15:33:17 +09:00
Yu Watanabe 7184f8366f firewall-util: drop FirewallContext
After iptables support is dropped, FirewallContext is a trivial
wrapper of sd_netlink. Let's drop it and directly use sd_netlink.
2025-09-19 15:33:17 +09:00
Yu Watanabe 9b75c41cb3 sd-netlink: make netlink_get_reply_callback_count() accept NULL 2025-09-19 15:33:17 +09:00
Yu Watanabe 114c4b95df firewall-util: remove iptables backend
As already announced by 5c68c51045,
let's remove iptables backend of firewall-util through libiptc.
2025-09-19 15:33:15 +09:00
Mike Yuan b6c8f0ec91 userdb: suppress creation of empty userdb dirs 2025-09-18 22:58:16 +02:00
Luca Boccassi defa0148b8 units: add missing Documentation=
The initrd units are described in the graphs in the bootup manpage,
so use that one for them.
2025-09-18 21:54:36 +01:00
Lennart Poettering 7d4b0df9f8 creds-util: don't reference superblocks when decrypting creds 2025-09-18 22:11:57 +02:00
Lennart Poettering 4be269563d core: if we cannot decode a TPM credential skip over it for ImportCredential=
let's skip over credentials we cannot decode when they are found with
ImportCredential=. When installing an OS on some disk and using that
disk on a different machine than assumed we'll otherwise end up with a
broken boot, because the credentials cannot be decoded when starting
systemd-firstboot. Let's handle this somewhat gracefully.

This leaves handling for LoadCredential=/SetCredential= as it is (i.e.
failure to decrypt results in service failure), because it is a lot more
explicit and focussed as opposed to ImportCredentials= which looks
everywhere, uses globs and so on and is hence very vague and unfocussed.

Fixes: #34740
2025-09-18 22:11:57 +02:00
Lennart Poettering ffd4b38096 creds: expose more errors as explicit varlink errors 2025-09-18 22:11:57 +02:00
Lennart Poettering 9be0a94b98 creds-util: tweak error code generation in decrypt_credential_and_warn() a bit, and add a comment listing it
Let's make some specific condition more recognizable via error codes of
their own, and in particular remove confusion between EREMOTE as
returned by tpm2_unseal() and by us.
2025-09-18 22:11:57 +02:00