Commit Graph
80971 Commits
Author SHA1 Message Date
Daan De Meyer c0ced8fc32 Remove more circular header dependencies (#37185)
Continuation of https://github.com/systemd/systemd/pull/37112
2025-04-23 11:24:02 +02:00
Daan De Meyer 401a22bfc1 tree-wide: Make sure all headers are standalone
Let's make sure all of our headers include everything they require.
2025-04-23 10:33:38 +02:00
Daan De Meyer 44de729cdc basic: Use _Static_assert() in missing_audit.h instead of assert_cc()
We want to make the header standalone so it includes all the stuff it
needs. However, including macro.h for assert_cc() doesn't work because
of generate-audit_type-list.sh which would have to become more complex
to handle the extra include directories.

Instead, let's just use _Static_assert() directly which is a builtin and
doesn't need any extra includes.
2025-04-23 10:33:37 +02:00
Daan De Meyer f82e233128 timesync: Remove circular header dependencies 2025-04-23 10:33:37 +02:00
Daan De Meyer cf108818b3 sysupdate: Remove circular header includes 2025-04-23 10:33:37 +02:00
Daan De Meyer 68527d3051 resolved: Remove circular header dependencies 2025-04-23 10:33:37 +02:00
Daan De Meyer 834dc38310 resolve: Move implementations of some functions to resolved-dns-packet.c
These depend on a full definition of DnsResourceRecord which we want
to forward declare in the next commit, so let's move the implementation
of these functions to the implementation file and make them lowercase.
2025-04-23 10:33:37 +02:00
Daan De Meyer 6f502df478 resolve: Move two functions from resolved-conf.h to resolved-dns-server.h
Preparation for getting rid of circular header dependencies.
2025-04-23 10:33:37 +02:00
Daan De Meyer 1fe208e60a portable: Remove circular header dependencies 2025-04-23 10:33:37 +02:00
Daan De Meyer 5d5eb76557 network: Remove circular header dependencies in network/netdev 2025-04-23 10:33:37 +02:00
Daan De Meyer 72673948f3 network: Remove circular header dependencies in network/tc
Include the headers in the implementation file (and the gperf file)
instead of in the qdisc.h header. I opted to keep them separate from
the other headers since they're slightly different than regular headers.
2025-04-23 10:33:37 +02:00
Daan De Meyer 02d83a8a1e network: Move networkd-manager.h include to implementation file 2025-04-23 10:33:37 +02:00
Daan De Meyer ff43267ce7 machine: Remove circular header dependencies 2025-04-23 10:33:37 +02:00
Daan De Meyer 214c93c84c login: Remove circular header dependencies 2025-04-23 10:33:37 +02:00
Daan De Meyer d88dc9a5dd journal: Remove circular header dependencies 2025-04-23 10:33:37 +02:00
Daan De Meyer f31e462ba7 import: Remove circular header dependencies 2025-04-23 10:33:37 +02:00
Daan De Meyer 52ee9ba13d home: Remove circular header dependencies 2025-04-23 10:33:37 +02:00
Daan De Meyer 4ea4abb651 core: Remove circular dependencies between headers
Currently there are various circular dependencies between headers
in core/. Let's get rid of these by making judicious use of forward
declarations and moving includes into implementation files instead of
having them in header files.

Getting rid of circular header includes simplifies the code and makes
various clang based tooling such as iwyu work much better on our code.

The most important change is getting rid of the manager.h include in
unit.h which is possible thanks to the previous commits. We also move
the OOMPolicy and StatusType enums to unit.h to remove the need for
other unit headers to include manager.h to get access to these enums.
2025-04-23 10:33:35 +02:00
Daan De Meyer 64fd6ba9ca core: Turn manager unit log fields into unit functions
There's no need for these to be fields inside the manager struct,
let's turn them into functions in unit.h instead, again to allow
forward declaring the Manager struct in a later commit.
2025-04-23 09:53:53 +02:00
Daan De Meyer 8aa304d313 shared: Remove circular dependency between image-policy.h and dissect-image.h
ImagePolicy can just be a forward declaration in dissect-image.h.
2025-04-23 09:53:43 +02:00
Daan De Meyer 36642d0304 sd-bus: Get rid of circular dependency between sd-bus.h and sd-bus-vtable.h
Let's move more types to sd-bus-protocol.h so we can get rid of the
circular include between sd-bus-vtable.h and sd-bus.h.
2025-04-23 09:53:28 +02:00
Yu Watanabe b7591658f0 man,network: fix typo
Follow-up for a06e884264.
2025-04-23 13:42:12 +09:00
Mike Yuan 9af70339aa core/manager: assume availability of all RT signals
Our kernel baseline is v5.4 now.
2025-04-23 10:04:04 +09:00
Yu Watanabe cda045882e network: enable ARP when IPv4LL and/or IPv4ACD is enabled (#37190) 2025-04-23 08:53:49 +09:00
Yu Watanabe 1393c5a2a4 sd-device: fix sysname check in sd_device_new_from_subsystem_sysname()
For example, consider the following device:
- syspath: /sys/bus/mdio_bus/drivers/Qualcomm Atheros AR8031!AR8033
- subsystem: "drivers"
- driver subsystem: "mdio_bus"
- sysname: "Qualcomm Atheros AR8031/AR8033"  <-- '!' is replaced with '/'

When sd_device_new_from_subsystem_sysname() is called to get the device,
the arguments to sd_device_new_from_subsystem_sysname() should be
- subsystem: "drivers"
- sysname (concatenated with driver subsystem): "mdio_bus:Qualcomm Atheros AR8031/AR8033"

In that case, we need to pass to device_new_from_path_join() the following:
- subsystem: "drivers"
- driver subsystem: "mdio_bus"
- sysname: "Qualcomm Atheros AR8031/AR8033"
- a: "/sys/bus"
- b: "drivers"
- c: "mdio_bus"
- d: "Qualcomm Atheros AR8031!AR8033"
Here, the important point is that the `sysname` argument and the
last argument `d` are differnt: the `sysname` argument needs to match
the sysname obtained by `sd_device_get_sysname()`, but `d` must be
the last path component of the syspath.

Previously, we passed a wrong sysname to device_new_from_path_join().
This fixes the issue.

Fixes a bug in cd7c71154c (v257).
2025-04-23 08:52:29 +09:00
Yu Watanabe f35a48bd57 mkosi: Add extra packages to the tools tree (#37218) 2025-04-23 08:51:44 +09:00
Lennart Poettering 4b325eca60 core: add concurrency limits to slice units (#36831)
I needed something to hack on "offline", during a long transatlantic
flight. I decided to implement #35862, since I could do that without
checking any online docs nor needing GitHub.
2025-04-22 20:44:04 +02:00
Lennart Poettering 5d919d8785 update TODO 2025-04-22 18:56:01 +02:00
Lennart Poettering edca63a632 test: add integration test for concurrency limits 2025-04-22 18:56:01 +02:00
Lennart Poettering 9ca16f6f18 pid1: add a concurrency limit to slice units
Fixes: #35862
2025-04-22 18:53:51 +02:00
Lennart Poettering 80653ba925 man: explain coredump handling in context of containers better
We have two different mechanisms, let's discuss them explicitly,
comparing their effect and intended usecase.
2025-04-22 11:46:44 +02:00
Daan De Meyer 505492d61c udev: serialize queued events on exit (#37047)
Previously, all queued events were discarded on exit, hence several
events might not be processed by udevd when it is restarted. Such
situation especially easily happens on switching root.

This makes queued events serialized on exit, and deserialized in the
next invocation. Hence, no events should be lost during restarting
udevd.

This is important with the several aspects. Basically
systemd-udev-trigger.service (re)triggers all devices anyway after
switching root, But the service may be disabled or modified by admin.
Moreover, the service produces only 'add' events, and thus the service
cannot cover events with other actions generated by the kernel during
switching root. Also, the userspace triggered events may not contain
some parameters compared with events triggered by the kernel.
2025-04-22 10:54:25 +02:00
Daan De Meyer 97d5cf46d8 Several preparation for killing SysV compat (#37207) 2025-04-22 10:13:44 +02:00
Yu Watanabe 87541e254f meson: use deprecated tag for dns-over-tls and cryptolib meson options
Follow-up for #36937.
2025-04-22 10:10:53 +02:00
Yu Watanabe b4d5115264 test-specifier: replace /dev/initctl with /dev/fd
To make the test work even when systemd is built without SysV compat.
2025-04-22 10:24:42 +09:00
Yu Watanabe 33f90ddefd test: drop nonexistent units from test-unit-name
The test does not request each unit file exists, but keeping legacy unit
names in test sounds spurious. Let's remove them. Hopefully we still
have enough test cases.
2025-04-22 10:24:42 +09:00
Yu Watanabe 97b2e136eb man/systemd: drop explanation about SysV compatibilities
Sooner or later, we will drop the explained SysV compatibilities.
Let's remove them from the man page now to make not people rely on that.
2025-04-22 10:24:42 +09:00
Yu Watanabe 70fd998c40 man/systemd: fix mapping from SysV runlevel to actual target name
See runlevel_to_target() in src/shared/unit-file.c.
2025-04-22 10:24:42 +09:00
Yu Watanabe ca7c4d4d89 unit-file: use STRV_FOREACH_PAIR() macro at one more place 2025-04-22 10:24:42 +09:00
Yu Watanabe f7586abfe0 man/systemctl: list-sockets command sorts the result
This updates the example output of list-sockets command.
2025-04-22 10:24:42 +09:00
Yu Watanabe efe0fe43a8 core: kill StartAuxiliaryScope() DBus method (#37184)
This removes StartAuxiliaryScope() DBus method as already planned and
announced.
This effectively reverts #28836.
2025-04-22 10:18:06 +09:00
Yu Watanabe a0e078e785 NEWS: mention org.freedesktop.systemd1.StartAuxiliaryScope() has been removed 2025-04-22 09:02:48 +09:00
Yu Watanabe 8c35e8a9d2 core: remove deprecated StartAuxiliaryScope() DBus method
The method is deprecated since 64f173324e
(v257) and announced that it will be removed in v258.
Let's remove it now.

This effectively reverts 84c01612de.
2025-04-22 09:02:45 +09:00
Yu Watanabe acd65ba1cd Revert "tests: add test for StartAuxiliaryScope()"
This reverts commit fd7fd59b6d.

The DBus method StartAuxiliaryScope() will be removed in the next
commit.
2025-04-22 09:00:19 +09:00
Yu Watanabe f62465b870 cgroup-util: drop cg_freezer_supported() and cg_ns_supported() (#37201) 2025-04-22 08:58:52 +09:00
Mike Yuan 239afa5971 core/cgroup: actually apply BPF everywhere
Follow-up for f1c5534eb6

The previous logic was an OR, i.e. as long as we're running
in unified mode BPF is applied. The offending commit
spuriously excluded local root.

While at it, remove check for cgv1 CGROUP_MASK_DEVICES controller.
2025-04-22 08:45:39 +09:00
Mike Yuan 497e607ca0 cgroup-util: drop now unused cg_ns_supported() 2025-04-21 16:54:37 +02:00
Mike Yuan e857964b0f nspawn: use namespace_type_supported() 2025-04-21 16:54:37 +02:00
Mike Yuan 418082596c namespace-util: generalize namespace_type_supported() 2025-04-21 16:54:37 +02:00
Mike Yuan 3c86a935ad cgroup-util: drop cg_freezer_supported(), assume supported 2025-04-21 16:29:40 +02:00