]> git.ipfire.org Git - thirdparty/systemd.git/log
thirdparty/systemd.git
13 days agodhcp-packet: drop unused dhcp_packet_verify_headers() 42128/head
Yu Watanabe [Wed, 1 Apr 2026 19:20:59 +0000 (04:20 +0900)] 
dhcp-packet: drop unused dhcp_packet_verify_headers()

13 days agosd-dhcp-lease: drop several more unused functions and conditions
Yu Watanabe [Wed, 1 Apr 2026 14:44:39 +0000 (23:44 +0900)] 
sd-dhcp-lease: drop several more unused functions and conditions

13 days agosd-dhcp-lease: drop unused dhcp_lease_save() and dhcp_lease_load()
Yu Watanabe [Wed, 1 Apr 2026 14:40:16 +0000 (23:40 +0900)] 
sd-dhcp-lease: drop unused dhcp_lease_save() and dhcp_lease_load()

They are not used anymore. Let's kill them.

13 days agonetwork: drop serialization of DHCP lease
Yu Watanabe [Wed, 1 Apr 2026 14:36:30 +0000 (23:36 +0900)] 
network: drop serialization of DHCP lease

No one use it now anymore. Let's drop it.

13 days agonetworkctl: always use DHCP message serialized in JSON desciption
Yu Watanabe [Wed, 1 Apr 2026 14:34:19 +0000 (23:34 +0900)] 
networkctl: always use DHCP message serialized in JSON desciption

Now the interface description by networkd always contains DHCP message
(of course when there is a bound DHCP lease). Let's use it.

13 days agonetwork: drop unmet conditions
Yu Watanabe [Wed, 1 Apr 2026 14:32:41 +0000 (23:32 +0900)] 
network: drop unmet conditions

Now sd_dhcp_lease object always wraps sd_dhcp_message object, hence we
can unconditionally use it.

