Commit Graph

83762 Commits

Author SHA1 Message Date
anthisfan
9b89aee4af sd-device: use RET_GATHER() in device_tag_index() (#39053)
Replace manual error collection with RET_GATHER() macro.
2025-09-21 21:39:35 +09:00
Lennart Poettering
49e5c6462e meson: fix type in comment
As per https://github.com/systemd/systemd/pull/38999#discussion_r2363704203
2025-09-20 08:41:58 +02:00
Lennart Poettering
882c9ce040 pam: make libpam a dlopen() based dependency 2025-09-20 08:41:20 +02:00
Mike Yuan
4f8c1de213 core/manager: honor show_status_overridden in manager_watch_jobs_next_time()
Prompted by #39029
2025-09-20 00:01:54 +02:00
Yu Watanabe
e66b233e83 run: include sys/stat.h again
This partially reverts 9adb4685df.

For the case that sys/stat.h is not included indirectly by other headers.
Fixes the following error:
```
../src/run/run.c: In function 'fchown_to_capsule':
../src/run/run.c:2128:21: error: storage size of 'st' isn't known
 2128 |         struct stat st;
      |                     ^~
```
2025-09-19 22:56:49 +02:00
Yu Watanabe
4bbd7ece53 libaudit-util: fix typo
Follow-up for 4d8c5c657a.
2025-09-20 05:14:25 +09:00
Yu Watanabe
99e04eacbd Various smaller tweaks to bootctl (#38996) 2025-09-20 04:28:00 +09:00
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
a86a366eb0 bootctl: split out auto-enroll cert load code into function of its own 2025-09-20 00:47:46 +09:00
Lennart Poettering
407139ae92 bootctl: output a more precise log message when updating existing EFI vars 2025-09-20 00:47:46 +09:00
Lennart Poettering
7dd55c83b8 bootctl: don't update $ESP/EFI/BOOTX64.EFI twice
We update BOOTX64.EFI explicitly once (because we know that it's the
main entry point of UEFI) and then a second time when we update
everything in $ESP/EFI/*.EFI. That's redundant and pretty ugly/confusing
in the log output. Hence exclude the file we already updated explicitly
from the 2nd run.
2025-09-20 00:47:46 +09:00
Lennart Poettering
b6f4f85c39 bootctl: downgrade messages about foreign EFI files
Given that we iterate through $ESP/EFI/BOOT/*.EFI these days this is a
pretty common case, hence it's not really noteworthy, hence downgrade
these log messages from LOG_NOTICE to LOG_INFO.
2025-09-20 00:47:46 +09:00
Lennart Poettering
c95d72913a bootctl: split out varlink setup into a helper call of its own 2025-09-20 00:47:46 +09:00
Lennart Poettering
83d0b6597c bootctl: normalize some enum definitions 2025-09-20 00:47:46 +09:00
Lennart Poettering
f757022294 bootctl: use RET_GATHER() all over the place 2025-09-20 00:47:46 +09:00
Lennart Poettering
5c396a0110 bootctl: switch a few getenv() calls to secure_getenv()
Following the rule that we should always prefer the secure flavour over
the regular one unless there's a clear reason for the regular one, let's
switch this over. Better safe than sorry.
2025-09-20 00:47:46 +09: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