Commit Graph
82760 Commits
Author SHA1 Message Date
Yu Watanabe d38f87c56c conf-files: make conf_files_list() and friends internally use struct ConfFile
No functional change, just refactoring.
2025-07-11 10:41:50 +09:00
Yu Watanabe 31b7616420 conf-files: introduce struct ConfFile to store information of found conf file
It is currently unused, will be used later. Preparation for later changes.
2025-07-11 10:41:07 +09:00
Yu Watanabe 628f45f4a3 chase: allow to request O_PATH fd even with CHASE_NONEXISTENT 2025-07-11 10:39:55 +09:00
Yu Watanabe 99ae2ae328 test-cgroup: Ignore ENOENT from cg_create(); test-cgroup-util: Ignore ENXIO in one more place (#38158)
This was the only test failure building systemd-252-51.el9 in a
container, also previously reported against 252-rc1 under Gentoo in
#25015

This is a forward-port of the patch we actually started using for CIQ's
builds of the EL9-derived package, which was:

```diff
--- systemd-252/src/test/test-cgroup.c	2022-10-31 18:59:18.000000000 +0000
+++ systemd-252-test/src/test/test-cgroup.c	2025-07-10 00:47:07.541000000 +0000
@@ -62,7 +62,7 @@
         log_info("Paths for test:\n%s\n%s", test_a, test_b);
 
         r = cg_create(SYSTEMD_CGROUP_CONTROLLER, test_a);
-        if (IN_SET(r, -EPERM, -EACCES, -EROFS)) {
+        if (IN_SET(r, -EPERM, -EACCES, -EROFS, -ENOENT)) {
                 log_info_errno(r, "Skipping %s: %m", __func__);
                 return;
         }
```

I confirmed that the `ERRNO_IS_NEG_FS_WRITE_REFUSED` macro is equivalent
to checking the first 3 error codes above, so the addition of the check
for `ENOENT` is still just as relevant as it was in 252, but adding it
into the macro would be inconsistent with its name, description, and
possible other uses. Hence, in this PR I'm adding the extra check into
the `if`.
2025-07-11 10:38:04 +09:00
Yu Watanabe 878fa7d26e journalctl: do not fail on SIGTERM/SIGINT or STDOUT disconnect when running with --follow (#38116)
Closes #38114.
2025-07-11 10:36:31 +09:00
Yu Watanabe 0c0b4d544c io.systemd.Manager.Describe fix context/runtime split (#38135)
This PR rearranges fields in io.systemd.Manager.Describe according to
the guidance by Lennart:

> If a property can be set in a unit file, ever, then it belongs in context.
> Otherwise, it belongs to runtime.

Closes #38124.
2025-07-11 10:26:57 +09:00
Yu Watanabe b3337feb55 Plumbing to perform SELinux checks in varlink API (#38146)
This PR does minimal changes to introduce varlink support. Ideally, the
code should switch to using `mac_selinux_get_our_label()` and new
`mac_selinux_get_peer_label()`. But I leave it for now to minimize
breakage. `mac_selinux_get_peer_label()` remains unused.

This is a prep step to merge
https://github.com/systemd/systemd/pull/38032
2025-07-11 10:20:36 +09:00
Solar Designer 52fe0a490d test-cgroup-util: Ignore ENXIO in one more place 2025-07-11 01:49:36 +02:00
Yu Watanabe 49bdc8b1e8 NEWS: mention about the exit code change in journalctl --follow 2025-07-11 08:45:46 +09:00
Yu Watanabe d6b3793704 test: drop unnecessary disablement of pipefail 2025-07-11 08:45:46 +09:00
Yu Watanabe 054464ad52 main-func: drop unused DEFINE_MAIN_FUNCTION_WITH_POSITIVE_SIGNAL() 2025-07-11 08:44:43 +09:00
Yu Watanabe 390097724b journalctl: do not fail on SIGTERM/SIGINT, or when STDOUT is disconnected
The current behavior is not useful when e.g. pipefail is enabled.
Let's exit cleanly in such cases.

Closes #38114.
2025-07-11 08:41:10 +09:00
Solar Designer 470da65110 test-cgroup: Ignore ENOENT from cg_create()
which was the only test failure building systemd-252-51.el9 in a
container, also previously reported against 252-rc1 under Gentoo
in #25015
2025-07-11 00:28:14 +02:00
Matteo Croce 7aefb194e7 man/systemd.exec: explain how BPF token works
Add a small paragraph explaining how BPF token works, how it's being
created and its relationship between the BPF filesystem.
Move all the relevant documentation in the PrivateBPF= section and let
point all the BPFDelegate* options to that one.
2025-07-10 21:40:07 +02:00
Ubuntu df5b3426f6 journald: support reloading configuration at runtime 2025-07-10 21:38:36 +02:00
Lennart Poettering c35ceb84e3 Introduce ERRNO_IS_FS_WRITE_REFUSED(), and use it in binfmt_mounted() (#38117)
- This introduces ERRNO_IS_FS_WRITE_REFUSED(), and apply it where
usable.
- This makes unexpected errors in access_fd() called by binfmt_mounted()
propagated to the caller.
- Renames binfmt_mounted() to binfmt_mounted_and_writable(), as it also
checks the fs is writable.
- Voidifies one disable_binfmt() call in shutdown.c.
2025-07-10 21:38:13 +02:00
DaanDeMeyer cc43510a13 userdb: Add userdb.transient credentials
To implement --bind-user in systemd-vmspawn, we need a transient
version of these credentials. These are useful when the home directory
of the user is mounted into the container/vm and every trace of the user
will be (mostly) gone again when the container/vm is shut down.
2025-07-10 21:36:09 +02:00
Ivan Kruglov d5f4bd3700 selinux: mac_selinux_unit_access_check_varlink macros 2025-07-10 21:16:32 +02:00
Ivan Kruglov e3fef210c8 selinux: mac_selinux_access_check_varlink_internal() 2025-07-10 21:16:32 +02:00
Ivan Kruglov fe3f2ac073 selinux: check_access() 2025-07-10 21:16:32 +02:00
Ivan Kruglov 5dc3096efb core: leave a comment about context/runtime split 2025-07-10 21:08:11 +02:00
Ivan Kruglov 79eec46dfd core: move ControlGroup move runtime to context 2025-07-10 21:08:11 +02:00
Ivan Kruglov 89701e02ac core: move ConfirmSpawn from runtime to context 2025-07-10 21:08:11 +02:00
Ivan Kruglov 303d1b6b57 core: move ShowStatus/Log* from runtime to context 2025-07-10 21:08:11 +02:00
Ivan Kruglov 712f763036 core: move WatchdogDevice from runtime to context 2025-07-10 21:08:11 +02:00
Ivan Kruglov 545fde151a core: move RuntimeWatchdog* + RebootWatchdog + KExecWatchdog from runtime to spec 2025-07-10 21:08:11 +02:00
Ivan Kruglov afa9992429 core: fix double Environment present in both context and runtime 2025-07-10 21:08:11 +02:00
Ivan Kruglov a5d8520f86 core: move Version/Arch/Features/Taints/UnitPath from context to runtime 2025-07-10 21:08:11 +02:00
Ivan Kruglov 84c05ec632 selinux: get_our_contexts() 2025-07-10 21:06:51 +02:00
Ivan Kruglov 3484af2800 selinux: rename mac_selinux_access_check_internal() -> mac_selinux_access_check_bus_internal() 2025-07-10 21:06:51 +02:00
Ivan Kruglov 5a1cb174f8 selinux-utils: rename and expose log_selinux_enforcing_errno() 2025-07-10 21:06:51 +02:00
Ivan Kruglov 204e3cb6c8 selinux-util: mac_selinux_get_peer_label() 2025-07-10 21:06:51 +02:00
DaanDeMeyer 88444243b8 ruff: Default to python 3.7 version
For some use cases we still want python 3.7 compat so let's default
to that and only target python 3.9 in a few specific cases.
2025-07-10 18:09:17 +02:00
Li Tian b6d4997683 Add --entry-type=type1|type2 option to kernel-install.
Both kernel-core and kernel-uki-virt call kernel-install upon removal. Need an additional argument to avoid complete removal for both traditional kernel and UKI.

Signed-off-by: Li Tian <litian@redhat.com>
2025-07-10 18:07:23 +02:00
DaanDeMeyer 33a5cc768c socket-activate: Always send NOTIFY=ready
Even if we're not using --accept=, it's very useful to be able to
synchronize on systemd-socket-activate having binded to its listen
socket, so let's always send READY=1. This means the payload can't
send READY=1 anymore but it's doubtful whether that's useful in this
case in the first place.
2025-07-10 16:19:46 +02:00
Daan De Meyer 6a9cb1936f Two trivial nspawn fixes (#38152) 2025-07-10 16:19:18 +02:00
DaanDeMeyer 1f24a954e4 vmspawn: Use virtio-blk-pci for image instead of virtio-scsi-pci
We don't need a full blown SCSI controller just to present the main
root drive device to the VM. Let's simplify the storage stack by using
virtio-blk-pci instead.

Additionally, virtio-blk-pci is a builtin module in Arch and Fedora
which means we can do qemu direct kernel boot without needing an initrd.
2025-07-10 16:18:33 +02:00
DaanDeMeyer 6ed684db41 escape: Make quote_command_line() argument const 2025-07-10 16:18:10 +02:00
DaanDeMeyer 8ba6c2b7f5 vmspawn: Disable hpet for vmspawn x86 virtual machines
hpet is an emulated clocksource that is generally discouraged in favor
of kvm-clock or tsc for virtual machines. While vmspawn's virtual machines
already use kvm-clock, leaving hpet enabled causes qemu on the host to
consume a non-trivial amount of cpu, so let's disable the hpet feature since
we're not making use of it anyway.
2025-07-10 16:14:52 +02:00
Yu Watanabe 0b565facc4 Revert "resolve: query the parent zone for DS records"
This reverts commit 49ff90c70d.
2025-07-10 15:18:07 +02:00
DaanDeMeyer 4f54d81ace nspawn: Use in_child_chown() in one more place 2025-07-10 13:55:45 +02:00
DaanDeMeyer 6f60ce002b nspawn: Improve log message 2025-07-10 13:55:43 +02:00
Eisuke Kawashima dc6e9c548b zsh-completion: generate completion for systemd-run from systemd-analyze
continuation of #37641
2025-07-10 11:39:06 +02:00
Jörg Behrmann 693f11d5ba news: fix typo 2025-07-10 10:23:28 +02:00
Christian Hesse 8dfe176adc man: clean up list of literals 2025-07-10 15:23:56 +09:00
Yu Watanabe 0777d821ad ci: also set TEST_RUNNER environment variable in coverage test
Otherwise, integration-test-wrapper.py will fail.
```
Traceback (most recent call last):
  File "/home/runner/work/systemd/systemd/test/integration-tests/integration-test-wrapper.py", line 693, in <module>
    main()
    ~~~~^^
  File "/home/runner/work/systemd/systemd/test/integration-tests/integration-test-wrapper.py", line 677, in main
    runner = os.environ['TEST_RUNNER']
             ~~~~~~~~~~^^^^^^^^^^^^^^^
  File "<frozen os>", line 717, in __getitem__
KeyError: 'TEST_RUNNER'
```

Follow-up for c0a5801f7b.
2025-07-10 07:39:15 +02:00
Yu Watanabe 7425f76c4e shutdown: voidify disable_binfmt() 2025-07-10 14:02:00 +09:00
Yu Watanabe f436c64e61 man: fix typo
Follow-up for 7baf403430.
2025-07-10 14:02:00 +09:00
Yu Watanabe 9a33cbac7d binfmt-util: rename binfmt_mounted() -> binfmt_mounted_and_writable()
As it does not only check if binfmt_misc is mounted, but also check if
it is writable.
2025-07-10 14:02:00 +09:00
Yu Watanabe bd068e2903 binfmt-util: propagate failure in access_fd()
It is not necessary to hide errors in access_fd(), and only acceptable
errors here are -EROFS, -EACCES, and -EPERM.
2025-07-10 14:02:00 +09:00