13 days agosd-dhcp-client: use new message parser (#42123)
Yu Watanabe [Sat, 16 May 2026 15:33:43 +0000 (00:33 +0900)] 
sd-dhcp-client: use new message parser (#42123)

In 26b7c5ff3b944aa3a16d4e859e9c84ce7e968a5a, we introduced a new parser
for received DHCP message, but it was not used at that time. This PR
replaces the legacy parser with the new one, and makes the fuzzer also
use the new parser.

13 days agoConvert machinectl to option and verb macros (#42117)
Zbigniew Jędrzejewski-Szmek [Sat, 16 May 2026 15:18:10 +0000 (17:18 +0200)] 
Convert machinectl to option and verb macros (#42117)

13 days agomachinectl: convert to OPTION and VERB macros 42117/head
Zbigniew Jędrzejewski-Szmek [Fri, 15 May 2026 17:19:15 +0000 (19:19 +0200)] 
machinectl: convert to OPTION and VERB macros

For the shell verb we want switches specified after the program name to
be passed to the program to execute, not processed by us. Mirror the
approach in 'userdbctl ssh-authorized-keys': start with
OPTION_PARSER_RETURN_POSITIONAL_ARGS, then lates switch to
STOP_AT_FIRST_NONOPTION for "shell" or NORMAL otherwise.

VERB declarations are placed directly above each function; functions
that dispatch multiple verb names get stacked VERB() declarations.
chainload_importctl() now takes the args strv instead of relying on the
global optind.

--help output is mostly the same.
--no-pager/--no-legend/--no-ask-password/-q/--quiet are now at the end.
bind-volume/unbind-volume are documented.

Fixes c9f461a8067996c6b0c3ac3bf6f9097aedbf4734.

Co-developed-by: Claude Opus 4.7 (1M context) <noreply@anthropic.com>
13 days agoshared/verbs: add VERB_DEFAULT_NOARG
Zbigniew Jędrzejewski-Szmek [Fri, 15 May 2026 17:29:36 +0000 (19:29 +0200)] 
shared/verbs: add VERB_DEFAULT_NOARG

13 days agosd-dhcp-client: do not trigger assertion when running on interface with small MTU 42123/head
Yu Watanabe [Mon, 13 Apr 2026 23:57:47 +0000 (08:57 +0900)] 
sd-dhcp-client: do not trigger assertion when running on interface with small MTU

This also drops spurious default value. If mtu is unset, now the correct
default value is set in client_new_message() in dhcp-client-send.c.

13 days agosd-dhcp-client: drop unnecessary T1/T2 adjustment logic
Yu Watanabe [Wed, 1 Apr 2026 14:26:34 +0000 (23:26 +0900)] 
sd-dhcp-client: drop unnecessary T1/T2 adjustment logic

It is already done in client_parse_ack() -> dhcp_lease_new_from_message().

13 days agosd-dhcp-lease: drop unused dhcp_lease_unref_and_replace()
Yu Watanabe [Mon, 11 May 2026 12:17:51 +0000 (21:17 +0900)] 
sd-dhcp-lease: drop unused dhcp_lease_unref_and_replace()

13 days agosd-dhcp-client: use dhcp_client_parse_message()
Yu Watanabe [Wed, 1 Apr 2026 13:45:04 +0000 (22:45 +0900)] 
sd-dhcp-client: use dhcp_client_parse_message()

This also unify two IO event source handlers.

13 days agofuzz-dhcp-client: fuzz dhcp_client_parse_message()
Yu Watanabe [Wed, 1 Apr 2026 13:52:12 +0000 (22:52 +0900)] 
fuzz-dhcp-client: fuzz dhcp_client_parse_message()

Also, if the fuzzing engine provides a valid message, then try to build
json variant and UDP payload from the parsed message. We will drop
dhcp_lease_save() and dhcp_lease_load(), hence the tests for them are
dropped.

13 days agosocket-util: extend the buffer in sockaddr_union to make it consistent with hw_addr_data
Yu Watanabe [Fri, 15 May 2026 22:18:37 +0000 (07:18 +0900)] 
socket-util: extend the buffer in sockaddr_union to make it consistent with hw_addr_data

Concerned by Claude:
https://github.com/systemd/systemd/pull/42119#discussion_r3251133516

13 days agodhcp-message: introduce dhcp_message_send_{udp,raw}()
Yu Watanabe [Mon, 4 May 2026 05:45:42 +0000 (14:45 +0900)] 
dhcp-message: introduce dhcp_message_send_{udp,raw}()

13 days agonetwork: preparation for using serialized DHCP message in Describe() method (#42122)
Daan De Meyer [Sat, 16 May 2026 12:17:58 +0000 (14:17 +0200)] 
network: preparation for using serialized DHCP message in Describe() method (#42122)

13 days agopo: Translated using Weblate (Spanish)
Fco. Javier F. Serrador [Sat, 16 May 2026 11:59:10 +0000 (11:59 +0000)] 
po: Translated using Weblate (Spanish)

Currently translated at 100.0% (266 of 266 strings)

Co-authored-by: Fco. Javier F. Serrador <fserrador@gmail.com>
Translate-URL: https://translate.fedoraproject.org/projects/systemd/main/es/
Translation: systemd/main

2 weeks agoRevert "shared/pager: add support for more(1) pager in secure mode"
Luca Boccassi [Fri, 15 May 2026 21:52:13 +0000 (22:52 +0100)] 
Revert "shared/pager: add support for more(1) pager in secure mode"

2 weeks agoudev,sd-device: drop old database support (#40801)
Yu Watanabe [Fri, 15 May 2026 23:26:16 +0000 (08:26 +0900)] 
udev,sd-device: drop old database support (#40801)

Closes #40776.

2 weeks agonetworkctl: load information about DHCP client from varlink 42122/head
Yu Watanabe [Tue, 31 Mar 2026 22:56:09 +0000 (07:56 +0900)] 
networkctl: load information about DHCP client from varlink

By the previous commit, networkd now exposes the received DHCP message
in the Descibe() DBus/Varlink method. Let's make networkctl deserialize
the DHCP message and use it where necessary.

2 weeks agonetwork: append DHCP message in json output
Yu Watanabe [Tue, 31 Mar 2026 21:51:50 +0000 (06:51 +0900)] 
network: append DHCP message in json output

Also, get private options from sd_dhcp_message object if sd_dhcp_lease
has it.

With this change, networkctl will be able to use the serialized DHCP
message object. Preparation for later changes.

2 weeks agosd-dhcp-lease: introduce dhcp_client_parse_message()
Yu Watanabe [Tue, 31 Mar 2026 16:45:16 +0000 (01:45 +0900)] 
sd-dhcp-lease: introduce dhcp_client_parse_message()

It parses a received DHCP message and create corresponding sd_dhcp_lease
object for the message. Internally, it uses sd_dhcp_message object.

Note, the new parser is not used yet. The currently used one will be
replaced in later commit.

2 weeks agodhcp-client-send: introduce dhcp_client_send_message()
Yu Watanabe [Wed, 18 Mar 2026 16:01:50 +0000 (01:01 +0900)] 
dhcp-client-send: introduce dhcp_client_send_message()

This internally uses sd_dhcp_message object, and replaces functions
for creating and sending DHCP messages.

By using sd_dhcp_message internally, now we can correctly send long
(> 255 bytes) option data that cannot be fit in a single DHCP option TLV.

This also fixes the value in DHCP option 57 (Maximum Message Size).
Previously the IP and UDP header size is subtracted from the interface
MTU, but it should not.

Except for the above, this should not change any effective behaviors.

2 weeks agovarlink: MethodNotImplemented: drop extraneous dot; vl_error_MethodNotFound: an...
Yu Watanabe [Fri, 15 May 2026 20:10:38 +0000 (05:10 +0900)] 
varlink: MethodNotImplemented: drop extraneous dot;  vl_error_MethodNotFound: an method  (#42112)

2 weeks agotest-network: retry networkctl status in wait_operstate()
Luca Boccassi [Fri, 15 May 2026 17:19:41 +0000 (18:19 +0100)] 
test-network: retry networkctl status in wait_operstate()

networkctl status may transiently fail right after start_networkd() because networkd has not yet picked up the freshly-created link from the kernel. The retry loop in wait_operstate() did not catch the resulting subprocess.CalledProcessError, so the test aborted on the first attempt instead of retrying for the configured timeout.

Observed in TEST-85-NETWORK-NetworkdBridgeTests, subtest test_bridge_configure_without_carrier[no-slave]:

  [   19.600156] systemd-networkd-tests.py[526]: Failed to issue io.systemd.Network.Link.Describe() varlink call: Invalid argument
  [   53.124982] systemd[1]: systemd-networkd.service: Changed start -> running
  [   53.336167] systemd-networkd-tests.py[526]: ERROR: test_bridge_configure_without_carrier (__main__.NetworkdBridgeTests.test_bridge_configure_without_carrier) (test='no-slave')
  [   53.336167] systemd-networkd-tests.py[526]:     self.wait_operstate('bridge99', operstate=r'(no-carrier|routable)', setup_state=None, setup_timeout=30)
  [   53.336167] systemd-networkd-tests.py[526]: subprocess.CalledProcessError: Command '['/usr/bin/networkctl', '-n', '0', 'status', 'bridge99']' returned non-zero exit status 1.

Co-developed-by: Claude Opus 4.7 <noreply@anthropic.com>
2 weeks agomeson: Drop two unnecessary dependencies
Daan De Meyer [Fri, 15 May 2026 13:10:25 +0000 (13:10 +0000)] 
meson: Drop two unnecessary dependencies

2 weeks agomeson: drop vestigial libgpg-error dependency
Daan De Meyer [Fri, 15 May 2026 18:51:30 +0000 (18:51 +0000)] 
meson: drop vestigial libgpg-error dependency

libgpg-error was added in 2017 (commit 76c8741060, Michael Biebl) to
gate HAVE_GCRYPT on its presence because src/resolve referenced
libgpg-error directly at the time. That usage is long gone — no source
file references any gpg-error API today — so the dependency only served
to fail HAVE_GCRYPT detection when gpg-error-dev wasn't installed.

libgcrypt's pkg-config Requires already pulls in the gpg-error headers
(via the transitive #include <gpg-error.h> in <gcrypt.h>), so dropping
the dep doesn't break compilation.

2 weeks agomachinectl: reorder cases in parse_argv() to match order in --help
Zbigniew Jędrzejewski-Szmek [Fri, 15 May 2026 16:34:03 +0000 (18:34 +0200)] 
machinectl: reorder cases in parse_argv() to match order in --help

--no-pager, --no-legend, --no-ask-password, --quiet are shifted to
the end.

Co-developed-by: Claude Opus 4.7 (1M context) <noreply@anthropic.com>
2 weeks agomachinectl: reorder verb functions to match --help
Zbigniew Jędrzejewski-Szmek [Fri, 15 May 2026 16:29:29 +0000 (18:29 +0200)] 
machinectl: reorder verb functions to match --help

The net diff is negative because some spurious whitespace and forward
declarations were dropped. One new forward declaration was added. (For
verb_poweroff_machine. The func could be moved, but I think it's better
to keep it adjacent to verb_reboot_machine which is very similar.)

2 weeks agonsresourced: detect and clean up registry entries for dead user namespaces (#42070)
Daan De Meyer [Fri, 15 May 2026 19:19:15 +0000 (21:19 +0200)] 
nsresourced: detect and clean up registry entries for dead user namespaces (#42070)

The BPF kprobe that fires on user namespace destruction is the only
thing
that triggers registry cleanup, so any time it doesn't run — ring buffer
overflow, kprobe missing, fdstore entry dropped outside our cleanup path
— a registry entry is left behind forever.

Stamp each registry entry with the kernel's unique namespace identifier
(NS_GET_ID, kernel ≥ 6.13) at allocation time. At manager startup, after
the existing fdstore→registry sweep, walk the registry and ask the
kernel
to look each namespace up by id via open_by_handle_at() on nsfs; if the
lookup returns -ESTALE the namespace is gone and we release the entry.
Old entries written before this change carry no identifier and are left
alone.

Add a namespace_open_by_id() helper for the lookup. The kernel restricts
open_by_handle_at() on nsfs to processes in the initial user namespace,
collapsing both permission denials and dead namespaces onto -ESTALE; the
helper refuses early with -EPERM outside the initial user namespace
so callers can tell the two apart.

2 weeks agoConvert homectl to option and verb macros (#42113)
Daan De Meyer [Fri, 15 May 2026 18:15:06 +0000 (20:15 +0200)] 
Convert homectl to option and verb macros (#42113)

2 weeks agoshell-completion: add --when to systemctl
Luca Boccassi [Fri, 15 May 2026 16:40:28 +0000 (17:40 +0100)] 
shell-completion: add --when to systemctl

Fixes https://github.com/systemd/systemd/issues/41672

2 weeks agonsresourced: detect and clean up registry entries for dead user namespaces 42070/head
Daan De Meyer [Wed, 13 May 2026 10:54:02 +0000 (12:54 +0200)] 
nsresourced: detect and clean up registry entries for dead user namespaces

The BPF kprobe that fires on user namespace destruction is the only thing
that triggers registry cleanup, so any time it doesn't run — ring buffer
overflow, kprobe missing, fdstore entry dropped outside our cleanup path
— a registry entry is left behind forever.

Stamp each registry entry with the kernel's unique namespace identifier
(NS_GET_ID, kernel ≥ 6.13) at allocation time. At manager startup, after
the existing fdstore→registry sweep, walk the registry and ask the kernel
to look each namespace up by id via open_by_handle_at() on nsfs; if the
lookup returns -ESTALE the namespace is gone and we release the entry.
Old entries written before this change carry no identifier and are left
alone.

Add a namespace_open_by_id() helper for the lookup. The kernel restricts
open_by_handle_at() on nsfs to processes in the initial user namespace,
collapsing both permission denials and dead namespaces onto -ESTALE; the
helper refuses early with -EHOSTDOWN outside the initial user namespace
so callers can tell the two apart.

2 weeks agohomectl: fix unlocking of multiple homes 42113/head
Zbigniew Jędrzejewski-Szmek [Fri, 15 May 2026 16:45:01 +0000 (18:45 +0200)] 
homectl: fix unlocking of multiple homes

Fixes 4aa0a8ac3e548219d380a0c566242338eab185da.

2 weeks agohomectl: convert verbs to VERB macros
Zbigniew Jędrzejewski-Szmek [Fri, 15 May 2026 15:23:45 +0000 (17:23 +0200)] 
homectl: convert verbs to VERB macros

--help looks pretty much the same. "[list]" is shown in parentheses
because it's the default.

Co-developed-by: Claude Opus 4.7 (1M context) <noreply@anthropic.com>
2 weeks agohomectl: convert parse_argv to OPTION macros
Zbigniew Jędrzejewski-Szmek [Fri, 15 May 2026 13:01:09 +0000 (15:01 +0200)] 
homectl: convert parse_argv to OPTION macros

Rewrite help() with help-util.h primitives + option_parser_get_help_table_group
for each User Record Properties section. The verbs[] table stays
unchanged for now; run() switches from dispatch_verb() (which depended
on the global optind) to _dispatch_verb_with_args() fed by
option_parser_get_args().

Explanations are improved for --birth-date[=DATE] (correct placement of
'['), --skel=, --shell= (short options listed). Some minor rewordings
for other options. The explanation for -E and -EE is split.
(OPTION_HELP_ENTRY_VERBATIM is used for -EE.)

Co-developed-by: Claude Opus 4.7 (1M context) <noreply@anthropic.com>
2 weeks agoshared/options: fix display of OPTION_HELP_ENTRY_VERBATIM
Zbigniew Jędrzejewski-Szmek [Fri, 15 May 2026 15:51:41 +0000 (17:51 +0200)] 
shared/options: fix display of OPTION_HELP_ENTRY_VERBATIM

So far it was used only once, in bootctl. It should not be indented:
  -R --print-root-device
  -RR
  ^

2 weeks agohomectl: reorder cases in parse_argv() to match order in --help
Zbigniew Jędrzejewski-Szmek [Fri, 15 May 2026 11:59:30 +0000 (13:59 +0200)] 
homectl: reorder cases in parse_argv() to match order in --help

Display options --no-pager, --no-legend, --no-ask-password are placed at
the end, after --mute-console=yes, rather than near the top.

Co-developed-by: Claude Opus 4.7 (1M context) <noreply@anthropic.com>
2 weeks agohomectl: reorder verb functions to match order in --help
Zbigniew Jędrzejewski-Szmek [Fri, 15 May 2026 11:33:58 +0000 (13:33 +0200)] 
homectl: reorder verb functions to match order in --help

Just a hand-crafted moving of blocks of code up and down, no other
changes. The net diff is -2 because add_signing_keys_from_credentials
forward declaration was dropped.

2 weeks agovarlink: vl_error_MethodNotFound: an method 42112/head
наб [Fri, 15 May 2026 15:55:20 +0000 (17:55 +0200)] 
varlink: vl_error_MethodNotFound: an method

2 weeks agovarlink: MethodNotImplemented: drop extraneous dot
наб [Fri, 15 May 2026 15:54:42 +0000 (17:54 +0200)] 
varlink: MethodNotImplemented: drop extraneous dot

2 weeks agocore: support FD Store propagation through manager instances, and preservation throug...
Luca Boccassi [Fri, 15 May 2026 15:07:48 +0000 (16:07 +0100)] 
core: support FD Store propagation through manager instances, and preservation through kexec via LUO (#41683)

First of all, FD store propagation is enabled between manager instances,
and nspawn instances, via LISTEN_FDS and sd_notify. These can be nested
arbitrarily deeply all the way up to the system manager, and on restart
will be propagated all the way down to the origin. The FDs payload of an
nspawn container running as a user unit will be preserved, all the way
up to the system manager, and then down again.

The kernel Live Update Orchestrator (LUO) exposes /dev/liveupdate, which
lets userspace hand a set of "preservable" kernel objects to the new
kernel across a kexec-based reboot. For now it only supports memfds,
with more object types (virtio devices, etc.) expected to be added
later.

This is a natural fit for systemd's FD Store feature: services hand
memfds (containing serialized state or other service data) to PID 1 via
FDSTORE=1 sd_notify() messages, and get them back on their next start.
Today this works across service restarts, soft reboots and initrd→rootfs
transitions. With LUO, this series extends the same mechanism to work
across kexec too. The nesting preservation of FD stores thus now is
extended across kexec.

All preservable fds are collected into a single LUO session named
"systemd". Each fd is uploaded with an index (token). Token 0 is
reserved for a "mapping" memfd, which carries a JSON object describing
how to dispatch the other tokens back to units on the next boot.

Unit names are used as the unit identifier, as they are stable across
daemon-reexec, switch-root and kexec. token refers to the LUO index
assigned to the object in the session.

On shutdown for MANAGER_KEXEC, just before manager_free(), systemd walks
all services and serializes their persistent fd store contents (fds +
FDNAMEs + cgroup paths) into a JSON memfd. The fds themselves are
gathered into an FDSet. The fdset and the serialization memfd are passed
to systemd-shutdown via the SYSTEMD_LUO_SERIALIZE_FD environment
variable providing the fd number, so the actual LUO session creation and
ioctls happen as the very last step before kexec.

On boot, manager_luo_restore_fd_stores() opens /dev/liveupdate, tries to
retrieve the "systemd" session, reads the mapping memfd, then for each
entry retrieves the fd from the session and attempts to attach it to the
matching unit's fd store.

Because the initrd-stage PID 1 runs before the real rootfs units are
loaded, fds whose target unit is not (yet) known are not dropped: they
are stashed in a new luo_held_fds hashmap keyed by cgroup path. They are
re-tried in two places: after deserialization, and from unit_load(), so
fds land in the correct fd store as soon as the owning unit is parsed,
allowing units to be plugged in at runtime.

Non-kexec shutdown paths are unaffected: if MANAGER_KEXEC is not the
final objective, no serialization file is produced and no LUO session is
ever created. Likewise if /dev/liveupdate does not exist, nothing
happens.

The LUO session creation is performed by systemd-shutdown, rather than
by PID 1, deliberately: it is the last point where we can be sure all
other processes have already been killed, so nothing else can race us
into creating (or worse, hijacking) the "systemd" session.
/dev/liveupdate is a singleton and session names are global. In
addition, any kernel-visible side effects of preserving objects (memory
pinning, etc.) are delayed until the absolute last moment, minimizing
the window in which they could affect the running system. There is no
behaviour change for shutdown paths other than kexec, or for kexec when
systemd didn't hand over a serialization fd (e.g. because no service had
any fds stored, or because LUO wasn't supported at serialization time).

Finally, since LUO sessions cannot be nested under other sessions,
third-party sessions need to be handled explicitly and held open in the
shutdown binary alongside our own internal session, to allow services to
create and preserve their own sessions. The requirement comes from VMMs
that wish to preserve VM state across kexec: some file descriptors (e.g.
KVM's vmfd from the KVM_CREATE_VM ioctl) cannot be transferred between
processes via SCM_RIGHTS, so they cannot be stashed in the FD Store
directly. Additionally, some file descriptors must be handled
all-or-nothing, again tied to KVM, where a VM and its associated devices
are one indivisible group.

https://docs.kernel.org/userspace-api/liveupdate.html
https://docs.kernel.org/core-api/liveupdate.html
https://docs.kernel.org/admin-guide/mm/kho.html

2 weeks agomkosi: Make sure mkosi.clangd maps to mkosi/mkosi.tools
Daan De Meyer [Fri, 15 May 2026 10:37:19 +0000 (10:37 +0000)] 
mkosi: Make sure mkosi.clangd maps to mkosi/mkosi.tools

The tools tree is now stored in mkosi/mkosi.tools, so update
the script to match.

2 weeks agoLUO: add support for preserving third party sessions 41683/head
Luca Boccassi [Wed, 15 Apr 2026 12:11:30 +0000 (13:11 +0100)] 
LUO: add support for preserving third party sessions

LUO sessions cannot be nested under other sessions. This means we need
to handle them explicitly, and held them open in the shutdown binary
like we do with our own internal session, to allow services to create
their own.

The requirement to support third party sessions comes from VMMs that
wish to preserve VM(s) state(s) across kexec, as some file descriptors
(KVM's vmfd from the KVM_CREATE_VM ioctl) cannot be transfered between
processes via SCM_RIGHTS, so they cannot be stashed in the FD Store
directly. Also some file descriptors have to be handled all together or
not at all, again to do with KVM and devices that are all part of the
same vm.

2 weeks agodocs: document LUO support
Luca Boccassi [Thu, 16 Apr 2026 21:32:22 +0000 (22:32 +0100)] 
docs: document LUO support

2 weeks agotest: add integration test for LUO
Luca Boccassi [Mon, 30 Mar 2026 22:14:38 +0000 (23:14 +0100)] 
test: add integration test for LUO

2 weeks agoshutdown: prepare LUO session for FD Stores before kexec
Luca Boccassi [Mon, 30 Mar 2026 23:29:19 +0000 (00:29 +0100)] 
shutdown: prepare LUO session for FD Stores before kexec

Wires up the systemd-shutdown side of the kexec-via-LUO fd store preservation.

When rebooting via kexec, systemd builds a JSON description of the fd
stores of all loaded services and passes it to systemd-shutdown through
the SYSTEMD_LUO_SERIALIZE_FD environment variable. The FDs themselves
come in as part of the normal shutdown FDSet. systemd-shutdown's job is
then, at the very last moment before invoking the kexec syscall, to
move that state into a kernel LUO session so it survives the reboot.

Doing the LUO session creation here, rather than in PID 1, is
deliberate:

 * It's the last point where we can be sure all other processes have
   already been killed, so nothing else can race us into creating (or
   worse, hijacking) the "systemd" session, as /dev/liveupdate is a
   singleton and a session name is global.
 * Any kernel-visible side effects of preserving objects (memory
   pinning etc.) are delayed until the absolute last moment, minimizing
   the window in which they could affect the running system

No behaviour change for shutdown paths other than kexec, or for kexec
when systemd didn't hand over a serialization fd (e.g. because no
service had any fds stored, or because LUO wasn't supported at
serialization time).

2 weeks agocore: support FD Store preservation through kexec via LUO
Luca Boccassi [Fri, 1 May 2026 13:25:11 +0000 (14:25 +0100)] 
core: support FD Store preservation through kexec via LUO

The kernel Live Update Orchestrator (LUO) exposes /dev/liveupdate, which
allows userspace to hand a set of "preservable" kernel objects to the
new kernel across a kexec-based reboot. For now it only supports memfds,
with more object types (virtio devices, etc.) expected to be added later.

This is a natural fit for systemd's FD Store feature: services hand
memfds (containing serialized state or other service data) to PID 1 via
FDSTORE=1 sd_notify() messages, and get them back on their next start.
Today this works across service restarts, soft reboots and
initrd→rootfs transitions. With LUO we can extend the same mechanism to
work across kexec, too.

The protocol on the PID 1 side works roughly as follows:

 * All preservable fds are collected into a single LUO session named
   "systemd". Each FD gets uploaded with a token. Token 0 in that session
   is reserved for a "mapping" memfd, which carries a JSON object
   describing how to dispatch the other tokens back to units on the next
   boot:

       {
         "foo.service": [
           { "type": "fd", "name": "stateA", "token": 1 },
           { "type": "fd", "name": "stateB", "token": 2 }
         ],
         ...
       }

   unit IDs are used as the unit identifier, as they're stable
   across daemon-reexec, switch-root and kexec. token refers to the
   LUO token assigned to the object in the session.

 * On shutdown for MANAGER_KEXEC, just before manager_free(), systemd
   walks all services and serializes their persistent fd store contents
   (fds + FDNAMEs + unit IDs) into a JSON memfd. The FDs themselves are
   gathered into a FDSet to be kept around. The fdset and the
   serialization memfd are passed to systemd-shutdown via the
   SYSTEMD_LUO_SERIALIZE_FD environment variable providing the fd number,
   so the actual LUO session creation and ioctls can happen as the very
   last step before kexec (shutdown implementation is the next commit).

 * On boot, manager_luo_restore_fd_stores() opens /dev/liveupdate,
   tries to retrieve the "systemd" session, reads the mapping memfd,
   then for each entry retrieves the fd from the session and attempts
   to attach it to the matching unit's fd store.

 * The FDs are injected in the appropriate unit's FD stores using the
   same mechanism as the LISTEN_FDS propagation that was set up earlier.

Non-kexec shutdown paths are unaffected: if MANAGER_KEXEC is not the
final objective, no serialization file is produced and no LUO session
is ever created. Likewise if /dev/liveupdate does not exist, nothing
happens.

2 weeks agoAdd helpers for talking to /dev/liveupdate
Luca Boccassi [Mon, 30 Mar 2026 14:43:29 +0000 (15:43 +0100)] 
Add helpers for talking to /dev/liveupdate

This character device is the main kernel interface to deal with the
Live Update Orchestrator (LUO) feature. Add some basic wrappers for
the ioctls.

https://docs.kernel.org/userspace-api/liveupdate.html

2 weeks agoImport linux/liveupdate.h UAPI header
Luca Boccassi [Mon, 30 Mar 2026 14:22:40 +0000 (15:22 +0100)] 
Import linux/liveupdate.h UAPI header

From kernel 7.0

2 weeks agonspawn: support forwarding FDs from payloads to managers
Luca Boccassi [Fri, 1 May 2026 13:06:11 +0000 (14:06 +0100)] 
nspawn: support forwarding FDs from payloads to managers

When there is a NOTIFY_SOCKET, and FDs are received from the
payload following the FD Store protocol, forward them up the
chain to the service manager that is managing nspawn.

This allows FD Store persistence across container restarts,
and can chain up for user managers as well to survive restarting
those, or reexecs, and in the future reboots too via LUO.

Add a new test case to exercise the PID1 -> user session -> nspawn -> payload
chain.

2 weeks agocore: propagate FDs from store from user to system manager
Luca Boccassi [Fri, 1 May 2026 13:19:33 +0000 (14:19 +0100)] 
core: propagate FDs from store from user to system manager

In order to allow FD Stores of user units to survive a user
session restart, propagate FDs received via the protocol up one
level from user to system manager via sd_notify.

And the other way around, propagate them down via LISTEN_FDS
tagging them with the unit name so that the child manager can
inject them in the appropriate unit.

Ensure units that are dead or not loaded can get FDs added to
their stores, and that they are correctly propagated once the
unit is started or loaded. When the unit is not loaded we don't
know what the FD max limit is, so simply increase it for each FD
injected, and then when the unit is realised prune it down to
match the unit's now available config in case the limit is lower
than the number of FDs in the store.

Each FD sent up or down is assigned a monotonic index, and the manager
also sends a JSON map that associates the index with the original
unit and FDNAME:

 {
   "unit-name.service": [
     { "name": "fdname1", "index": 1 },
     { "name": "fdname2", "index": 2 }
   ],
   ...
 }

This allows the manager to assign back the FDs to the appropriate
unit using the appropriate name, given the FDNAMEs are not unique.

2 weeks agodhcp-message: allow to serialize/deserialize sd_dhcp_message object
Yu Watanabe [Tue, 24 Mar 2026 20:25:04 +0000 (05:25 +0900)] 
dhcp-message: allow to serialize/deserialize sd_dhcp_message object

By using this, we can expose received DHCP message in Describe()
DBus/Varlink methods. Preparation for later change.

2 weeks agoudev/node: drop support of old file format in /run/udev/links/ 40801/head
Yu Watanabe [Sun, 22 Feb 2026 16:51:26 +0000 (01:51 +0900)] 
udev/node: drop support of old file format in /run/udev/links/

The new file format in /run/udev/links/ has been introduced in
377a83f0d80376456d9be203796f66f543a8b943 (v250, released on 2021-12-23).
Let's drop the old format support, to simplify the logic.

2 weeks agoudev/watch: use mapping from device ID -> watch on restart
Yu Watanabe [Sun, 22 Feb 2026 16:28:41 +0000 (01:28 +0900)] 
udev/watch: use mapping from device ID -> watch on restart

The mapping from device ID to watch handle has been introduced by
e7f781e473f5119bf9246208a6de9f6b76a39c5d (v249, released on 2021-07-07).
Let's drop the runtime upgradability of udevd from an ancient version.

2 weeks agosd-device: drop support of udev database version 0
Yu Watanabe [Sun, 22 Feb 2026 19:32:05 +0000 (04:32 +0900)] 
sd-device: drop support of udev database version 0

The udev database versioning has been introduced in v247, which is
released on 2020-11-26.
Let's drop the support of old udev database.

2 weeks agoConvert PID1 to option macros (#42099)
Zbigniew Jędrzejewski-Szmek [Fri, 15 May 2026 11:39:36 +0000 (13:39 +0200)] 
Convert PID1 to option macros (#42099)

2 weeks agocore: add WorkingDirectory, Environment and SetCredential{,Encrypted} to io.systemd...
Zbigniew Jędrzejewski-Szmek [Fri, 15 May 2026 09:29:19 +0000 (11:29 +0200)] 
core: add WorkingDirectory, Environment and SetCredential{,Encrypted} to io.systemd.Unit.StartTransient (#41874)

This PR adds some more properties to the io.systemd.Unit.StartTransient
varlink interface: WorkingDirectory, Environment and
SetCredential{,Encrypted}. Its also hopefully a useful starting point to
establish a pattern to add even more.

2 weeks agoImplement Service Context/Runtime for io.systemd.Unit.List (#42098)
Luca Boccassi [Fri, 15 May 2026 09:20:56 +0000 (10:20 +0100)] 
Implement Service Context/Runtime for io.systemd.Unit.List (#42098)

The PR implements the following objects + tests for
io.systemd.Unit.List:
- ServiceContext
- ServiceRuntime

It's hopefully the last PR of the long sequence of:

* https://github.com/systemd/systemd/pull/37432
* https://github.com/systemd/systemd/pull/37646
* https://github.com/systemd/systemd/pull/38032
* https://github.com/systemd/systemd/pull/38212
* https://github.com/systemd/systemd/pull/39391
* https://github.com/systemd/systemd/pull/41980
* https://github.com/systemd/systemd/pull/42057

2 weeks agomanager: skip reopening of console and signal reset when running as normal program 42099/head
Zbigniew Jędrzejewski-Szmek [Fri, 15 May 2026 08:18:28 +0000 (10:18 +0200)] 
manager: skip reopening of console and signal reset when running as normal program

We want to reopen the console used for logging when running as PID1, but
also when running a user manager (c.f. 48a601fe5de8aa0d89ba6dadde168769fa7ce992
and 2a646b1d624e510a79785e1268b55a9c3a441db5). But this can cause
problems when the binary is invoked directly, e.g. to print --help.
E.g. if we ignore SIGPIPE, we'd remain running briefly after
'/usr/lib/systemd/systemd --help | head -n1'.

Previusly, the getopt machinery would print to stderr unconditionally.
But after the rework of option parsing, which means that we use the
log_* functions to repor errors, the test that checks if we print errors
to stderr started failing.

So let's skip some more of the setup if !invoked_by_systemd().

2 weeks agobasic: cache the result of invoked_by_systemd()
Zbigniew Jędrzejewski-Szmek [Fri, 15 May 2026 08:12:00 +0000 (10:12 +0200)] 
basic: cache the result of invoked_by_systemd()

This function is used in a quite a few places and it calls getenv and
does a bit of parsing, so let's try to speed this up.

Also, mark it _const_. With the caching, it now always returns the same
result, so we can tell the compiler to eliminate subsequent invocations.

2 weeks agobasic: fold getopt-defs.h into proc-cmdline.c
Zbigniew Jędrzejewski-Szmek [Thu, 14 May 2026 17:44:22 +0000 (19:44 +0200)] 
basic: fold getopt-defs.h into proc-cmdline.c

It'd be nice if we could not repeat the information about the option
list a second time. But I don't see a nice way to do this, since
(by design) with the macro approach, the macros must be intertwined
with the parse_argv() code. But that code in turn refers to a bunch
of variables, so lifting out the function is not immediately possible.
So I think it's best to keep the existing approach where we provide
a list of options, without additional context, and skip them using
a custom routine.

2 weeks agocore: tweak handling of unknown options
Zbigniew Jędrzejewski-Szmek [Thu, 14 May 2026 16:44:29 +0000 (18:44 +0200)] 
core: tweak handling of unknown options

099663ff8c117303af369a4d412dafed0c5614c2 added "support" for
-b/-s/-z ARG with a comment of
> /* Just to eat away the sysvinit kernel cmdline args without getopt()
>  * error messages that we'll parse in parse_proc_cmdline_word() or
>  * ignore. */
And for PID1 those was valid. But when not running as PID1, those
options would be parsed as valid but then help() would immediately
return -EINVAL:
  $ build-old/systemd -b; echo $?
  1

At the same time, when running as PID1, if we encounter an error,
we shouldn't opine about the rest of the command line. So continuing
with the loop and the checks after the loop were iffy.

Later, cd57038a30aa9447bde3af7111ac8dc517b38bbf made a big refactoring,
and the 'break' (i.e. continuation of the loop) was changed to 'return 0',
making things even more confusing, since now we'd just silently stop in
the middle of the command line if -b/-s/-z were encountered.

So be more careful: when running as PID1, stop parsing on error
and return from the function. We didn't parse the full command line,
so the later checks are not useful. Silently ignore -b/-s/-z.
When not running as PID1, explicitly say that -b/-s/-z are not
supported, and propogate the error if parsing fails, e.g. with
an unknown option.

2 weeks agocore: add --crash-vt= for compat with --help
Zbigniew Jędrzejewski-Szmek [Thu, 14 May 2026 16:18:24 +0000 (18:18 +0200)] 
core: add --crash-vt= for compat with --help

Fixes b9e74c399458a1146894ce371e7d85c60658110c.

2 weeks agocore: convert PID 1 parse_argv to OPTION macros
Zbigniew Jędrzejewski-Szmek [Thu, 14 May 2026 08:38:35 +0000 (10:38 +0200)] 
core: convert PID 1 parse_argv to OPTION macros

parse_argv() uses FOREACH_OPTION (not _OR_RETURN) so we can preserve the
existing PID 1 tolerance: an unknown option, or one of the sysvinit-style
-b/-s/-z catch-alls, returns 0 instead of -EINVAL when getpid_cached() == 1.

The docs documented --crash-vt=, but the code implemented "crash-chvt",
as introduced in b9e74c399458a1146894ce371e7d85c60658110c.
The output from --help is now modified to match code.

getopt-defs.h is intentionally left in place since
proc_cmdline_filter_pid1_args() in src/basic/proc-cmdline.c still uses
its COMMON_/SYSTEMD_/SHUTDOWN_GETOPT_* macros to walk the kernel
command line.

Previously, opterr=0 was used to suppress error messages about option
parsing in PID1. They are now logged at debug level (if debug logging
is enabled.)

Co-developed-by: Claude Opus 4.7 <noreply@anthropic.com>
2 weeks agotest: add ServiceContext/Runtime enum and integration tests 42098/head
Ivan Kruglov [Thu, 14 May 2026 16:41:50 +0000 (09:41 -0700)] 
test: add ServiceContext/Runtime enum and integration tests

Co-developed-by: Claude Opus 4.6 <noreply@anthropic.com>
2 weeks agocore: expand ServiceContext and add ServiceRuntime for io.systemd.Unit.List
Ivan Kruglov [Thu, 14 May 2026 16:41:39 +0000 (09:41 -0700)] 
core: expand ServiceContext and add ServiceRuntime for io.systemd.Unit.List

Co-developed-by: Claude Opus 4.6 <noreply@anthropic.com>
2 weeks agoshared: add exec_command_status_build_json() and ExecCommandStatus varlink type to...
Ivan Kruglov [Thu, 14 May 2026 16:41:24 +0000 (09:41 -0700)] 
shared: add exec_command_status_build_json() and ExecCommandStatus varlink type to common

Add exec_command_status_build_json() and exec_command_status_list_build_json() to varlink-common, alongside exec_command_build_json() and exec_command_list_build_json(). The status list function is the runtime counterpart of the command list function — the two arrays are positionally aligned so index N in the status array corresponds to index N in the command array. Commands that have not yet run produce null entries to preserve alignment.

Add the ExecCommandStatus varlink struct type to varlink-idl-common next to ExecCommand. It contains PID, timestamps, and mutually exclusive ExitStatus (int, for normal exit) / ExitSignal (string, for signal kill).

2 weeks agoTODO: fix typo
Yu Watanabe [Fri, 15 May 2026 06:33:11 +0000 (15:33 +0900)] 
TODO: fix typo

2 weeks agosd-journal: update comments
Yu Watanabe [Fri, 15 May 2026 06:04:02 +0000 (15:04 +0900)] 
sd-journal: update comments

2 weeks agocore: make manager event loop rate limit configurable
Michal Sekletar [Wed, 13 May 2026 14:20:55 +0000 (16:20 +0200)] 
core: make manager event loop rate limit configurable

Co-developed-by: Claude Opus 4.6 <noreply@anthropic.com>
2 weeks agoinclude: import linux/nsfs.h from kernel v7.0.0~rc1
Daan De Meyer [Wed, 13 May 2026 12:12:02 +0000 (14:12 +0200)] 
include: import linux/nsfs.h from kernel v7.0.0~rc1

2 weeks agoci: switch SUSE mkosi mirror to cdn.o.o
Luca Boccassi [Thu, 14 May 2026 20:06:15 +0000 (21:06 +0100)] 
ci: switch SUSE mkosi mirror to cdn.o.o

The cdn mirror is preferred by SUSE for clouds/CIs. There have been issues with some
mirrors, which fail to download from GHA quite often lately, so hopefully this will
make it reliable again.

2 weeks agosysupdate: mkdir_parents CurrentSymlink= path
Aleksa Sarai [Thu, 14 May 2026 10:15:06 +0000 (17:15 +0700)] 
sysupdate: mkdir_parents CurrentSymlink= path

This was missing in the CurrentSymlink= creation path, and leads to
partially-broken update installs.

Signed-off-by: Aleksa Sarai <aleksa@amutable.com>
2 weeks agotest: Add a sysupdate test for files which are a prefix match of each other
Philip Withnall [Sun, 3 May 2026 21:36:32 +0000 (22:36 +0100)] 
test: Add a sysupdate test for files which are a prefix match of each other

This tests whether the pattern matching code checks it’s matched the
whole string and not just a prefix (see commit 4ffb60319b).

In particular, this tests a setup which KDE currently use in their
sysupdate images, where two regular file transfers are done, one of a
`foo.erofs` file, and the other `foo.erofs.caibx`. As one is a prefix of
the other, they were hitting this bug.

See:
 - https://files.kde.org/kde-linux/sysupdate/v2/
 - https://github.com/KDE/kde-linux/tree/master/mkosi.extra/usr/lib/sysupdate.d

Signed-off-by: Philip Withnall <pwithnall@gnome.org>
Fixes: https://github.com/systemd/systemd/issues/38605
Fixes: https://github.com/systemd/systemd/issues/41288
2 weeks agosd-radv: do not stop on transient send errors
r-vdp [Mon, 13 Apr 2026 12:41:11 +0000 (14:41 +0200)] 
sd-radv: do not stop on transient send errors

When the periodic RA timer fires, any error returned by sendmsg()
currently propagates up through sd_radv_send() into radv_timeout(),
which then calls sd_radv_stop(). The RA engine is never started again
until the next carrier transition.

On an 802.3ad bond there is a window right after carrier-up where the
link is administratively up but no aggregator has been selected yet, so
sendmsg() returns ENOBUFS. If the very first RA after a flap lands in
that window, radv stops permanently and all clients lose their SLAAC
addresses, on-link/PD prefixes, and default router once the previously
advertised lifetimes expire, while IPv4 keeps working, leading to a very
confusing situation with v4 up and v6 down.

Handle this the same way solicited RAs already do (see
radv_process_packet()): log the failure and reschedule the timer instead
of giving up. ra_sent is left untouched on failure so we stay in the
fast initial-advertisement regime until a send actually succeeds.

2 weeks agonetwork: honour static IPv6LL addresses in network_adjust_*()
r-vdp [Mon, 13 Apr 2026 17:03:27 +0000 (19:03 +0200)] 
network: honour static IPv6LL addresses in network_adjust_*()

link_radv_enabled() and link_ndisc_enabled() use
link_ipv6ll_enabled_harder(), which considers a static fe80:: address
in [Address] sufficient to run radv/ndisc even when LinkLocalAddressing=
(or IPv6LinkLocalAddressGenerationMode=none, which network_verify()
folds into the same flag) disables the kernel-generated link-local.

network_adjust_radv()/ndisc()/dhcp() however only check the raw
link_local flag and zero router_prefix_delegation / ndisc / dhcp&IPV6
at parse time, so the runtime gate never gets a chance to fire.

Factor the static-LL lookup out of link_ipv6ll_enabled_harder() into a
Network-level helper and use it in the three network_adjust_*()
functions, bringing parse-time and runtime behaviour in line.

2 weeks agoshared/options: introduce OPTION_ERROR
Lennart Poettering [Thu, 14 May 2026 15:56:56 +0000 (17:56 +0200)] 
shared/options: introduce OPTION_ERROR

[zjs: this was originally proposed in
https://github.com/systemd/systemd/commit/930fc9d6980f27b278527b0d6117f97296fcaf6a.
I'm rescuing one chunk from that patch.]

2 weeks agocore: reorder cases in parse_argv() to match order in --help
Zbigniew Jędrzejewski-Szmek [Thu, 14 May 2026 08:35:30 +0000 (10:35 +0200)] 
core: reorder cases in parse_argv() to match order in --help

The hidden-from-help options (--crash-reboot, --service-watchdogs,
--deserialize, --switched-root, --machine-id, -D, -b/-s/-z, ?)
move to the bottom. The 'b'/'s'/'z' → '?' fall-through is preserved.

Co-developed-by: Claude Opus 4.7 <noreply@anthropic.com>
2 weeks agosd-device: use ERRNO_IS_NEG_DEVICE_ABSENT() for device-id load failures (#41764)
我超厉害 [Thu, 14 May 2026 17:51:29 +0000 (01:51 +0800)] 
sd-device: use ERRNO_IS_NEG_DEVICE_ABSENT() for device-id load failures (#41764)

Device enumeration may encounter transient errors such as ENXIO when devices
appear or disappear concurrently. These conditions represent expected "device absent"
races and should be treated uniformly across the enumeration logic.

This change replaces the ENODEV-specific check with ERRNO_IS_NEG_DEVICE_ABSENT(),
ensuring that all expected disappearance conditions are handled consistently.
Unexpected errors are still propagated, while expected races are ignored without
aborting the enumeration.

2 weeks agoA few more conversions of options and verbs (#41795)
Yu Watanabe [Thu, 14 May 2026 17:47:23 +0000 (02:47 +0900)] 
A few more conversions of options and verbs (#41795)

I had those prepared before but I didn't submit them because the
automatic layout didn't work well. In two cases now the sync of widths
between verbs and options is disabled and one case is left with the
automatic alignment. I think it'd good enough to merge.

2 weeks agocore: move service_context_build_json() to varlink-service.c
Ivan Kruglov [Thu, 14 May 2026 16:41:09 +0000 (09:41 -0700)] 
core: move service_context_build_json() to varlink-service.c

Move the existing (partial) service context builder from varlink-unit.c into its own varlink-service.c file, following the pattern established by other unit type context builders (varlink-path.c, varlink-scope.c, etc.). No functional change.

2 weeks agomeson: don't use Python module for host Python (#41959)
Yu Watanabe [Thu, 14 May 2026 15:38:19 +0000 (00:38 +0900)] 
meson: don't use Python module for host Python (#41959)

Checking for pefile required that module to be made available for the
Python used to build systemd, even though it's only used at runtime,
potentially via a different Python installation.

Furthermore, Meson's Python module doesn't do the right thing when cross
compiling and looking up a Python for the host system, so this would end
up uselessly checking whether the build Python had the pefile module,
which is not needed. Even if it were made to check the host Python using
find_program, it still relies on being able to run its Python, which in
a cross scenario it probably wouldn't be able to do.

All in all, this check does more harm than good, and prevents building
ukify in valid configurations, so remove it.

2 weeks agocoredump: add JSON output support to coredumpctl info
noxiouz [Tue, 17 Mar 2026 23:55:51 +0000 (23:55 +0000)] 
coredump: add JSON output support to coredumpctl info

Implement support for the --json= flag in the info subcommand
(issue #38844). Previously, coredumpctl info always produced
human-readable text output regardless of --json=.

Add a CoredumpFields struct that holds all journal fields extracted
for a coredump entry, along with coredump_fields_done() to release
member resources and coredump_fields_load() to populate the struct
from a journal entry. Both print_info() and the new print_info_json()
use this shared loader, eliminating the duplicate RETRIEVE loop.

print_info_json() builds a JSON object with the same fields shown by
print_info(). Missing fields are omitted via SD_JSON_BUILD_PAIR_CONDITION,
matching the tolerant behavior of print_info() rather than skipping the
entry entirely. Signal/Reason handling mirrors print_info(): normal
coredumps (MESSAGE_ID == SD_MESSAGE_COREDUMP_STR) emit a numeric Signal
field; non-normal entries (kernel oops, etc.) emit a Reason field with
the raw text from COREDUMP_SIGNAL.

Co-developed-by: Claude Opus 4.6 <noreply@anthropic.com>
2 weeks agobtrfs: Beef up btrfs_subvol_make()
Daan De Meyer [Mon, 11 May 2026 19:58:24 +0000 (21:58 +0200)] 
btrfs: Beef up btrfs_subvol_make()

Let's make sure we handle AT_FDCWD and XAT_FDROOT
properly by using xopenat().

2 weeks agonspawn: split boot parameters into env vars and argv
Daan De Meyer [Tue, 12 May 2026 13:03:49 +0000 (13:03 +0000)] 
nspawn: split boot parameters into env vars and argv

When the kernel hands the command line to PID 1, any KEY=VALUE assignment
whose KEY does not contain a '.' is exported as an environment variable
(with '-' replaced by '_') rather than passed as an argument. Mimic the
same split in --boot mode so kernel-cmdline-style arguments passed after
the container path behave as they would on a real boot.

2 weeks agoImplement Socket Context/Runtime for io.systemd.Unit.List (#42057)
Yu Watanabe [Thu, 14 May 2026 14:29:47 +0000 (23:29 +0900)] 
Implement Socket Context/Runtime for io.systemd.Unit.List (#42057)

The PR implements the following objects + tests for
io.systemd.Unit.List:
- SocketContext
- Socket Runtime

It's a continuation of the following PRs:

* https://github.com/systemd/systemd/pull/37432
* https://github.com/systemd/systemd/pull/37646
* https://github.com/systemd/systemd/pull/38032
* https://github.com/systemd/systemd/pull/38212
* https://github.com/systemd/systemd/pull/39391
* https://github.com/systemd/systemd/pull/41980

2 weeks agoprofile: bail out early if promptvars is disabled
Frantisek Sumsal [Thu, 14 May 2026 11:05:02 +0000 (13:05 +0200)] 
profile: bail out early if promptvars is disabled

We need promptvars, otherwise the prompt strings won't undergo parameter
expansion and we'd print them literally:

$ shopt -u promptvars
$ echo foo
$(__systemd_osc_context_ps0)foo

Resolves: #40620

2 weeks agotest-fs-util: check for CAP_DAC_OVERRIDE in xopenat_auto_rw_ro
Emanuele Rocca [Thu, 14 May 2026 11:31:24 +0000 (13:31 +0200)] 
test-fs-util: check for CAP_DAC_OVERRIDE in xopenat_auto_rw_ro

When running test_xopenat_auto_rw_ro under a non-root user with the
CAP_DAC_OVERRIDE capability, the test currently fails.

As the comment already says, root bypasses mode bits via CAP_DAC_OVERRIDE so
let's check for that instead of the effective user ID.

Signed-off-by: Emanuele Rocca <emanuele.rocca@arm.com>
2 weeks agovarious: fix duplicated logging from parse_path_argument 41795/head
Zbigniew Jędrzejewski-Szmek [Thu, 23 Apr 2026 19:43:19 +0000 (21:43 +0200)] 
various: fix duplicated logging from parse_path_argument

As pointed out in review, parse_path_argument can fail for non-oom reasons.
But the function already logs, so the correct thing to do is to just
propagate the error.

2 weeks agobusctl: convert to the new option and verb parsers
Zbigniew Jędrzejewski-Szmek [Tue, 14 Apr 2026 10:56:01 +0000 (12:56 +0200)] 
busctl: convert to the new option and verb parsers

The conversion doesn't work great, because some of the verbs take many
arguments and the first column is extermely wide. So similarly to
kernel-install, I dropped the sync of column widths. This allows the
help for options to use most of the available space.

-C/--capsule is now documented, fixup for
 00431b2b66cb59540deda4ea018170a289673585.

Verb functions are renamed to match verb names.

The missing first param is added to the synopsis of "wait".
It now matches the man page.

Co-developed-by: Claude Opus 4.6 <noreply@anthropic.com>
2 weeks agobusctl: reorder option cases to match --help output
Zbigniew Jędrzejewski-Szmek [Tue, 14 Apr 2026 14:42:41 +0000 (16:42 +0200)] 
busctl: reorder option cases to match --help output

Co-developed-by: Claude Opus 4.6 <noreply@anthropic.com>
2 weeks agolocalectl: convert to the new option and verb parsers
Zbigniew Jędrzejewski-Szmek [Thu, 16 Apr 2026 09:38:06 +0000 (11:38 +0200)] 
localectl: convert to the new option and verb parsers

The verb synopses are long, so they got broken up:
===============================================================================
> localectl [OPTIONS…] COMMAND …

Query or change system locale and keyboard settings.

Commands:
  [status]                      Show current locale settings
  set-locale LOCALE...          Set system locale
  list-locales                  Show known locales
  set-keymap MAP [MAP]          Set console and X11 keyboard mappings
  list-keymaps                  Show known virtual console keyboard mappings
  set-x11-keymap LAYOUT [MODEL  Set X11 and console keyboard mappings
    [VARIANT [OPTIONS]]]
  list-x11-keymap-models        Show known X11 keyboard mapping models
  list-x11-keymap-layouts       Show known X11 keyboard mapping layouts
  list-x11-keymap-variants      Show known X11 keyboard mapping variants
    [LAYOUT]
  list-x11-keymap-options       Show known X11 keyboard mapping options

Options:
  -h --help                     Show this help
     --version                  Show package version
  -l --full                     Do not ellipsize output
     --no-pager                 Do not start a pager
     --no-ask-password          Do not prompt for password
  -H --host=[USER@]HOST         Operate on remote host
  -M --machine=CONTAINER        Operate on local container
     --no-convert               Don't convert keyboard mappings

See the localectl(1) man page for details.
===============================================================================

But I think this is OK. Everything is readable. On a more normal terminal,
everything fits nicely.

Co-developed-by: Claude Opus 4.6 <noreply@anthropic.com>
2 weeks agokernel-install: convert to the new option and verb parsers
Zbigniew Jędrzejewski-Szmek [Thu, 16 Apr 2026 08:25:49 +0000 (10:25 +0200)] 
kernel-install: convert to the new option and verb parsers

The verb synopses are very long because of the many parameters.
Previously were shown without help and occupied all available columns.
With the autogenerated help format, this doesn't work great. So the
verbs and options tables are not synced, so that help for options can
use more columns. I think in this case this is better than the
alternatives.

Co-developed-by: Claude Opus 4.6 <noreply@anthropic.com>
2 weeks agocgroup: Add CPUSetPartition= setting (#42013)
Luca Boccassi [Thu, 14 May 2026 12:10:13 +0000 (13:10 +0100)] 
cgroup: Add CPUSetPartition= setting (#42013)

Add support for configuring cpuset partition type via the
CPUSetPartition= unit file setting. This controls the kernel's
cpuset.cpus.partition cgroup attribute.

The setting takes one of "member", "root", or "isolated". This is
useful for real-time workloads that require dedicated CPU resources
without interference from other processes.

When set, systemd will write the partition type to the
cpuset.cpus.partition cgroup file. If the kernel rejects the value
(e.g., due to partition hierarchy rules), a warning is logged and the
unit continues with the kernel's default partition type.

Co-developed-by: Claude Sonnet 4.5 <noreply@anthropic.com>
Signed-off-by: Gabriele Monaco <gmonaco@redhat.com>
2 weeks agoshared/options: introduce OPTION_COMMON_{ENTRY_TOKEN,MAKE_ENTRY_DIRECTORY}
Zbigniew Jędrzejewski-Szmek [Thu, 14 May 2026 09:51:56 +0000 (11:51 +0200)] 
shared/options: introduce OPTION_COMMON_{ENTRY_TOKEN,MAKE_ENTRY_DIRECTORY}

2 weeks agoshared/verbs: split verbs in two lines when the synopsis is > 25 characters
Zbigniew Jędrzejewski-Szmek [Thu, 14 May 2026 09:23:40 +0000 (11:23 +0200)] 
shared/verbs: split verbs in two lines when the synopsis is > 25 characters

The help tests would not pass because in cases where the verb synopsis
is very long, we'd format the table badly if the terminal is fairly
narrow. I experimented with a few solutions, but overall, it's hard to
achieve very good layout with the automatic formatting. I think the
approach in this commit works the best: we end up with an two- or
three-line verb synopis, which is similar to what we did manually
before.

$ COLUMNS=80 build/localectl -h
...
Commands:
  [status]                      Show current locale settings
  set-locale LOCALE...          Set system locale
  list-locales                  Show known locales
  set-keymap MAP [MAP]          Set console and X11 keyboard mappings
  list-keymaps                  Show known virtual console keyboard mappings
  set-x11-keymap LAYOUT [MODEL  Set X11 and console keyboard mappings
    [VARIANT [OPTIONS]]]
  list-x11-keymap-models        Show known X11 keyboard mapping models
  list-x11-keymap-layouts       Show known X11 keyboard mapping layouts
  list-x11-keymap-variants      Show known X11 keyboard mapping variants
    [LAYOUT]
  list-x11-keymap-options       Show known X11 keyboard mapping options

I think that almost nobody actually uses an 80 column terminal, and if
they do, they probably don't spend too much time looking at our --help
output there. So the goal here is to do something reasonable and robust
and get the tests to pass.

We can use strjoina here because the strings are fully under our
control.

2 weeks agoshared/format-table: shorten code a bit
Zbigniew Jędrzejewski-Szmek [Fri, 24 Apr 2026 11:02:25 +0000 (13:02 +0200)] 
shared/format-table: shorten code a bit

Define variables at point of initialization so the whole thing is easier
to read.