]> git.ipfire.org Git - thirdparty/systemd.git/log
thirdparty/systemd.git
3 months agocore: Fix scope SIGTERM logging
DaanDeMeyer [Sat, 12 Jul 2025 07:40:22 +0000 (09:40 +0200)] 
core: Fix scope SIGTERM logging

KILL_TERMINATE_AND_LOG doesn't do anything at the moment, let's fix
that.

3 months agocore/scope: drop effectively unused unit_watch_pidref() calls (#38186)
Lennart Poettering [Sat, 12 Jul 2025 05:27:56 +0000 (07:27 +0200)] 
core/scope: drop effectively unused unit_watch_pidref() calls (#38186)

3 months agoupdate TODO
Lennart Poettering [Sat, 12 Jul 2025 05:21:30 +0000 (07:21 +0200)] 
update TODO

3 months agojournal: Fix socket max level initialization
DaanDeMeyer [Fri, 11 Jul 2025 19:31:00 +0000 (21:31 +0200)] 
journal: Fix socket max level initialization

Follow up for df5b3426f60bb626f46f93fbdacecae274c1645b

3 months agounits: check if kmod command exists
Yu Watanabe [Fri, 11 Jul 2025 15:50:02 +0000 (00:50 +0900)] 
units: check if kmod command exists

We already check existences of quotaon in quotaon@.service and
quotacheck in systemd-quotacheck@.service.
Let's also check if kmod command exists.

Closes #38179.

3 months agocore/scope: serialize_item() is NOP on NULL 38186/head
Mike Yuan [Fri, 11 Jul 2025 20:19:14 +0000 (22:19 +0200)] 
core/scope: serialize_item() is NOP on NULL

3 months agocore/scope: drop effectively unused unit_watch_pidref() calls
Mike Yuan [Fri, 11 Jul 2025 19:58:51 +0000 (21:58 +0200)] 
core/scope: drop effectively unused unit_watch_pidref() calls

Follow-up for 495e75ed5c8cce933947dae10a4a1b5f8067e432

The mentioned commit switched scope unit's "pids" deserialization
to call unit_watch_pid() already, meaning all later invocations
in scope_coldplug() are no-op. Remove the cruft altogether.

3 months agounits/machines.target: fix typo
Mike Yuan [Fri, 11 Jul 2025 19:31:24 +0000 (21:31 +0200)] 
units/machines.target: fix typo

Follow-up for 48cb009afc07fbc6634612ff66088a09acd554fc

3 months agoSupport global sysext/confext in systemd-stub/systemd-sysext (#38113)
Lennart Poettering [Fri, 11 Jul 2025 19:10:51 +0000 (21:10 +0200)] 
Support global sysext/confext in systemd-stub/systemd-sysext (#38113)

Systemd-stub supports loading addons, credentials, system and
configuration
extensions from ESP and while addons and credentials can be both global
and
per-UKI, sysext/confext are only per-UKI.

Add support for global sysext/confext to systemd-stub/systemd-sysext.

Fixes #37993

3 months agomachined: make registration of unpriv user's VMs/containers work (#37855)
Lennart Poettering [Fri, 11 Jul 2025 19:10:08 +0000 (21:10 +0200)] 
machined: make registration of unpriv user's VMs/containers work (#37855)

This adds missing glue to reasonably allow unpriv users VMs/containers
to register with the system machined.

This primarily adds two things:

1. machined can now properly track VMs/containers residing in subcgroups
of units, because that's effectively what happens for per-user
VMs/containers: they are placed below the system unit `user@….service`
in some user unit.

2. machines registered with machined now have an owning UID: users can
operate on their own machines withour re-authentication, but not on
others.

Note that this is only a first step regarding machined's hookup of
nspawn/vmspawn in the long run for unpriv operation.

I think eventually we should make it so that there's both a per-user and
a per-system machined instance (so far, and even with this PR there's
still one per-system instance), and per-user containers/VMs would
registering with *both*. Having two instances makes sense I think,
because it would mean we can make machined reasonably manage the
per-user image discovery, and also do the per-system network/hostname
handling.

3 months agoshell-completion: update systemd-run
Eisuke Kawashima [Thu, 10 Jul 2025 13:32:30 +0000 (22:32 +0900)] 
shell-completion: update systemd-run

3 months agoupdate TODO 37855/head
Lennart Poettering [Mon, 16 Jun 2025 10:11:31 +0000 (12:11 +0200)] 
update TODO

3 months agotest: add testcase for unpriv machined nspawns reg + killing
Lennart Poettering [Mon, 30 Jun 2025 21:13:26 +0000 (23:13 +0200)] 
test: add testcase for unpriv machined nspawns reg + killing

Let's add a superficial test for the code we just added: spawn a
container unpriv, make sure registration fully worked, then kill it via
machinectl, to ensure it all works properly.

Not too thorough but a good start.

3 months agounits: systems might take a while to boot
Lennart Poettering [Fri, 13 Jun 2025 16:21:11 +0000 (18:21 +0200)] 
units: systems might take a while to boot

vmspawn systems might take quite a while to boot in particular if they
go through uefi and wait for a network lease. Hence let's increase the
start timeout to 2min (from 45s). We'll do that for both nspawn and
vmspawn, even though the UEFI thing certainly doesn't apply there (but
the DHCP thing still does).

3 months agounits: add units for vmspawn/nspawn in --user mode too
Lennart Poettering [Fri, 23 May 2025 13:41:58 +0000 (15:41 +0200)] 
units: add units for vmspawn/nspawn in --user mode too

3 months agovmspawn: do not set vt220
Lennart Poettering [Fri, 11 Jul 2025 07:05:29 +0000 (09:05 +0200)] 
vmspawn: do not set vt220

We do not let qemu do terminal stuff, hence no point in setting any
TERM.

3 months agovmspawn: introduce --notify-ready= switch
Lennart Poettering [Mon, 16 Jun 2025 08:49:25 +0000 (10:49 +0200)] 
vmspawn: introduce --notify-ready= switch

This mimics the switch of the same name from nspawn: it controls whether
we expect a READY=1 message from the payload or not. Previously we'd
always expect that. This makes it configurable, just like it is in
nspawn.

There's one fundamental difference in behaviour though: in nspawn it
defaults to off, in vmspawn it defaults to on. (for historical reasons,
ideally we'd default to on in both cases, but changing is quite a compat
break both directly and indirectly: since timeouts might get triggered).

3 months agovmspawn: substantially beef up cgroup logic, to match more closely what nspawn does
Lennart Poettering [Fri, 13 Jun 2025 08:29:01 +0000 (10:29 +0200)] 
vmspawn: substantially beef up cgroup logic, to match more closely what nspawn does

This beefs up the cgroup logic, adding --slice=, --property= to vmspawn
the same way it already exists in nspawn.

There are a bunch of differences though: we don't delegate the cgroup
access in the allocated unit (since qemu wouldn't need that), and we do
registration via varlink not dbus. Hence, while this follows a similar
logic now, it differs in a lot of details.

This makes in particular one change: when invoked on the command line
we'll only add the qemu instance to the allocated scope, not the vmspawn
process itself (this follows more closely how nspawn does this where
only the container payload has its scope, not nspawn itself). This is
quite tricky to implement: unlike in nspawn we have auxiliary services
to start, with depencies to the scope. This means we need to start the
scope early, so that we know the scope's name. But the command line to
invoke is only assembled from the data we learn about the auxiliary
services, hence much later. To addres we'll now fork off the child that
eventually will become early, then move it to a scope, prepare the
cmdline and then very late send the cmdline (and the fds we want to
pass) to the prepared child, which then execs it.

3 months agovmspawn: spawn polkit during registration phase
Lennart Poettering [Thu, 12 Jun 2025 09:48:37 +0000 (11:48 +0200)] 
vmspawn: spawn polkit during registration phase

Just like in nspawn, there's a chance we need to PK authenticate the
registration, hence let's spawn off the agent for that during that
phase, and terminate it once we don't need it anymore.

3 months agovmspawn: use VM leader PID not vmspawn PID to register machine
Lennart Poettering [Thu, 15 May 2025 09:00:17 +0000 (11:00 +0200)] 
vmspawn: use VM leader PID not vmspawn PID to register machine

Let's make vmspawn machine registration more like nspawn machine
registration, and register the payload, not vmspawn/nspawn itself.

3 months agonspawn: properly order include of constants.h
Lennart Poettering [Fri, 11 Jul 2025 12:25:40 +0000 (14:25 +0200)] 
nspawn: properly order include of constants.h

3 months agonspawn: tweak logging/notifications when processing exit requests
Lennart Poettering [Wed, 9 Jul 2025 07:36:25 +0000 (09:36 +0200)] 
nspawn: tweak logging/notifications when processing exit requests

3 months agonspawn: slightly beef up READY= logic in nspawn
Lennart Poettering [Mon, 16 Jun 2025 08:46:37 +0000 (10:46 +0200)] 
nspawn: slightly beef up READY= logic in nspawn

Let's also send out a STATUS= message when we get READY=1 if it didn't
come with a STATUS= message itself.

Also, let's initially say the container is "started", and only once the
READY=1 is seen claim it was "running".

3 months agonspawn: reorganize scope allocation/registration logic
Lennart Poettering [Fri, 23 May 2025 20:04:56 +0000 (22:04 +0200)] 
nspawn: reorganize scope allocation/registration logic

This cleans up allocation of a scope unit for the container: when
invoked in user context we'll now allocate a scope through the per-user
service manager instead of the per-system manager. This makes a ton more
sense, since it's the user that invokes things after all. And given that
machined now can register containers in the user manager there's nothing
stopping us to clean this up.

Note that this means we'll connect to two busses if run unpriv: once to
the per-user bus to allocate the scope unit, and once to the per-system
bus to register it with machined.

3 months agomachinectl: output supervisor info in status output
Lennart Poettering [Wed, 2 Jul 2025 11:12:06 +0000 (13:12 +0200)] 
machinectl: output supervisor info in status output

3 months agomachined: add a bit more debug logging
Lennart Poettering [Wed, 9 Jul 2025 07:35:25 +0000 (09:35 +0200)] 
machined: add a bit more debug logging

3 months agomachined: explicitly watch machine cgroup for getting empty
Lennart Poettering [Wed, 9 Jul 2025 07:35:12 +0000 (09:35 +0200)] 
machined: explicitly watch machine cgroup for getting empty

3 months agomachined: also track 'supervisor' process of a machine
Lennart Poettering [Wed, 2 Jul 2025 09:20:23 +0000 (11:20 +0200)] 
machined: also track 'supervisor' process of a machine

So far, machined strictly tracked the "leader" process of a machine,
i.e. the topmost process that is actually the payload of the machine.
Its runtime also defines the runtime of the machine, and we can directly
interact with it if we need to, for example for containers to join the
namespaces, or kill it.

Let's optionally also track the "supervisor" process of a machine, i.e.
the host process that manages the payload if there is one. This is
generally useful info, but in particular is useful because we might need
to communicate with it to shutdown a machine without cooperation of the
payload. Traditionally we did this by simply stopping the unit of the
machine, but this is not doable now that the host machined can be used
to track per-user machines.

In the long run we probably want a more bespoke protocol between
machined and supervisors (so that we can execute other commands too,
such as request cooperative reboots/shutdowns), but that's for later.

Some environments call the concept "monitor" rather than "supervisor" or
use some other term. I stuck to "supervisor" because nspawn uses this,
and ultimately one name is as good as another.

And of course, in other implementations of VM managers of containers
there might not be a single process tracking each VM/container. Because
of this, the concept of a supervisor is optional.

3 months agomachined: use different polkit actions for registering and creating a machine
Lennart Poettering [Fri, 23 May 2025 20:10:36 +0000 (22:10 +0200)] 
machined: use different polkit actions for registering and creating a machine

The difference between these two operations are large: one is relatively
superficial: for "registration" all resources remain associated with the
invoking user, only the cgroup is reported to machined which then keeps
track of the machine, too. OTOH "creation" a scope is allocated in
system context, hence the invoked code will be owned by the system, and
its resource usage charged against the system.

Hence, use two distinct polkit actions for this, so that we can relax
access to registration, but keep access to creation tough.

3 months agomachined: track UID owner of machines
Lennart Poettering [Fri, 23 May 2025 13:30:22 +0000 (15:30 +0200)] 
machined: track UID owner of machines

Now that unpriv clients can register machines, let's register their UID
too. This allows us to do two things:

1. make sure the scope delegation is assigned to the right UID (so that
   the unpriv user can actually create cgroups below the delegated
   scope)

2. permit certain types of access (i.e. killing, or pty access) to the
   client without auth if it owns the machine.

3 months agomachined: optionally track machines in cgroup subgroups
Lennart Poettering [Wed, 21 May 2025 15:23:47 +0000 (17:23 +0200)] 
machined: optionally track machines in cgroup subgroups

3 months agocgroup-util: add cg_path_get_unit_full() helper and related calls
Lennart Poettering [Wed, 21 May 2025 15:21:36 +0000 (17:21 +0200)] 
cgroup-util: add cg_path_get_unit_full() helper and related calls

This helper returns not only the unit a cgroup belongs to, but also the
cgroup sub-path beyond it.

3 months agouki.conf is used by the ukify tool to create an Unified Kernel Image. It
vlefebvre [Fri, 11 Jul 2025 10:17:46 +0000 (12:17 +0200)] 
uki.conf is used by the ukify tool to create an Unified Kernel Image. It
would make sense to install it only if ukify is wanted.

3 months agotest: Fix --capability=CAP_BPF condition
DaanDeMeyer [Fri, 11 Jul 2025 12:58:47 +0000 (14:58 +0200)] 
test: Fix --capability=CAP_BPF condition

We also run in a VM if we're not running as root, yet we weren't
checking this when deciding whether to pass --capability=CAP_BPF or
not. Let's fix that.

Follow up for 9554ac305239c7baea02d112d2da72b7a97fce41

3 months agonetwork: clean up link_may_have_ipv6ll() and allow to run RADV on Tun interface ...
Yu Watanabe [Fri, 11 Jul 2025 14:04:18 +0000 (23:04 +0900)] 
network: clean up link_may_have_ipv6ll() and allow to run RADV on Tun interface (#38175)

Closes #38170.

3 months agotest: drop unnecessary line continuation
Yu Watanabe [Fri, 11 Jul 2025 11:24:57 +0000 (20:24 +0900)] 
test: drop unnecessary line continuation

3 months agoudevadm: fix memleak
Yu Watanabe [Fri, 11 Jul 2025 11:16:02 +0000 (20:16 +0900)] 
udevadm: fix memleak

Fixes a bug in a4a6e216739506153df88cbc8ac078cba4591e5f.

Fixes the following memleak:
```
$ sudo valgrind --leak-check=full build/udevadm cat /usr/lib/udev/rules.d
==3975939==
==3975939== HEAP SUMMARY:
==3975939==     in use at exit: 640 bytes in 1 blocks
==3975939==   total heap usage: 7,657 allocs, 7,656 frees, 964,328 bytes allocated
==3975939==
==3975939== 640 bytes in 1 blocks are definitely lost in loss record 1 of 1
==3975939==    at 0x4841866: malloc (vg_replace_malloc.c:446)
==3975939==    by 0x4ACA71F: malloc_multiply (alloc-util.h:92)
==3975939==    by 0x4ACF988: _hashmap_dump_entries_sorted (hashmap.c:2167)
==3975939==    by 0x4ACFC76: _hashmap_dump_sorted (hashmap.c:2209)
==3975939==    by 0x4AA60A4: hashmap_dump_sorted (hashmap.h:311)
==3975939==    by 0x4AA9077: dump_files (conf-files.c:397)
==3975939==    by 0x4AAA14E: conf_files_list_strv_full (conf-files.c:596)
==3975939==    by 0x42426A: search_rules_file (udevadm-util.c:301)
==3975939==    by 0x424768: search_rules_files (udevadm-util.c:334)
==3975939==    by 0x41287D: cat_main (udevadm-cat.c:110)
==3975939==    by 0x4A7B911: dispatch_verb (verbs.c:139)
==3975939==    by 0x427272: udevadm_main (udevadm.c:121)
==3975939==
==3975939== LEAK SUMMARY:
==3975939==    definitely lost: 640 bytes in 1 blocks
==3975939==    indirectly lost: 0 bytes in 0 blocks
==3975939==      possibly lost: 0 bytes in 0 blocks
==3975939==    still reachable: 0 bytes in 0 blocks
==3975939==         suppressed: 0 bytes in 0 blocks
==3975939==
==3975939== For lists of detected and suppressed errors, rerun with: -s
==3975939== ERROR SUMMARY: 1 errors from 1 contexts (suppressed: 0 from 0)
```

3 months agoman: fix version info tag
Yu Watanabe [Fri, 11 Jul 2025 11:57:20 +0000 (20:57 +0900)] 
man: fix version info tag

Follow-up for 63770fa1d3eb0c8a367d0ffab73772e3c96a509f.

3 months agonetwork/radv: allow to send Router Advertisement from e.g. Tun interface 38175/head
Yu Watanabe [Fri, 11 Jul 2025 11:30:34 +0000 (20:30 +0900)] 
network/radv: allow to send Router Advertisement from e.g. Tun interface

Sending router advertisement requires an IPv6LL address and
IFF_MULTICAST flag. The length of the hardware address is irrelevant.

Closes #38170.

3 months agonetwork: split link_may_have_ipv6ll() into two
Yu Watanabe [Fri, 11 Jul 2025 11:48:51 +0000 (20:48 +0900)] 
network: split link_may_have_ipv6ll() into two

This renames and splits link_may_have_ipv6ll() into
link_ipv6ll_enabled_harder() and link_multicast_enabled(),
as they are completely irrelevant to each other.

Also, this makes link_ipv6ll_enabled_harder() work non-Wireguard
interfaces.

3 months agoInclude more headers explicitly (#38169)
Yu Watanabe [Fri, 11 Jul 2025 11:21:33 +0000 (20:21 +0900)] 
Include more headers explicitly (#38169)

Similar to the recent change like
4f18ff2e29b8054f30b084abcabf5f689f4b340b.

3 months agosysext: Support global sysext/confext 38113/head
Vitaly Kuznetsov [Mon, 7 Jul 2025 13:03:55 +0000 (15:03 +0200)] 
sysext: Support global sysext/confext

Load global sysext/confext from /.extra/global_{sysext,confext} which
systemd-stub puts there from ESP/loader/credentials/*.{sysext,confext}.raw.
Global extensions are handled the exact same way as per-UKI ones.

3 months agostub: Support global sysext/confext
Vitaly Kuznetsov [Mon, 7 Jul 2025 12:25:29 +0000 (14:25 +0200)] 
stub: Support global sysext/confext

Systemd-stub support loading addons, credentials, system and configuration
extensions from ESP and while addons and credentials can be both global and
per-UKI, sysext/confext are only per-UKI.

Add support for loading ESP/loader/credentials/*.{sysext,confext}.raw to
systemd-stub.

Note: for backwards compatibility reasons, per-UKI sysexts can also be
*.raw (not only *.sysext.raw) but as global extensions are new, there's
no need to bring this legacy there.

3 months agodetect-virt: add bare-metal support for GCE
vlefebvre [Tue, 8 Jul 2025 15:46:10 +0000 (15:46 +0000)] 
detect-virt: add bare-metal support for GCE

Google Compute Engine are not only virtual but can be also physical
machines. Therefore checking only the dmi is not enough to detect if it
is a virtual machine. Therefore systemd-detect-virt return "google"
instead of "none" in c3-highcpu-metal machine.
SMBIOS will not help us to make the difference as for EC2 machines.
However, GCE use KVM hypervisor for these VM, we can use this
information to detect virtualization. [0]

Issue and changes has been tested on SUSE SLE-15-SP7 images with
systemd-254 for both GCE, bare-metal and VM.

[0] -
https://cloud.google.com/blog/products/gcp/7-ways-we-harden-our-kvm-hypervisor-at-google-cloud-security-in-plaintext

3 months agokernel-install: several follow-ups for --entry-type= (#38160)
Yu Watanabe [Fri, 11 Jul 2025 11:07:19 +0000 (20:07 +0900)] 
kernel-install: several follow-ups for --entry-type= (#38160)

Follow-ups for b6d499768394297b1d313cdc72dab0720dc315f6 (#37897).

3 months agosystemd-run: add --no-pager, use pager for --help
Zbigniew Jędrzejewski-Szmek [Thu, 10 Jul 2025 09:30:01 +0000 (11:30 +0200)] 
systemd-run: add --no-pager, use pager for --help

3 months agoNEWS: clean up uses of backticks
Zbigniew Jędrzejewski-Szmek [Fri, 11 Jul 2025 09:54:35 +0000 (11:54 +0200)] 
NEWS: clean up uses of backticks

Backticks are good in markdown files, where they signify text to be rendered
with a mono-space font. But our text files doesn't use markdown, and backticks
are just a particularly bad type of quote (ugly, assymetrical, with a special
significance in shell context). Update older NEWS entries to not use them.

3 months agoNEWS: adjust whitespace and texts for v258
Zbigniew Jędrzejewski-Szmek [Fri, 11 Jul 2025 09:47:44 +0000 (11:47 +0200)] 
NEWS: adjust whitespace and texts for v258

3 months agomkosi: Two fixlets for CentOS (#38165)
Yu Watanabe [Fri, 11 Jul 2025 09:35:44 +0000 (18:35 +0900)] 
mkosi: Two fixlets for CentOS (#38165)

3 months agobasic: rename cap-list.c -> capability-list.c
Yu Watanabe [Fri, 11 Jul 2025 07:42:39 +0000 (16:42 +0900)] 
basic: rename cap-list.c -> capability-list.c

This also renames relevant files in the same way.

Addresses https://github.com/systemd/systemd/pull/37904#discussion_r2191950396

3 months agoman/kernel-install: mention --entry-type= option in the man page 38160/head
Yu Watanabe [Fri, 11 Jul 2025 02:33:06 +0000 (11:33 +0900)] 
man/kernel-install: mention --entry-type= option in the man page

Follow-up for b6d499768394297b1d313cdc72dab0720dc315f6.

3 months agokernel-install: regroup options in help meesage
Yu Watanabe [Fri, 11 Jul 2025 02:18:09 +0000 (11:18 +0900)] 
kernel-install: regroup options in help meesage

And slightly updates the description.

Follow-up for b6d499768394297b1d313cdc72dab0720dc315f6.

3 months agokernel-install: do not mix || and &&
Yu Watanabe [Fri, 11 Jul 2025 02:10:00 +0000 (11:10 +0900)] 
kernel-install: do not mix || and &&

This also slightly updates log message, and make it shown only when
verbose mode is enabled.

Follow-up for b6d499768394297b1d313cdc72dab0720dc315f6.

3 months agotree-wide: include asm/sgidefs.h to make _MIPS_SIM_ABI32 and friends defined 38169/head
Yu Watanabe [Fri, 11 Jul 2025 08:23:36 +0000 (17:23 +0900)] 
tree-wide: include asm/sgidefs.h to make _MIPS_SIM_ABI32 and friends defined

The header provides _MIPS_SIM_ABI32 and friends. Glibc indirectly includes
the header through sys/syscall.h or unistd.h, but let's explicitly include
the header where we use _MIPS_SIM_ABI32 and friends.

3 months agoquota-util: explicitly include linux/quota.h
Yu Watanabe [Fri, 11 Jul 2025 08:17:43 +0000 (17:17 +0900)] 
quota-util: explicitly include linux/quota.h

The header linux/quota.h provides e.g. QIF_DQBLKSIZE or PRJQUOTA, which
is used where the quota-util.h is included.
Let's explicitly include the header with 'IWYU pragma: export' tag.

3 months agosd-device: trivial cleanups (#38162)
Zbigniew Jędrzejewski-Szmek [Fri, 11 Jul 2025 08:07:30 +0000 (10:07 +0200)] 
sd-device: trivial cleanups (#38162)

3 months agomkosi: Fix installation conditions for rpmautospec-rpm-macros 38165/head
DaanDeMeyer [Fri, 11 Jul 2025 07:48:29 +0000 (09:48 +0200)] 
mkosi: Fix installation conditions for rpmautospec-rpm-macros

rpmautospec-rpm-macros is only in EPEL 9 so let's gate it properly
on that by splitting up the epel packages config file into two.

erofs-utils is in EPEL 9 and in CentOS Stream 10.

3 months agopidref: add pidref_set_pid_and_pidfd_id()
Lennart Poettering [Wed, 2 Jul 2025 09:12:23 +0000 (11:12 +0200)] 
pidref: add pidref_set_pid_and_pidfd_id()

This new helper takes both a PID and and a pidfd ID, and initializes a
PidRef from it. It ensures they actually belong together and returns an
error if not.

3 months agoSeveral follow-ups for recent SELinux changes (#38161)
Daan De Meyer [Fri, 11 Jul 2025 07:01:00 +0000 (09:01 +0200)] 
Several follow-ups for recent SELinux changes (#38161)

3 months agonetwork/bridge-vlan: allow to configure bridge vlan on stacked bridge master interface
Yu Watanabe [Fri, 11 Jul 2025 03:58:33 +0000 (12:58 +0900)] 
network/bridge-vlan: allow to configure bridge vlan on stacked bridge master interface

Fixes #38157.

3 months agomkosi: Drop epel-next repository for CentOS
DaanDeMeyer [Fri, 11 Jul 2025 06:54:40 +0000 (08:54 +0200)] 
mkosi: Drop epel-next repository for CentOS

It does not exist for CentOS Stream 10, it's only relevant for CentOS
Stream 9 in some corner cases which don't apply to us, so let's not enable
it to avoid complexity instead of only enabling it for CentOS Stream 9.

Follow up for 3800adc9e5e067e3869d95c75733368e11f4570a

3 months agoCleanups for missing_xyz.h headers (#37904)
Yu Watanabe [Fri, 11 Jul 2025 06:20:10 +0000 (15:20 +0900)] 
Cleanups for missing_xyz.h headers (#37904)

Continuation of #37960.

The same concern as expalined in #37960 exists also in
missing_syscall.h. If we use enough new glibc, a function we want to use
may be already provided by glibc, but our baseline glibc may not. And it
is hard to detect in our daily development.

This moves all prototypes of syscalls to relevant headers, and missing
syscall functions are defined in relevant .c files of libc wrapper. This
way, we can use usual header as is, e.g. when we want to write code with
`move_mount()`, we can simply use sys/mount.h without checking if it is
supported by our baseline glibc.

3 months agojournal: fix typo
Yu Watanabe [Fri, 11 Jul 2025 05:12:16 +0000 (14:12 +0900)] 
journal: fix typo

Follow-up for df5b3426f60bb626f46f93fbdacecae274c1645b.

3 months agoman: fix typo
Yu Watanabe [Fri, 11 Jul 2025 05:11:01 +0000 (14:11 +0900)] 
man: fix typo

Follow-up for 7aefb194e754cae9c166539a103e9fd6b7e59798.

3 months agoconf-files: make conf-file enumerators provide more detailed information of enumerate...
Yu Watanabe [Fri, 11 Jul 2025 04:50:47 +0000 (13:50 +0900)] 
conf-files: make conf-file enumerators provide more detailed information of enumerated files (#38006)

This introduces `struct ConfFile` that stores detailed information of an
enumerated file, and introduces `conf_files_list_full()` and friends
that provide results in `ConfFile`.
Then make udev, hwdb, catalog, and cat-files use the new function and
struct to make them not read files outside of specified root directory.

3 months agoraw-clone: move definition to .c file 37904/head
Yu Watanabe [Thu, 19 Jun 2025 19:31:08 +0000 (04:31 +0900)] 
raw-clone: move definition to .c file

Then, we can decrease the number of headers to be indirectly included
by including raw-clone.h. No functional change.

3 months agoreboot-util: merge with raw-reboot.h
Yu Watanabe [Thu, 19 Jun 2025 19:18:00 +0000 (04:18 +0900)] 
reboot-util: merge with raw-reboot.h

The header raw-reboot.h is only used with reboot-util. Let's merge them.

3 months agodocs: mention src/include/ directories
Yu Watanabe [Tue, 8 Jul 2025 04:52:03 +0000 (13:52 +0900)] 
docs: mention src/include/ directories

3 months agoinclude: use unit8_t for uuid
Yu Watanabe [Tue, 8 Jul 2025 05:30:07 +0000 (14:30 +0900)] 
include: use unit8_t for uuid

To emphasize it is an array of bytes.
This also align variables.
No functional changes. Just refactoring.

3 months agoinclude: move trivial kernel header wrappers to src/include/override/
Yu Watanabe [Sun, 6 Jul 2025 05:52:23 +0000 (14:52 +0900)] 
include: move trivial kernel header wrappers to src/include/override/

3 months agolibc-wrapper: introduce a tiny libc wrapper
Yu Watanabe [Sat, 21 Jun 2025 11:29:51 +0000 (20:29 +0900)] 
libc-wrapper: introduce a tiny libc wrapper

Then, move syscall definitions to the wrapper, and prototypes are moved
to relevant headers.

This also adds checks for add_key() and request_key(), as one day
glibc may be going to add some of them separatedly.

The check for fspick in meson.build is dropped, as it is currently
unused in our code.

This also moves
- basic/missing_bpf.h -> include/override/linux/bpf.h,
- basic/missing_keyctl.h -> include/override/linux/keyctl.h.

3 months agobasic: move basic/missing_syscall_defs.h -> include/override/sys/syscall.h
Yu Watanabe [Wed, 18 Jun 2025 23:35:35 +0000 (08:35 +0900)] 
basic: move basic/missing_syscall_defs.h -> include/override/sys/syscall.h

This also moves syscall tables and generators to the same directory.

Note, inclusion of asm/sgidefs.h is dropped, as it is already included
by unistd.h and sys/syscall.h.

3 months agotree-wide: several cleanups for generating symbol lists and gperf files
Yu Watanabe [Tue, 8 Jul 2025 04:07:32 +0000 (13:07 +0900)] 
tree-wide: several cleanups for generating symbol lists and gperf files

- pass our system include directories to make generators use our libc
  wrappers and latest kernel headers,
- include relevant headers in generated gperf file,
- use files() rather than find_program(), as the result of
  find_program() cannot be passed to 'input' of custom_target(),
- move generate-bpf-delegate-configs.py to src/core/, as it is only used
  by libcore.

3 months agoinclude: move libc header wrappers to src/include/override/, and kernel headers to...
Yu Watanabe [Sun, 6 Jul 2025 03:19:26 +0000 (12:19 +0900)] 
include: move libc header wrappers to src/include/override/, and kernel headers to src/include/uapi/

Preparation for later changes.

3 months agomkosi: various improvements (#38156)
Yu Watanabe [Fri, 11 Jul 2025 03:40:22 +0000 (12:40 +0900)] 
mkosi: various improvements (#38156)

3 months agosd-device: replace 'type *func()' -> 'type* func()' 38162/head
Yu Watanabe [Fri, 11 Jul 2025 03:12:01 +0000 (12:12 +0900)] 
sd-device: replace 'type *func()' -> 'type* func()'

3 months agosd-device: do not set errno needlessly
Yu Watanabe [Fri, 11 Jul 2025 03:04:28 +0000 (12:04 +0900)] 
sd-device: do not set errno needlessly

3 months agocore/selinux-access: insert an empty line after function arguments 38161/head
Yu Watanabe [Fri, 11 Jul 2025 02:51:54 +0000 (11:51 +0900)] 
core/selinux-access: insert an empty line after function arguments

Follow-ups for fe3f2ac0734e64dcd729b00992a6261cbf4cc846 and
e3fef210c8903a9a3871ea5ba9b558b6cdbabea3.

3 months agoselinux-util: downgrade log level to LOG_DEBUG when error code is zero
Yu Watanabe [Fri, 11 Jul 2025 02:46:08 +0000 (11:46 +0900)] 
selinux-util: downgrade log level to LOG_DEBUG when error code is zero

Previously, the logger is only used in error paths, but since
fe3f2ac0734e64dcd729b00992a6261cbf4cc846, the logger is also used in a
success path. Let's not log loudly on success.

This also drops unused log_selinux_enforcing().

3 months agocatalog: do not read catalog files outside of specified root directory 38006/head
Yu Watanabe [Tue, 1 Jul 2025 02:33:22 +0000 (11:33 +0900)] 
catalog: do not read catalog files outside of specified root directory

3 months agohwdb-util: do not read hwdb files outside of specified root directory
Yu Watanabe [Tue, 1 Jul 2025 02:21:09 +0000 (11:21 +0900)] 
hwdb-util: do not read hwdb files outside of specified root directory

3 months agohwdb-util: coding style update
Yu Watanabe [Tue, 1 Jul 2025 02:12:59 +0000 (11:12 +0900)] 
hwdb-util: coding style update

- use 'r' for storing results,
- use RET_GATHER().

3 months agoudev-rules: do not read udev rules files outside of specified root directory
Yu Watanabe [Tue, 1 Jul 2025 02:05:18 +0000 (11:05 +0900)] 
udev-rules: do not read udev rules files outside of specified root directory

3 months agoTEST-17-UDEV: conditionalize test cases for testuser
Yu Watanabe [Fri, 4 Jul 2025 07:54:49 +0000 (16:54 +0900)] 
TEST-17-UDEV: conditionalize test cases for testuser

Then, we can also run the test script in our local machine.

3 months agoudevadm: do not read udev rules files outside of the specified root directory
Yu Watanabe [Mon, 30 Jun 2025 19:46:41 +0000 (04:46 +0900)] 
udevadm: do not read udev rules files outside of the specified root directory

With this change, an invalid symlink and an empty file is silently
ignored. Hence, the test code is slightly updated.

3 months agopretty-print: make conf_files_cat() not show files outside of the specified root.
Yu Watanabe [Sun, 29 Jun 2025 20:22:53 +0000 (05:22 +0900)] 
pretty-print: make conf_files_cat() not show files outside of the specified root.

Then, make the function show the original and resolved path if they are
different.

With this change, procfs needs to be mounted on /proc/, hence the test
code is slightly updated.

3 months agopretty-print: several cleanups for cat_files()
Yu Watanabe [Sun, 29 Jun 2025 20:18:32 +0000 (05:18 +0900)] 
pretty-print: several cleanups for cat_files()

- drop redundant error messages in cat_files(), as cat_file() internally
  logs errors,
- show an empty line and filename before opening file, to make not mix
  any error messages with the previous file,
- drop unnecessary fflush(),
- use RET_GATHER() and continue to show files even if some files cannot
  be shown.

3 months agoconf-files: introduce conf_files_list_full() and friends that provides results in...
Yu Watanabe [Sun, 29 Jun 2025 02:01:52 +0000 (11:01 +0900)] 
conf-files: introduce conf_files_list_full() and friends that provides results in ConfFile

3 months agoconf-files: make conf_files_list() and friends internally use struct ConfFile
Yu Watanabe [Tue, 1 Jul 2025 01:33:54 +0000 (10:33 +0900)] 
conf-files: make conf_files_list() and friends internally use struct ConfFile

No functional change, just refactoring.

3 months agoconf-files: introduce struct ConfFile to store information of found conf file
Yu Watanabe [Sun, 29 Jun 2025 01:12:09 +0000 (10:12 +0900)] 
conf-files: introduce struct ConfFile to store information of found conf file

It is currently unused, will be used later. Preparation for later changes.

3 months agochase: allow to request O_PATH fd even with CHASE_NONEXISTENT
Yu Watanabe [Mon, 30 Jun 2025 06:18:47 +0000 (15:18 +0900)] 
chase: allow to request O_PATH fd even with CHASE_NONEXISTENT

3 months agotest-cgroup: Ignore ENOENT from cg_create(); test-cgroup-util: Ignore ENXIO in one...
Yu Watanabe [Fri, 11 Jul 2025 01:38:04 +0000 (10:38 +0900)] 
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`.

3 months agojournalctl: do not fail on SIGTERM/SIGINT or STDOUT disconnect when running with...
Yu Watanabe [Fri, 11 Jul 2025 01:36:31 +0000 (10:36 +0900)] 
journalctl: do not fail on SIGTERM/SIGINT or STDOUT disconnect when running with --follow (#38116)

Closes #38114.

3 months agoio.systemd.Manager.Describe fix context/runtime split (#38135)
Yu Watanabe [Fri, 11 Jul 2025 01:26:57 +0000 (10:26 +0900)] 
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.

3 months agoPlumbing to perform SELinux checks in varlink API (#38146)
Yu Watanabe [Fri, 11 Jul 2025 01:20:36 +0000 (10:20 +0900)] 
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

3 months agotest-cgroup-util: Ignore ENXIO in one more place 38158/head
Solar Designer [Thu, 10 Jul 2025 23:46:38 +0000 (01:46 +0200)] 
test-cgroup-util: Ignore ENXIO in one more place

3 months agoNEWS: mention about the exit code change in journalctl --follow 38116/head
Yu Watanabe [Tue, 8 Jul 2025 09:42:02 +0000 (18:42 +0900)] 
NEWS: mention about the exit code change in journalctl --follow

3 months agotest: drop unnecessary disablement of pipefail
Yu Watanabe [Tue, 8 Jul 2025 09:36:09 +0000 (18:36 +0900)] 
test: drop unnecessary disablement of pipefail

3 months agomain-func: drop unused DEFINE_MAIN_FUNCTION_WITH_POSITIVE_SIGNAL()
Yu Watanabe [Tue, 8 Jul 2025 09:30:48 +0000 (18:30 +0900)] 
main-func: drop unused DEFINE_MAIN_FUNCTION_WITH_POSITIVE_SIGNAL()

3 months agojournalctl: do not fail on SIGTERM/SIGINT, or when STDOUT is disconnected
Yu Watanabe [Tue, 8 Jul 2025 09:19:05 +0000 (18:19 +0900)] 
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.