]> git.ipfire.org Git - thirdparty/systemd.git/log
thirdparty/systemd.git
2 days agotree-wide: port various places to read_boolean_file() 41963/head
Lennart Poettering [Mon, 11 May 2026 09:48:11 +0000 (11:48 +0200)] 
tree-wide: port various places to read_boolean_file()

2 days agofileio: add new read_boolean_file() helper
Lennart Poettering [Wed, 6 May 2026 13:17:36 +0000 (15:17 +0200)] 
fileio: add new read_boolean_file() helper

2 days agofileio: teach read_one_line_file_at() XAT_FDROOT support
Lennart Poettering [Mon, 11 May 2026 09:34:22 +0000 (11:34 +0200)] 
fileio: teach read_one_line_file_at() XAT_FDROOT support

2 days agoelf-util: pass exectable path to dwfl_core_file_report
Ambareesh Balaji [Sun, 10 May 2026 23:25:13 +0000 (23:25 +0000)] 
elf-util: pass exectable path to dwfl_core_file_report

Without it, stack trace symbols fail to resolve with .gnu_debuglink
split debug info.

2 days agotest-path-util: add coverage for path edge cases
favilances [Sat, 9 May 2026 18:52:04 +0000 (21:52 +0300)] 
test-path-util: add coverage for path edge cases

Path utility helpers are used throughout systemd for validation, comparison and manipulation of filesystem paths. Add coverage for additional corner cases around absolute path detection, normalization and prefix matching so regressions in these common helpers are easier to catch.

Co-developed-by: OpenAI Codex <noreply@openai.com>
Signed-off-by: favilances <favilances@proton.me>
2 days agotest: bump TEST-58-REPART timeouts with sanitizers
Luca Boccassi [Fri, 8 May 2026 19:25:56 +0000 (20:25 +0100)] 
test: bump TEST-58-REPART timeouts with sanitizers

The test is flaky under sanitizers as the timeouts seem to be too short,
bump them like we do in other tests to try and make it more robust when
running with sanitizers

2 days agotest: fix flaky TEST-07-PID1.socket-defer.sh
Luca Boccassi [Fri, 8 May 2026 15:16:04 +0000 (16:16 +0100)] 
test: fix flaky TEST-07-PID1.socket-defer.sh

The socket's SubState transitions from 'running' to 'listening' shortly
after the triggered service becomes inactive, so the assert can race and
observe the stale 'running' state:

[ 1882.425335] systemd[1]: TEST-07-PID1-socket-defer-23279.service: Changed dead -> running
[ 1882.495150] TEST-07-PID1.sh[20535]: ++ systemctl show TEST-07-PID1-socket-defer-23279.socket -P SubState
[ 1882.514239] TEST-07-PID1.sh[20509]: + assert_eq running listening
[ 1882.510529] systemd[1]: TEST-07-PID1-socket-defer-23279.socket: Flushing socket before listening.
[ 1882.510559] systemd[1]: TEST-07-PID1-socket-defer-23279.socket: Changed running -> listening

Poll for 30s instead of directly asserting to try and make it more robust

2 days agotest: workaroud flaky TEST-53-TIMER.restart-trigger against journald cgroup attributi...
Luca Boccassi [Fri, 8 May 2026 14:09:25 +0000 (15:09 +0100)] 
test: workaroud flaky TEST-53-TIMER.restart-trigger against journald cgroup attribution race

The restart-trigger subtest occasionally fails on CI with:

    + assert_eq 0 1
    FAIL: expected: '1' actual: '0'

even though the timer fires correctly and the echo message is in fact
written to the journal. The failure happens because the test relies on
`journalctl --unit=$UNIT_NAME` to find the message, and that filter is
based on the cgroup journald looks up for the writer PID at the time
the stdout message is received.

For very short-lived processes spawned via systemd-executor (like
`echo`), that lookup is racy: the writer's `/proc/$PID/cgroup` can
still resolve to `/init.scope` (systemd-executor's own cgroup) rather
than the service's cgroup, so the message ends up attributed to
`init.scope` and `--unit=` filtering misses it.

    __CURSOR=s=6f90ff5b6a0e47c3a527a9b4892af965;i=f8ed;b=3dad0cc689a04781879e4dd846d24432;m=17703dc;t=6513be1be2506;x=8d3009a687724b5e
    __REALTIME_TIMESTAMP=1778167492519174
    __MONOTONIC_TIMESTAMP=24576988
    __SEQNUM=63725
    __SEQNUM_ID=6f90ff5b6a0e47c3a527a9b4892af965
    _BOOT_ID=3dad0cc689a04781879e4dd846d24432
    _HOSTNAME=H
    PRIORITY=6
    SYSLOG_FACILITY=3
    _UID=0
    _GID=0
    _CAP_EFFECTIVE=1ffffffffff
    _SYSTEMD_CGROUP=/init.scope
    _SYSTEMD_UNIT=init.scope
    _SYSTEMD_SLICE=-.slice
    _EXE=/usr/lib/systemd/systemd-executor
    _TRANSPORT=stdout
    _COMM=18
    _MACHINE_ID=89ef83adc0bc4a33a83a227201b57203
    _RUNTIME_SCOPE=system
    _PID=816
    _CMDLINE=/usr/lib/systemd/systemd-executor --deserialize 50 --log-level debug,console:info --log-target journal-or-kmsg
    _STREAM_ID=8e8e4166c99e40afaa58bcd04a50a7f4
    SYSLOG_IDENTIFIER=echo
    MESSAGE=Hello from timer 29581

Note _SYSTEMD_UNIT=init.scope / _SYSTEMD_CGROUP=/init.scope on the
echo output: this is what causes `--unit=timer-restart-14362` to
return 0 hits. The test failure logs from the same run confirm this:

    + JOURNAL_TS=1778160292
    + journalctl -p info --since=@1778160292 --unit=timer-restart-14362 '--grep=Hello from timer 29581'
    -- No entries --
    + systemctl restart timer-restart-14362.timer
    ...
    + date '--set=+2 hours'
    Thu May  7 15:24:52 UTC 2026
    + sleep 1
    ...
    echo[816]: Hello from timer 29581
    ...
    ++ journalctl -q -p info --since=@1778160292 --unit=timer-restart-14362 '--grep=Hello from timer 29581'
    ++ wc -l
    + assert_eq 0 1
    FAIL: expected: '1' actual: '0'

For comparison, in a passing local run the same message is attributed
correctly to the service unit (_SYSTEMD_UNIT=timer-restart-24147.service),
so `--unit=` matches.

Work around the underlying journald race in the test by setting an
explicit `SyslogIdentifier=` on the service and matching with `-t` plus
the unique grep pattern: `SyslogIdentifier` is carried over the stdout
stream protocol and is not affected by the cgroup lookup race.

Co-developed-by: Claude Opus 4.7 <noreply@anthropic.com>
2 days agotest: make TEST-07-PID1.user-namespace-path more robust (#42001)
Christian Brauner [Mon, 11 May 2026 08:16:12 +0000 (10:16 +0200)] 
test: make TEST-07-PID1.user-namespace-path more robust (#42001)

The test occasionally fails because lsns returns empty output for the
transient unit, even though the process is running. e.g.:

```
    [ 1843.556046] TEST-07-PID1.sh[8560]: + systemd-run --unit=newservice --property=Type=exec --property=UserNamespacePath=/proc/8608/ns/user --property=NetworkNamespacePath=/proc/8608/ns/net sleep 3600
    [ 1844.205927] TEST-07-PID1.sh[8616]: ++ systemctl show newservice -p MainPID
    [ 1844.221425] TEST-07-PID1.sh[8618]: ++ lsns -p 8608 -o NS -t net -n
    [ 1844.229653] TEST-07-PID1.sh[8619]: ++ lsns -p 8614 -o NS -t net -n
    [ 1844.235563] TEST-07-PID1.sh[8620]: FAIL: expected: '' actual: '4026532522'
```

This could be a race, so switch to Type=notify to try and make it more
robust.

eg:
https://github.com/systemd/systemd/actions/runs/25485775345/job/74780837128?pr=41974

4 days agohwdb/keyboard: fix KP_Enter on Clevo PA70ES
Matheus Afonso Martins Moreira [Sat, 9 May 2026 11:53:01 +0000 (08:53 -0300)] 
hwdb/keyboard: fix KP_Enter on Clevo PA70ES

The ITE keyboard controller firmware (version 0xAB83) is shared
between the Clevo PA70ES and the X+ piccolo series.

The piccolo's hwdb rule matches by input device ID
(evdev:input:b0011v0001p0001eAB83*) and remaps scan code 0x9c
(KP_Enter) to Enter, since the piccolo has no numpad and its
main Enter key sends the wrong scan code.

The Clevo PA70ES has a real numpad. The piccolo rule matches it
because both laptops use the same ITE controller firmware, which
breaks KP_Enter on the PA70ES.

Add a DMI-specific override that restores KEY_KPENTER for 0x9c
on the PA70ES.

The piccolo rule should ideally be narrowed to use DMI matching
instead of input device ID to avoid catching other laptops with
the same ITE controller firmware.

4 days agopo: Translated using Weblate (Romanian)
Petru Rebeja [Sat, 9 May 2026 05:59:10 +0000 (05:59 +0000)] 
po: Translated using Weblate (Romanian)

Currently translated at 68.7% (183 of 266 strings)

Co-authored-by: Petru Rebeja <petru@rebeja.eu>
Translate-URL: https://translate.fedoraproject.org/projects/systemd/main/ro/
Translation: systemd/main

4 days agotmpfiles: Add commands for file capabilites
Valentin David [Sat, 28 Mar 2026 18:48:36 +0000 (19:48 +0100)] 
tmpfiles: Add commands for file capabilites

4 days agoman/tmpfiles: fix missing 'as' in %t details column
Todd Zullinger [Fri, 8 May 2026 23:12:43 +0000 (19:12 -0400)] 
man/tmpfiles: fix missing 'as' in %t details column

This was missing when the details were added in 5a8575ef013 (tmpfiles:
also add %t/%S/%C/%L specifiers, 2017-11-23).

5 days agomkosi: drop libucontext again
Daan De Meyer [Fri, 8 May 2026 19:28:36 +0000 (21:28 +0200)] 
mkosi: drop libucontext again

Turns out it's possible to implement fibers without unnecessary
system calls and without ucontext.h so there's no need for libucontext
anymore, so drop it from the package list.

5 days agoman: update Fedora image name in vmspawn example
albertescanes [Fri, 8 May 2026 13:43:34 +0000 (15:43 +0200)] 
man: update Fedora image name in vmspawn example

Update the Fedora Cloud image name to the current one and use
importctl instead of machinectl.

5 days agoConvert userdbctl to option macros (#41991)
Zbigniew Jędrzejewski-Szmek [Fri, 8 May 2026 21:34:24 +0000 (23:34 +0200)] 
Convert userdbctl to option macros (#41991)

5 days agotest: make TEST-07-PID1.user-namespace-path more robust 42001/head
Luca Boccassi [Fri, 8 May 2026 17:02:40 +0000 (18:02 +0100)] 
test: make TEST-07-PID1.user-namespace-path more robust

The test occasionally fails because lsns returns empty output for
the transient unit, even though the process is running. e.g.:

    [ 1843.556046] TEST-07-PID1.sh[8560]: + systemd-run --unit=newservice --property=Type=exec --property=UserNamespacePath=/proc/8608/ns/user --property=NetworkNamespacePath=/proc/8608/ns/net sleep 3600
    [ 1844.205927] TEST-07-PID1.sh[8616]: ++ systemctl show newservice -p MainPID
    [ 1844.221425] TEST-07-PID1.sh[8618]: ++ lsns -p 8608 -o NS -t net -n
    [ 1844.229653] TEST-07-PID1.sh[8619]: ++ lsns -p 8614 -o NS -t net -n
    [ 1844.235563] TEST-07-PID1.sh[8620]: FAIL: expected: '' actual: '4026532522'

This could be a race, so switch to Type=notify to try and make it more robust.

5 days agouserdbctl: fix erroneous errno 41991/head
Zbigniew Jędrzejewski-Szmek [Fri, 8 May 2026 15:25:41 +0000 (17:25 +0200)] 
userdbctl: fix erroneous errno

Fixes 1604937f83d3154fb1c3b5ef053f7fccd0825ce6.

5 days agotest: add missing varlink IDL enum tests for Job and ServiceType
Ivan Kruglov [Thu, 7 May 2026 09:16:51 +0000 (02:16 -0700)] 
test: add missing varlink IDL enum tests for Job and ServiceType

PR #41583 (io.systemd.Unit.StartTransient) introduced several new varlink IDL enum types without corresponding enum consistency tests:

- JobType, JobState, JobResult in the new io.systemd.Job interface
- ServiceType in the Unit interface's ServiceContext

Add a new test-varlink-idl-job test file covering all three Job enums, and add ServiceType coverage to the existing test-varlink-idl-unit test. Export vl_type_ServiceType (was static) so it can be referenced from the test.

Co-developed-by: Claude Opus 4.6 <noreply@anthropic.com>
5 days agomachine: require normalized paths in Copy* D-Bus/Varlink methods
Frantisek Sumsal [Thu, 7 May 2026 10:59:18 +0000 (12:59 +0200)] 
machine: require normalized paths in Copy* D-Bus/Varlink methods

Also, do the same for the Varlink BindMount method, since its D-Bus
counterpart already does it.

5 days agouserdbctl: actually implement option parsing stop after --chain
Zbigniew Jędrzejewski-Szmek [Fri, 8 May 2026 13:47:18 +0000 (15:47 +0200)] 
userdbctl: actually implement option parsing stop after --chain

The basic idea is that --chain should stop option parsing. But
previously this didn't work, so --chain could be specified anywhere
in the command line. To maintain with compatibility with that,
allow --chain to be specified anywhere until the first positional
arg or option in the command string. This allows options to be passed
in the expected fashion:
  userdbctl --chain ssh-authorized-keys user cmd --opt1 --opt2
  userdbctl --chain ssh-authorized-keys user -- cmd --opt1 --opt2
but also allows the invocations which worked previously:
  userdbctl ssh-authorized-keys user --chain cmd
  userdbctl ssh-authorized-keys user cmd --chain

Fixes 8072a7e6a9eaf2de120797dd16c5e0baea606219.

The error messages are extended a bit. "binary path" is misleading:
we support all kinds of executables, not only compiled programs.

5 days agouserdbctl: convert to OPTION and VERB macros
Zbigniew Jędrzejewski-Szmek [Fri, 8 May 2026 06:25:10 +0000 (08:25 +0200)] 
userdbctl: convert to OPTION and VERB macros

The situation with --chain is complicated. The old code tried to use "+…"
in getopt_long() to stop option parsing. But it didn't actually work.
This logic was originally added in 8072a7e6a9eaf2de120797dd16c5e0baea606219.
ef9c12b157a50d63e8a8eb710c013d16c2cea319 added an comment about 'optind=0'
which explains why the code doesn't work, but the code wasn't changed.

To wit:
$ userdbctl.old --no-pager --chain ssh-authorized-keys zbyszek -- /bin/echo --asdf
--asdf
$ userdbctl.old --no-pager --chain ssh-authorized-keys zbyszek /bin/echo -- --asdf
--asdf
$ userdbctl.old --no-pager --chain ssh-authorized-keys zbyszek /bin/echo --asdf
userdbctl.old: unrecognized option '--asdf'
(Basically, if "--" is used, it can be anywhere, since getopt_long() doesn't do
anything special after --chain and looks for the next option. There were some
tests of --chain, but they all used the username as the positional argument, so
it wasn't misinterpreted as an option.)

This behaviour is preserved in the conversion.

--help is generally the same except for expected formatting changes.
--json= is moved above between --output= and -j. For some reason it was
further down.

Co-developed-by: Claude Opus 4.7 <noreply@anthropic.com>
5 days agotest: try to make TEST-04-JOURNAL.journalctl-varlink less flaky
Luca Boccassi [Wed, 6 May 2026 18:57:19 +0000 (19:57 +0100)] 
test: try to make TEST-04-JOURNAL.journalctl-varlink less flaky

The io.systemd.JournalAccess server occasionally returns NoEntries for a
unit-filter query right after the unit logged its message, e.g. from a
failing CI run:

 [ 1204.967910] TEST-04-JOURNAL.sh[15025]: ++ varlinkctl call --more /run/systemd/io.systemd.JournalAccess io.systemd.JournalAccess.GetEntries '{"units": ["test-journalctl-varlink-1-13583.service", "test-journalctl-varlink-2-25039.service"]}'
 [ 1205.017361] journalctl[15026]: varlink-3-3: Received message: {"method":"io.systemd.JournalAccess.GetEntries","parameters":{"units":["test-journalctl-varlink-1-13583.service","test-journalctl-varlink-2-25039.service"]},"more":true}
 [ 1205.017498] journalctl[15026]: Failed to open journal file /var/log/journal/ce54feb228124e639f3b7779beeaff60/system.journal: No data available
 [ 1205.017823] journalctl[15026]: varlink-3-3: Sending message: {"error":"io.systemd.JournalAccess.NoEntries"}
 [ 1205.017936] TEST-04-JOURNAL.sh[15025]: Method call failed: io.systemd.JournalAccess.NoEntries
 [ 1205.499083] TEST-04-JOURNAL.sh[146]: Subtest /usr/lib/systemd/tests/testdata/units/TEST-04-JOURNAL.journalctl-varlink.sh failed

Wrap the calls that expect data in a helper that retries up to 3 times on
NoEntries, syncing the journal between attempts.

Follow-up for a109189fabe6a4c307528459f891c2d545361622

Co-developed-by: Claude Opus 4.7 <noreply@anthropic.com>
5 days agouserdbctl: split out parse_from_file()
Zbigniew Jędrzejewski-Szmek [Thu, 7 May 2026 20:55:00 +0000 (22:55 +0200)] 
userdbctl: split out parse_from_file()

parse_from_file doesn't set arg_from_file itself, but returns a
sd_json_variant ref to the caller. I think the change of arg_from_file
is more readable with this structure.

5 days agoAdd json_variant_unref_and_replace and use it where appropriate
Zbigniew Jędrzejewski-Szmek [Thu, 7 May 2026 20:53:27 +0000 (22:53 +0200)] 
Add json_variant_unref_and_replace and use it where appropriate

JSON_VARIANT_REPLACE is similar, but doesn't try to nullify the second
arg, so it can be used with an inline expression.

5 days agohwdb: add force-release to Nitro AN515-58 backlight keys
Dirga Yuza [Fri, 8 May 2026 00:10:40 +0000 (07:10 +0700)] 
hwdb: add force-release to Nitro AN515-58 backlight keys

This fixes an incomplete mapping introduced in PR #39769 for the Acer
Nitro 5 AN515-58.

The previous PR mapped the physical keyboard backlight keys (scancodes
`0xef` and `0xf0`) to `kbdillumup` and `kbdillumdown` to prevent them
from dropping screen brightness.

However, the embedded controller on this Acer model only emits "make"
(press) scancodes and fails to emit "break" (release) scancodes for
these specific keys. Without a release event, the input subsystem
registers the keys as continously held down (auto-repeat). In desktop
environments like KDE Plasma, pressing the key once causes the
brightness UI slider to get stuck in an infinite adjustment loop.

This issue is previously unnoticed as this model did not expose any
keyboard backlight control.

The fix is done by prepending the `!` (force-release) flag to the
keycodes. This instructs `evdev` to synthesize a key
release event.

The fix is verified locally on an Acer Nitro AN515-58. `evtest` now
correctly reports `value 1` immediately followed by `value` 0, and KDE
Plasma brightness OSD no longer gets stuck.

Signed-off-by: Dirga Yuza <dirgayuza123@gmail.com>
5 days agosd-dhcp-client: avoid taking and dropping a reference
Zbigniew Jędrzejewski-Szmek [Thu, 7 May 2026 20:34:11 +0000 (22:34 +0200)] 
sd-dhcp-client: avoid taking and dropping a reference

The helper would create a new ref, even though we had one handy
and didn't need to create a new ref. So change the helper to
take an existing reference.

5 days agotree-wide: rename unref_and_replace_full to unref_and_replace_new_ref
Zbigniew Jędrzejewski-Szmek [Thu, 7 May 2026 19:43:32 +0000 (21:43 +0200)] 
tree-wide: rename unref_and_replace_full to unref_and_replace_new_ref

We have a number of *_unref_and_replace macros. One could think that
they are like the various free_and_replace variants, but they actually
create a new ref to the passed object. The free_and_replace variants
take ownership of the argument. This inconsistency is surprising. Rename
all those functions to have "_new_ref" at the end to make the difference
clear.

6 days agoConvert resolvectl to option and verb macros (#41978)
Daan De Meyer [Thu, 7 May 2026 19:03:38 +0000 (21:03 +0200)] 
Convert resolvectl to option and verb macros (#41978)

This was one quite involved because some preparatory work was needed and
there are three parsers in the same binary.

6 days agoresolvconf-compat: convert to OPTION macros 41978/head
Zbigniew Jędrzejewski-Szmek [Thu, 7 May 2026 11:54:12 +0000 (13:54 +0200)] 
resolvconf-compat: convert to OPTION macros

Use the "resolvconf" namespace to keep these options separate from the
resolvectl/systemd-resolve sets.

Co-developed-by: Claude Opus 4.7 <noreply@anthropic.com>
6 days agoresolvectl: convert to OPTION and VERB macros
Zbigniew Jędrzejewski-Szmek [Thu, 7 May 2026 07:57:43 +0000 (09:57 +0200)] 
resolvectl: convert to OPTION and VERB macros

Use OPTION_NAMESPACE() to keep the resolvectl and systemd-resolve
option sets separate. The resolvconf-compat path (resolvconf
invocation) keeps its own getopt-based parsing.

--help output has the expected changes to formatting. Synopis
for [status] is now shows that the verb is optional.

Co-developed-by: Claude Opus 4.7 <noreply@anthropic.com>
6 days agoshared/verbs: when showing default verb, put [] around the args too
Zbigniew Jędrzejewski-Szmek [Thu, 7 May 2026 11:38:04 +0000 (13:38 +0200)] 
shared/verbs: when showing default verb, put [] around the args too

The verb cannot be omitted but the args kept, so:
  resolvectl [status] [link]
is wrong, we need:
  resolvectl [status [link]]

Fixes f94da4b4c564f8cff4b5b739456c985e036a4201.

6 days agoresolvectl: move verb implementations to match order in --help
Zbigniew Jędrzejewski-Szmek [Thu, 7 May 2026 07:31:28 +0000 (09:31 +0200)] 
resolvectl: move verb implementations to match order in --help

6 days agoresolvectl: move things around in --help
Zbigniew Jędrzejewski-Szmek [Thu, 7 May 2026 07:30:37 +0000 (09:30 +0200)] 
resolvectl: move things around in --help

Move the "display options" to the end of both --help strings and then
reorder the implementation to match.

6 days agoresolvectl: split out parse_protocol
Zbigniew Jędrzejewski-Szmek [Wed, 6 May 2026 12:41:08 +0000 (14:41 +0200)] 
resolvectl: split out parse_protocol

6 days agoConvert more programs to option+verb macros (#41974)
Daan De Meyer [Thu, 7 May 2026 16:02:09 +0000 (18:02 +0200)] 
Convert more programs to option+verb macros (#41974)

Just a handful are left! This is one of the final batches.

6 days agotest: fix flaky testcase_15_wait_online_dns in TEST-75-RESOLVED
Luca Boccassi [Wed, 6 May 2026 17:04:51 +0000 (18:04 +0100)] 
test: fix flaky testcase_15_wait_online_dns in TEST-75-RESOLVED

The test used `timeout 30 bash -c "journalctl -b -u $unit -f | grep -m1 ..."`
to wait for systemd-networkd-wait-online to log that no DNS server is
accessible. The expected message is actually emitted ~1s after the unit
starts, but `grep -m1` exiting doesn't tear down `journalctl -f`: journalctl
only notices the closed pipe on its next write, which may never happen for
an otherwise idle unit. The pipeline therefore hangs until the 30s timeout
fires, eventually causing the test to fail.

Replace the follow+pipe with a polling `journalctl --grep` loop, which
exits cleanly as soon as the message lands in the journal.

Logs from the failing run:

  [ 2650.871441] systemd-networkd-wait-online[2190]: dns0: No DNS configuration yet
  [ 2651.723180] systemd-networkd-wait-online[2190]: dns0: No DNS server is accessible.
  [ 2680.909048] systemd-networkd-wait-online[2190]: json-stream: Got POLLHUP from socket.
  [ 2680.909092] systemd-networkd-wait-online[2190]: DNS configuration monitor disconnected, reconnecting...
  [ 2680.914368] systemd-networkd-wait-online[2190]: Failed to connect to io.systemd.Resolve.Monitor: Connection refused
  [ 2681.966674] systemd-networkd-wait-online[2190]: dns0: No DNS server is accessible.
  [ 2681.969527] systemd-networkd-wait-online[2190]: Failed to connect to io.systemd.Resolve.Monitor: Connection refused
  [ 2682.077032] systemd[1]: Stopping wait-online-dns-0f9e4f6d-8b34-4cff-b2da-03612ca731e8.service - [systemd-run] /usr/lib/systemd/systemd-networkd-wait-online --timeout=0 --dns --interface=dns0...

Co-developed-by: Claude Opus 4.7 <noreply@anthropic.com>
6 days agomount: stop showing mount options for systemd-unmount 41974/head
Zbigniew Jędrzejewski-Szmek [Wed, 6 May 2026 12:24:37 +0000 (14:24 +0200)] 
mount: stop showing mount options for systemd-unmount

This only serves to confuse the user.

6 days agomount: convert to OPTION macros
Zbigniew Jędrzejewski-Szmek [Wed, 6 May 2026 11:59:44 +0000 (13:59 +0200)] 
mount: convert to OPTION macros

Previously, we'd show a partial synopsis for systemd-mount
in --help for systemd-umount. I don't think it makes sense to do that.
So now the --help for systemd-umount is separate, with just its syntax
and a new blurb.

"transiently" is dropped from the description. Mount points generally
are transient, so no need to say that. (E.g. the man page for mount just
says "attach" and "detach".)

Co-developed-by: Claude Opus 4.7 <noreply@anthropic.com>
6 days agocoredumpctl: convert to OPTION and VERB macros
Zbigniew Jędrzejewski-Szmek [Wed, 6 May 2026 11:39:25 +0000 (13:39 +0200)] 
coredumpctl: convert to OPTION and VERB macros

The order of options is changed (to what was present in parse_argv).
I don't the order in --help was mostly random, as is the new one,
so I didn't try to preserve the old order. Some help strings are
reworded/adjusted.

Co-developed-by: Claude Opus 4.7 <noreply@anthropic.com>
6 days agoreport-cgroup-server: convert to OPTION macros
Zbigniew Jędrzejewski-Szmek [Tue, 5 May 2026 16:23:55 +0000 (18:23 +0200)] 
report-cgroup-server: convert to OPTION macros

Co-developed-by: Claude Opus 4.7 <noreply@anthropic.com>
6 days agoportablectl: actually allow set-limit with one arg
Zbigniew Jędrzejewski-Szmek [Thu, 7 May 2026 11:07:52 +0000 (13:07 +0200)] 
portablectl: actually allow set-limit with one arg

In the man page and in the actual code, the first arg is
optional. But the arg limit in the verbs table did not allow
only one arg to be specified.

Fixes: 61d0578b07b97cbffebfd350bac481274e310d39
6 days agovmspawn: search XDG_DATA_DIRS for QEMU firmware
Paul Meyer [Wed, 6 May 2026 15:35:48 +0000 (17:35 +0200)] 
vmspawn: search XDG_DATA_DIRS for QEMU firmware

get_firmware_search_dirs() previously hardcoded /usr/share/qemu/firmware
as the only system-wide search path. That assumption breaks on
distributions that deliberately do not populate /usr/share, making
vmspawn fail: "Failed to find OVMF config: No such file or directory".
NixOS exposes those firmware locations through XDG_DATA_DIRS.

Extend the search list with XDG_DATA_HOME/XDG_DATA_DIRS. This is the
standard XDG mechanism and is already what QEMU itself uses for the same
descriptors, so behavior matches user expectations across tooling.

To avoid regressing setups where user has set XDG_DATA_DIRS to a custom
value that omits /usr/share, keep /usr/share/qemu/firmware as an
unconditional fallback.

Precedence is unchanged: XDG_CONFIG_HOME/qemu/firmware still wins
over /etc/qemu/firmware, which still wins over any shared-data dir.

Co-developed-by: Claude Opus 4.7 <noreply@anthropic.com>
Signed-off-by: Paul Meyer <katexochen0@gmail.com>
7 days agohwdb: add Fn-key mappings for MSI GE76 Raider 10UG
Nita Vesa [Wed, 6 May 2026 16:37:14 +0000 (19:37 +0300)] 
hwdb: add Fn-key mappings for MSI GE76 Raider 10UG

7 days agodbus: limit the number of env variables to something reasonable, vol. 3
Frantisek Sumsal [Wed, 6 May 2026 12:03:29 +0000 (14:03 +0200)] 
dbus: limit the number of env variables to something reasonable, vol. 3

Let's limit the number of environment variables when creating a
transient unit via StartTransientUnit as well, since validating the
environment variable names/assignments is expensive.

Follow-up for 49c1e1bcf2b482b6de35a4212a06ed1d8c382745.

7 days agovmspawn: reject --bind-volume= duplicates at parse time (#41961)
Christian Brauner [Wed, 6 May 2026 14:46:42 +0000 (16:46 +0200)] 
vmspawn: reject --bind-volume= duplicates at parse time (#41961)

bind_volume_parse() does not look at peers, so passing the same
PROVIDER:VOLUME twice on the command line silently produces two parsed
entries in arg_bind_volumes. vmspawn_bind_volume_acquire() then builds
two DriveInfo with identical d->id ("<provider>:<volume>"). At boot,
bridge_register_drive() puts d->id into the b->block_devices hashmap;
the second insert returns -EEXIST and the user sees a bare "File exists"
with no context for which volume is responsible.

Reject the collision at the parse site with a linear scan over the
existing array — n_items is small (one entry per --bind-volume on the
command line), and a clear error message naming the offending volume is
much more useful than the late EEXIST from the QMP setup loop.

7 days agoupdate TODO
Lennart Poettering [Wed, 6 May 2026 12:46:19 +0000 (14:46 +0200)] 
update TODO

7 days agovmspawn: reject --bind-volume= duplicates at parse time 41961/head
Christian Brauner [Wed, 6 May 2026 10:40:26 +0000 (12:40 +0200)] 
vmspawn: reject --bind-volume= duplicates at parse time

bind_volume_parse() does not look at peers, so passing the same
PROVIDER:VOLUME twice on the command line silently produces two parsed
entries in arg_bind_volumes. vmspawn_bind_volume_acquire() then builds
two DriveInfo with identical d->id ("<provider>:<volume>"). At boot,
bridge_register_drive() puts d->id into the b->block_devices hashmap;
the second insert returns -EEXIST and the user sees a bare "File
exists" with no context for which volume is responsible.

Reject the collision at the parse site with a linear scan over the
existing array — n_items is small (one entry per --bind-volume on the
command line), and a clear error message naming the offending volume
is much more useful than the late EEXIST from the QMP setup loop.

Signed-off-by: Christian Brauner (Amutable) <brauner@kernel.org>
7 days agoshared/pager: add support for more(1) pager in secure mode (#41503)
Lennart Poettering [Wed, 6 May 2026 12:30:29 +0000 (14:30 +0200)] 
shared/pager: add support for more(1) pager in secure mode (#41503)

The more(1) pager (part of util-linux) now supports secure mode,
which can be enabled with the MORESECURE environment variable.

Adding support for more(1) in secure mode serves as an alternative
for systems that do not have less installed or for users who prefer
it.

Commit d2fce960f9cac740 introduced secure mode in more(1) and the
new feature is available in version 2.42 of util-linux.

7 days agoportablectl: convert to OPTION and VERB macros
Zbigniew Jędrzejewski-Szmek [Tue, 5 May 2026 12:36:12 +0000 (14:36 +0200)] 
portablectl: convert to OPTION and VERB macros

s|attach/detach from the local system|in the local system|, because
"attach from" doesn't work.

The synopses for 'list' and 'set-limit' are fixed.

Co-developed-by: Claude Opus 4.7 <noreply@anthropic.com>
7 days agoportablectl: reorder verb functions
Zbigniew Jędrzejewski-Szmek [Wed, 6 May 2026 10:54:12 +0000 (12:54 +0200)] 
portablectl: reorder verb functions

The order in --help is changed to move have 'list', 'inspect' (query
operations), 'attach'/'detach'/'reattach' (main ops), and then the
other more specialized verbs.

The functions are then reordered to match this.

7 days agoAnother batch of conversions to option and verb macros (#41881)
Zbigniew Jędrzejewski-Szmek [Wed, 6 May 2026 10:39:36 +0000 (12:39 +0200)] 
Another batch of conversions to option and verb macros (#41881)

7 days agofs-util: Some followups for xopenat_full() (#41835)
Christian Brauner [Wed, 6 May 2026 10:35:55 +0000 (12:35 +0200)] 
fs-util: Some followups for xopenat_full() (#41835)

7 days agovmspawn,machinectl: integrate io.systemd.StorageProvider (#41910)
Christian Brauner [Wed, 6 May 2026 10:20:26 +0000 (12:20 +0200)] 
vmspawn,machinectl: integrate io.systemd.StorageProvider (#41910)

PR #41776 introduced the io.systemd.StorageProvider Varlink interface
and
two backends ('block' exposes host block devices, 'fs' exposes regular
files / dirs / subvolumes under /var/lib/storage), plus the
storagectl(1)
CLI to enumerate them. The only consumer so far was mount.storage. This
series wires up the first of the three integrations called out in
TODO.md:

  systemd-vmspawn --bind-volume=PROVIDER:VOLUME[:CONFIG][:K=V,...]
      Boot-time attach. Drives added this way are immutable at runtime.

  io.systemd.MachineInstance.AddStorage  / .RemoveStorage
      Two new generic methods on the per-machine control socket. vmspawn
      implements them (this series); systemd-nspawn will reuse the same
      methods later.

  machinectl bind-volume   MACHINE PROVIDER:VOLUME[:CONFIG][:K=V,...]
  machinectl unbind-volume MACHINE PROVIDER:VOLUME
Runtime hotplug front-end: machinectl Acquire()s the fd locally and
      pushes it across to the target machine's MachineInstance socket.

Volumes are identified by a user-visible name "<provider>:<volume>"
(e.g.
"block:/dev/sda"). The 3rd 'config' field is opaque to the shared layer
and interpreted per backend — vmspawn maps it to a DiskType from
disk_type_table[] (virtio-blk default, virtio-scsi, nvme, scsi-cd; same
vocabulary as --extra-drive); future nspawn will read it as a mount
path.

7 days agodocs,test: --bind-volume / bind-volume / unbind-volume 41910/head
Christian Brauner [Fri, 1 May 2026 11:38:12 +0000 (13:38 +0200)] 
docs,test: --bind-volume / bind-volume / unbind-volume

  - Document the new --bind-volume= option in systemd-vmspawn(1) and
    the new bind-volume / unbind-volume verbs in machinectl(1).

  - Add an integration test
    (TEST-87-AUX-UTILS-VM.bind-volume.sh) covering boot-time attach
    via --bind-volume, runtime attach via 'machinectl bind-volume',
    runtime detach via 'machinectl unbind-volume', the StorageImmutable
    rejection of attempts to detach boot-time volumes, and the
    NoSuchStorage rejection of detach on unknown names.

  - Strike "hook-up in systemd-vmspawn" from TODO.md; the nspawn and
    service-manager hookups remain.

Signed-off-by: Christian Brauner (Amutable) <brauner@kernel.org>
7 days agomachinectl: add bind-volume / unbind-volume verbs
Christian Brauner [Fri, 1 May 2026 11:37:33 +0000 (13:37 +0200)] 
machinectl: add bind-volume / unbind-volume verbs

  machinectl bind-volume MACHINE PROVIDER:VOLUME[:CONFIG][:K=V,...]
  machinectl unbind-volume MACHINE PROVIDER:VOLUME

For bind-volume, machinectl parses the SPEC with the shared
bind_volume_parse(), Acquires the storage volume from the named
provider on the machinectl side, locates the target machine's
io.systemd.MachineInstance control socket via
machine_get_control_address(), pushes the fd across, and calls
io.systemd.MachineInstance.AddStorage with name='<provider>:<volume>'
and the user-supplied config string.

For unbind-volume, machinectl just forwards the name string to
io.systemd.MachineInstance.RemoveStorage.

Volumes attached at machine startup (e.g. via systemd-vmspawn's
--bind-volume=) are rejected with StorageImmutable when the user
attempts to unbind them at runtime.

Signed-off-by: Christian Brauner (Amutable) <brauner@kernel.org>
7 days agovmspawn: implement io.systemd.MachineInstance.AddStorage / RemoveStorage
Christian Brauner [Fri, 1 May 2026 11:36:21 +0000 (13:36 +0200)] 
vmspawn: implement io.systemd.MachineInstance.AddStorage / RemoveStorage

Wire up the runtime hotplug Varlink methods on the per-VM control
socket:

  AddStorage  → take fd from the link, look up the DiskType from the
                'config' field, build a DriveInfo flagged
                QMP_DRIVE_REMOVABLE, dispatch to
                vmspawn_qmp_add_block_device(). Reply delivered async
                by on_add_device_add_complete() once the guest sees
                the device.

  RemoveStorage → forward the user-visible name to
                  vmspawn_qmp_remove_block_device(); the existing
                  device_del / DEVICE_DELETED / blockdev-del chain
                  replies on the link.

Add SD_VARLINK_SERVER_ALLOW_FD_PASSING_INPUT to the server flags so
clients can push storage fds across via sd_varlink_push_fd().

Maps -EEXIST → StorageExists and -EOPNOTSUPP/-EINVAL →
ConfigNotSupported in the AddStorage handler so callers see the
specific MachineInstance errors.

Signed-off-by: Christian Brauner (Amutable) <brauner@kernel.org>
7 days agovmspawn: add --bind-volume= command line option
Christian Brauner [Fri, 1 May 2026 11:35:44 +0000 (13:35 +0200)] 
vmspawn: add --bind-volume= command line option

  systemd-vmspawn --bind-volume=PROVIDER:VOLUME[:CONFIG][:K=V,...]

For each --bind-volume passed at startup, vmspawn calls Acquire() on
the named StorageProvider and attaches the resulting fd to the VM as
an additional drive. The drive is identified by the user-visible name
'<provider>:<volume>' on the bridge — that is also the handle used
later when machinectl unbind-volume detaches drives at runtime
(though boot-time drives like these are NOT removable; that is the
StorageImmutable behaviour added earlier).

The colon grammar is parsed by the shared bind_volume_parse() helper.
The 3rd 'config' field selects the guest device type from the
disk_type_table[] vocabulary (virtio-blk, virtio-scsi, nvme, scsi-cd);
empty defaults to virtio-blk per the TASK grammar.

Wiring lives next to the existing --extra-drive setup: parse_argv()
appends a parsed BindVolume to arg_bind_volumes, and prepare_device_info()
hands the array to vmspawn_bind_volume_prepare_boot() which Acquires
each volume and pushes a DriveInfo onto the existing drives array.
PCIe port assignment (assign_pcie_ports()) and the QMP setup loop pick
them up automatically.

Signed-off-by: Christian Brauner (Amutable) <brauner@kernel.org>
7 days agovmspawn: add vmspawn-bind-volume glue
Christian Brauner [Fri, 1 May 2026 11:34:54 +0000 (13:34 +0200)] 
vmspawn: add vmspawn-bind-volume glue

This is vmspawn's per-backend code for the StorageProvider integration.
Other backends (future systemd-nspawn, future service-manager
BindVolume=) consume the same shared parser and Acquire helper but
each provides its own attach/detach glue; this is vmspawn's.

  - disk_type_from_bind_volume_config() turns the opaque BindVolume
    'config' field (e.g. "scsi-cd") into a DiskType. Empty defaults to
    virtio-blk to match the --bind-volume CLI grammar.

  - vmspawn_bind_volume_acquire() takes a parsed BindVolume, calls
    storage_acquire_volume() for the fd, and builds a DriveInfo ready
    for vmspawn_qmp_setup_drives() (boot) or vmspawn_qmp_add_block_device()
    (hotplug). Rejects directory-typed volumes (vmspawn block devices
    need a regular file or a host block device).

  - vmspawn_bind_volume_attach_fd() is the runtime path: takes a fd
    that was already pushed across by an AddStorage caller plus the
    name+config it specified, builds the DriveInfo with
    QMP_DRIVE_REMOVABLE set and a varlink link, and dispatches to
    vmspawn_qmp_add_block_device(). Reply is delivered asynchronously
    by the existing on_add_device_add_complete() callback.

  - vmspawn_bind_volume_prepare_boot() is a thin loop the boot-time
    path uses to populate DriveInfos.

Signed-off-by: Christian Brauner (Amutable) <brauner@kernel.org>
7 days agovmspawn: track removability as a QmpDriveFlags bit and expose add_block_device
Christian Brauner [Fri, 1 May 2026 11:34:06 +0000 (13:34 +0200)] 
vmspawn: track removability as a QmpDriveFlags bit and expose add_block_device

Drives attached at boot via the existing CLI options (--image,
--extra-drive) must not be detachable at runtime via the upcoming
RemoveStorage Varlink method, while drives added at runtime via
AddStorage must be. Track this distinction with a new QMP_DRIVE_REMOVABLE
property flag — placed alongside QMP_DRIVE_BLOCK_DEVICE, not in the
transient BlockDeviceStateFlags state-machine, since "may be removed"
is a permanent property of the drive.

vmspawn_qmp_remove_block_device() now early-rejects unknown ids with
io.systemd.MachineInstance.NoSuchStorage and immutable drives with
io.systemd.MachineInstance.StorageImmutable.

vmspawn_qmp_add_block_device() loses its 'static' qualifier and gets a
declaration in the header, so the runtime hotplug path
(vmspawn-bind-volume.c, next) can dispatch into it directly.

Signed-off-by: Christian Brauner (Amutable) <brauner@kernel.org>
7 days agoshared: add AddStorage / RemoveStorage to io.systemd.MachineInstance
Christian Brauner [Fri, 1 May 2026 11:32:58 +0000 (13:32 +0200)] 
shared: add AddStorage / RemoveStorage to io.systemd.MachineInstance

Define two new methods on the generic 'MachineInstance' Varlink
interface that systemd-vmspawn (this series) and (future)
systemd-nspawn implement on their per-machine control sockets:

  AddStorage(fileDescriptorIndex, name, config?) -> ()
      Attach a storage volume — the caller passes an fd previously
      acquired from a StorageProvider, plus a unique name of the form
      '<provider>:<volume>' that identifies this binding for later
      removal, plus a backend-specific 'config' field (vmspawn: guest
      device type; future nspawn: mount path).

  RemoveStorage(name) -> ()
      Detach a previously-added storage volume.

Plus errors NoSuchStorage, StorageExists, StorageImmutable (the volume
was attached at boot and cannot be removed), BadConfig, and
ConfigNotSupported. Names follow the io.systemd.StorageProvider
vocabulary (NoSuchVolume, BadTemplate, TypeNotSupported, etc.) so the
two interfaces are visually consistent.

Signed-off-by: Christian Brauner (Amutable) <brauner@kernel.org>
7 days agostoragectl: refactor mount.storage helper to use storage_acquire_volume()
Christian Brauner [Fri, 1 May 2026 11:32:01 +0000 (13:32 +0200)] 
storagectl: refactor mount.storage helper to use storage_acquire_volume()

Drop the inline socket-build + sd_varlink_callbo() + reply-dispatch
+ take_fd block from run_as_mount_helper() in favour of the shared
helper. Preserves the type-fallback retry (TypeNotSupported / WrongType
re-tries with requestAs="blk") and the per-error-id message mapping;
the helper just reports the io.systemd.StorageProvider.* error name
back to the caller.

Net effect: ~50 lines of dedup, no functional change.

Signed-off-by: Christian Brauner (Amutable) <brauner@kernel.org>
7 days agoshared: add storage_acquire_volume() helper
Christian Brauner [Fri, 1 May 2026 11:31:21 +0000 (13:31 +0200)] 
shared: add storage_acquire_volume() helper

storagectl's mount.storage helper bundles "open StorageProvider socket
+ Acquire() + dispatch reply + take fd" inline. Future consumers
(systemd-vmspawn boot-time --bind-volume, machinectl bind-volume) need
the same dance.

Factor it into a single libshared helper that takes the Acquire()
parameters by value and returns the fd plus the actual type/read-only
flags. Library code, so no logging — varlink errors are surfaced via
sd_varlink_error_to_errno() and the StorageProvider error_id is
returned to the caller via reterr_error_id (caller decides how to
format messages).

Signed-off-by: Christian Brauner (Amutable) <brauner@kernel.org>
7 days agoshared: add BindVolume parser in machine-util
Christian Brauner [Fri, 1 May 2026 11:32:27 +0000 (13:32 +0200)] 
shared: add BindVolume parser in machine-util

Add a universal parser for the colon-separated grammar
'PROVIDER:VOLUME[:CONFIG][:K=V,K=V,…]' that backs --bind-volume on
systemd-vmspawn (next), machinectl bind-volume, and the future nspawn
+ service-manager BindVolume= integrations.

The 'config' field is opaque to shared code and interpreted per
backend (vmspawn: a DiskType name, future nspawn: a mount path). The
trailing key=value list is parsed into the io.systemd.StorageProvider
.Acquire() parameters (template, create, read-only/ro, size/create-size
and request-as), with values validated against the existing
storage-util enums and validators. Provider/volume names are checked
with storage_provider_name_is_valid() and storage_volume_name_is_valid();
the combined "<provider>:<volume>" string is also validated as
string_is_safe so it is safe to use as a QEMU device id.

Add a test-machine-util unit test covering the happy paths plus a
handful of malformed inputs.

Signed-off-by: Christian Brauner (Amutable) <brauner@kernel.org>
7 days agoshared: move storage-util to libshared
Christian Brauner [Fri, 1 May 2026 11:29:56 +0000 (13:29 +0200)] 
shared: move storage-util to libshared

The storage backend providers (block, fs) and storagectl currently each
extract storage-util.c into their target. Several upcoming consumers
(machine-util's BindVolume parser, vmspawn's hotplug glue, machinectl's
new bind-volume verbs) need the StorageProvider type/string-table
helpers and a future shared Acquire client helper.

Move storage-util.{c,h} to src/shared so libshared exports the symbols
once and every consumer (storage providers, storagectl, libshared
itself) picks them up by linking libshared. Drop the now-redundant
'extract'/'objects' wiring in src/storage/meson.build.

No code changes; this is purely a relocation.

Signed-off-by: Christian Brauner (Amutable) <brauner@kernel.org>
7 days agouser-util,storagectl: introduce USERNS_RANGE_SIZE macro
Christian Brauner [Fri, 1 May 2026 12:58:53 +0000 (14:58 +0200)] 
user-util,storagectl: introduce USERNS_RANGE_SIZE macro

The mount.storage helper open-codes the conventional 64K UID/GID
delegation block size as 0x10000 / 0x10000U in four places. Several
other places in the tree do the same (nspawn's arg_uid_range default,
homed's mount setup, …), but with no shared name.

Add USERNS_RANGE_SIZE in user-util.h alongside UID_NOBODY and friends,
and switch storagectl over to it. Other call sites can adopt it
incrementally.

Signed-off-by: Christian Brauner (Amutable) <brauner@kernel.org>
7 days agoAdd a manual test to exercise homectl prompt logic (#41954)
Lennart Poettering [Wed, 6 May 2026 07:21:17 +0000 (09:21 +0200)] 
Add a manual test to exercise homectl prompt logic (#41954)

7 days agosd-boot: efi-log: fix `__stack_chk_guard` type
Sergei Trofimovich [Tue, 5 May 2026 20:55:30 +0000 (21:55 +0100)] 
sd-boot: efi-log: fix `__stack_chk_guard` type

In https://gcc.gnu.org/PR121911 `gcc` started enforcing the type of
`__stack_chk_guard` to `uintptr_t` and broke `systemd` build as:

```
../src/boot/efi-log.c:136:17: error: conflicting types for '__stack_chk_guard'; have 'intptr_t' {aka 'long int'}
  136 | _used_ intptr_t __stack_chk_guard = (intptr_t) 0x70f6967de78acae3;
      |                 ^~~~~~~~~~~~~~~~~
cc1: note: previous declaration of '__stack_chk_guard' with type 'long unsigned int'
../src/boot/efi-log.c:136:17: error: declaration of '__stack_chk_guard' shadows a global declaration [-Werror=shadow]
  136 | _used_ intptr_t __stack_chk_guard = (intptr_t) 0x70f6967de78acae3;
      |                 ^~~~~~~~~~~~~~~~~
```

Let's match the declaration to unsigned type as suggested by upstream in
https://gcc.gnu.org/PR121911#c6.

8 days agoCouple of coverity fixes (#41951)
Zbigniew Jędrzejewski-Szmek [Tue, 5 May 2026 20:45:13 +0000 (22:45 +0200)] 
Couple of coverity fixes (#41951)

8 days agohwdb: add SOUND_FORM_FACTOR for Edifier M60 and Fractal Scape Dongle
José Miguel Sarasola [Tue, 5 May 2026 19:20:59 +0000 (21:20 +0200)] 
hwdb: add SOUND_FORM_FACTOR for Edifier M60 and Fractal Scape Dongle

8 days agohomectl: drop redunant sort 41954/head
Zbigniew Jędrzejewski-Szmek [Tue, 5 May 2026 20:08:19 +0000 (22:08 +0200)] 
homectl: drop redunant sort

Claude points out that prompt_groups() already does the sort
in every loop, including the last.

8 days agotest-homectl-prompts: add manual test to exercise prompt functionality
Zbigniew Jędrzejewski-Szmek [Tue, 5 May 2026 11:21:30 +0000 (13:21 +0200)] 
test-homectl-prompts: add manual test to exercise prompt functionality

The prompt for groups is nice. The prompt for a shell could use some
love. Looking at this is much easier if we can invoke the code outside
in isolation.

I wrote this when looking at https://github.com/systemd/systemd/pull/41947,
where I wanted to see how the homectl prompt works with the changes.

8 days agoMerge facts into metrics and add systemd-report generate/upload (#41688)
Zbigniew Jędrzejewski-Szmek [Tue, 5 May 2026 18:55:36 +0000 (20:55 +0200)] 
Merge facts into metrics and add systemd-report generate/upload (#41688)

8 days agohomectl: split out two prompt functions
Zbigniew Jędrzejewski-Szmek [Tue, 5 May 2026 11:01:16 +0000 (13:01 +0200)] 
homectl: split out two prompt functions

homectl.c is too long…

8 days agotest: make TEST-04-JOURNAL.journalctl-varlink more robust (#41953)
Luca Boccassi [Tue, 5 May 2026 18:24:41 +0000 (19:24 +0100)] 
test: make TEST-04-JOURNAL.journalctl-varlink more robust (#41953)

This test is sometimes flaky under sanitizers, and it does repeated
calls with the same parameters to run through different greps, and
the second one sometimes fails.
Store the result and grep it twice instead to try and reduce
flakiness.

```
[ 2089.891152] TEST-04-JOURNAL.sh[22392]: + systemd-run --unit=test-journalctl-varlink-2-18237.service --wait bash -c 'echo hello-from-varlink-test-2'
[ 2090.066050] TEST-04-JOURNAL.sh[22460]: + varlinkctl call --more /run/systemd/io.systemd.JournalAccess io.systemd.JournalAccess.GetEntries '{"units": ["test-journalctl-varlink-1-22690.service"]}'
[ 2090.067075] TEST-04-JOURNAL.sh[22461]: + grep -q hello-from-varlink-test-1
[ 2090.384551] TEST-04-JOURNAL.sh[22466]: + varlinkctl call --more /run/systemd/io.systemd.JournalAccess io.systemd.JournalAccess.GetEntries '{"units": ["test-journalctl-varlink-1-22690.service"]}'
[ 2090.385373] TEST-04-JOURNAL.sh[22467]: + grep hello-from-varlink-test-2
[ 2090.723461] TEST-04-JOURNAL.sh[22474]: + grep -q hello-from-varlink-test-1
[ 2090.724294] TEST-04-JOURNAL.sh[22473]: + varlinkctl call --more /run/systemd/io.systemd.JournalAccess io.systemd.JournalAccess.GetEntries '{"units": ["test-journalctl-varlink-1-22690.service", "test-journalctl-varlink-2-18237.service"]}'
[ 2091.135655] TEST-04-JOURNAL.sh[22480]: + varlinkctl call --more /run/systemd/io.systemd.JournalAccess io.systemd.JournalAccess.GetEntries '{"units": ["test-journalctl-varlink-1-22690.service", "test-journalctl-varlink-2-18237.service"]}'
[ 2091.136605] TEST-04-JOURNAL.sh[22481]: + grep -q hello-from-varlink-test-2
[ 2091.479930] TEST-04-JOURNAL.sh[22480]: Method call failed: io.systemd.JournalAccess.NoEntries
```

8 days agohomectl: fix error handling in shell_is_ok()
Zbigniew Jędrzejewski-Szmek [Tue, 5 May 2026 16:37:13 +0000 (18:37 +0200)] 
homectl: fix error handling in shell_is_ok()

Fixes f233132a67a4c2c6dff053afac2385f570e8e3fe.

8 days agosysupdate: Ensure that end of the MatchPattern is matched correctly
Jonas Dreßler [Thu, 30 Apr 2026 18:27:43 +0000 (20:27 +0200)] 
sysupdate: Ensure that end of the MatchPattern is matched correctly

An error snuck into the pattern parsing of the `MatchPattern` key in the
sysupdate transfer files. If there's two files "part1-v2.raw", and
"part1-v2.raw.tar" in the source folder, and MatchPattern="part1-@v.raw",
sysupdate will incorrectly choose "part1-v2.raw.tar" instead of
"part1-v2.raw".

While the pattern matching works perfectly fine, after the full pattern
is successfully matched to the string, we don't ensure that the string
actually ends when the pattern just did.

This means we can end up choosing a wrong file for the update, if the
filename/path happens to start with the same MatchPattern.

Fix it by ensuring the string ends after our match pattern ended.

8 days agoreport: fold io.systemd.Basic facts into metrics 41688/head
Michael Vogt [Tue, 5 May 2026 12:55:18 +0000 (14:55 +0200)] 
report: fold io.systemd.Basic facts into metrics

We removed the concept of facts, so we need to update the existing
io.systemd.Basic facts provider to metrics. This commit does just
that. Its mostly mechanical.

This also means that facts.{c,h} and varlink-io.systemd.Facts.{c,h}
are gone now.

8 days agoreport: when a report fails, print the json error details
Michael Vogt [Wed, 29 Apr 2026 15:52:50 +0000 (17:52 +0200)] 
report: when a report fails, print the json error details

When a report upload fails the backend often provides useful
details via the varlink error. Show them as part of the upload
error message. For now we just dump the json because we have
no structure that the backends should follow. We may want to
consider adding one (like check for an "error_message" key in
the json). But for now this is a nice step forward.

8 days agoreport: set description on varlink sockets
Zbigniew Jędrzejewski-Szmek [Wed, 29 Apr 2026 09:42:00 +0000 (11:42 +0200)] 
report: set description on varlink sockets

We make multiple connections and without this it's hard to
know socket we're talking to.

8 days agoreport: upload reports using a "varlink socket directory"
Zbigniew Jędrzejewski-Szmek [Tue, 28 Apr 2026 21:55:48 +0000 (23:55 +0200)] 
report: upload reports using a "varlink socket directory"

Two new verbs are added: "generate" and "upload". The first one just
creates a "report", i.e. puts the metrics into a structured JSON object
that in the future is intended to carry additional data like a
signature:

$ build/systemd-report generate io.systemd.Manager.UnitsTotal
{
"mediaType" : "application/vnd.io.systemd.report",
"timestamp" : "Tue 2026-04-28 22:30:09 UTC",
"metrics" : [
{
"name" : "io.systemd.Manager.UnitsTotal",
"value" : 520
}
]
}

The second verb can be used to upload or otherwise process the report.
It builds on the code added in 0a8560eed873a5f89487630a19db550fdbee3c15.
In /run/systemd/metrics-upload/ we expect a set of sockets. We'll call
out to each one of them. This allows the data to be processed in custom
ways, incl. writing to storage or sending over the network.

Each socket must provide a single interface:
  io.systemd.Metrics.Upload {"report":$data}

8 days agotest: reduce number of identical io.systemd.JournalAccess.GetEntries calls 41953/head
Luca Boccassi [Tue, 5 May 2026 15:50:40 +0000 (16:50 +0100)] 
test: reduce number of identical io.systemd.JournalAccess.GetEntries calls

This test is sometimes flaky under sanitizers, and it does repeated
calls with the same parameters to run through different greps, and
the second one sometimes fails.
Store the result and grep it twice instead to try and reduce
flakiness.

[ 2089.891152] TEST-04-JOURNAL.sh[22392]: + systemd-run --unit=test-journalctl-varlink-2-18237.service --wait bash -c 'echo hello-from-varlink-test-2'
[ 2090.066050] TEST-04-JOURNAL.sh[22460]: + varlinkctl call --more /run/systemd/io.systemd.JournalAccess io.systemd.JournalAccess.GetEntries '{"units": ["test-journalctl-varlink-1-22690.service"]}'
[ 2090.067075] TEST-04-JOURNAL.sh[22461]: + grep -q hello-from-varlink-test-1
[ 2090.384551] TEST-04-JOURNAL.sh[22466]: + varlinkctl call --more /run/systemd/io.systemd.JournalAccess io.systemd.JournalAccess.GetEntries '{"units": ["test-journalctl-varlink-1-22690.service"]}'
[ 2090.385373] TEST-04-JOURNAL.sh[22467]: + grep hello-from-varlink-test-2
[ 2090.723461] TEST-04-JOURNAL.sh[22474]: + grep -q hello-from-varlink-test-1
[ 2090.724294] TEST-04-JOURNAL.sh[22473]: + varlinkctl call --more /run/systemd/io.systemd.JournalAccess io.systemd.JournalAccess.GetEntries '{"units": ["test-journalctl-varlink-1-22690.service", "test-journalctl-varlink-2-18237.service"]}'
[ 2091.135655] TEST-04-JOURNAL.sh[22480]: + varlinkctl call --more /run/systemd/io.systemd.JournalAccess io.systemd.JournalAccess.GetEntries '{"units": ["test-journalctl-varlink-1-22690.service", "test-journalctl-varlink-2-18237.service"]}'
[ 2091.136605] TEST-04-JOURNAL.sh[22481]: + grep -q hello-from-varlink-test-2
[ 2091.479930] TEST-04-JOURNAL.sh[22480]: Method call failed: io.systemd.JournalAccess.NoEntries

8 days agotest: drop more 'grep -q' instances
Luca Boccassi [Tue, 5 May 2026 15:21:16 +0000 (16:21 +0100)] 
test: drop more 'grep -q' instances

Follow-up for ee6b3d1aa2329cddb5867bbc86a4b62983ee56fe

8 days agoterminal-util: when prompting for a choice from a list, preselect longest prefix
Lennart Poettering [Tue, 5 May 2026 08:45:14 +0000 (10:45 +0200)] 
terminal-util: when prompting for a choice from a list, preselect longest prefix

If all entries of a menu prompt start with the same prefix, let's
preselect the prefix to enhance user experience.

This is particularly relevant when prompting for a disk to install
things on, as typically they all start with the same prefix /dev/, and
if there's only a single target medium discoverable, then we can even
fill it out fully.

8 days agotest-oomd: fix flakiness under sanitizers
Luca Boccassi [Tue, 5 May 2026 14:33:49 +0000 (15:33 +0100)] 
test-oomd: fix flakiness under sanitizers

The test asserts that pgscan is 0, but under sanitizers this sometimes
fails and shows up as 1. We cannot control what the kernel scans, and
with sanitizers the runtime can be slow enough it's possible that the
kernel does a pass on the cgroup of the unit test.
Instead of asserting that it's 0, assert that it's between 0 and 9,
which seems a reasonable range.

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

8 days agoman: EnvironmentFile= honors %h, not \$HOME
Simran Singh [Sat, 2 May 2026 18:52:10 +0000 (00:22 +0530)] 
man: EnvironmentFile= honors %h, not \$HOME

8 days agoupdate TODO
Lennart Poettering [Tue, 5 May 2026 15:24:48 +0000 (17:24 +0200)] 
update TODO

8 days agobootctl,mute-console,pcrextend,pcrlock,repart: allow connections from self
Zbigniew Jędrzejewski-Szmek [Tue, 28 Apr 2026 13:26:47 +0000 (15:26 +0200)] 
bootctl,mute-console,pcrextend,pcrlock,repart: allow connections from self

With SD_VARLINK_SERVER_ROOT_ONLY, we refuse all unprivileged operations.
This is silly, the user can and should be able to do anything that doesn't
require privileges.

E.g.:

$ SYSTEMD_LOG_LEVEL=debug varlinkctl introspect /usr/lib/systemd/systemd-pcrextend
Forking off Varlink child process '/usr/lib/systemd/systemd-pcrextend'.
Successfully forked off '(sd-vlexec)' as PID 568993.
varlink: Setting state idle-client
json-stream: Sending message: {"method":"org.varlink.service.GetInterfaceDescription","parameters":{"interface":"io.systemd.PCRExtend"}}
Skipping PR_SET_MM, as we don't have privileges.
varlink: Changing state idle-client → calling
varlink: Unprivileged client attempted connection, refusing.
Failed to run Varlink event loop: Operation not permitted
json-stream: Got POLLHUP from socket.
varlink: Changing state calling → pending-disconnect
varlink: Connection was closed.
Failed to issue org.varlink.service.GetInterfaceDescription() varlink call: Connection reset by peer

This and similar commands now work, e.g.

$ SYSTEMD_LOG_LEVEL=debug varlinkctl call --more ./build/bootctl io.systemd.BootControl.ListBootEntries {}
...
Failed to open directory "/efi": No such file or directory
File system "/boot" is not a FAT EFI System Partition (ESP) file system.
...
Method call failed: Permission denied
{
"origin" : "linux",
"errno" : 13,
"errnoName" : "EACCES"
}
Which is fine — we lack privileges to actually return a useful answer, but the
call itself should go through.

I didn't touch udevd, which refuses to run if it is not root, and does a lot of
privileged setup, so would refuse to start even if the check was removed.

8 days agotreewide: fix typos in the entire codebase
Diego Viola [Tue, 5 May 2026 11:22:55 +0000 (08:22 -0300)] 
treewide: fix typos in the entire codebase

Signed-off-by: Diego Viola <diego.viola@gmail.com>
8 days agoudev-builtin-tpm2-id: gracefully skip tpm2 identification if tss2-libs are not installed
Lennart Poettering [Tue, 5 May 2026 10:43:42 +0000 (12:43 +0200)] 
udev-builtin-tpm2-id: gracefully skip tpm2 identification if tss2-libs are not installed

Fixes: #41714
8 days agosystemd-sysinstall (this time on top of bootctl link) (#41877)
Lennart Poettering [Tue, 5 May 2026 15:20:47 +0000 (17:20 +0200)] 
systemd-sysinstall (this time on top of bootctl link) (#41877)

This is a reiteration of #38764, but this time on top of "bootctl link"
for installing a kernel, i.e. #41543, instead of "kernel-install".

It's the same as #41543, only adds three new commits on top.

8 days agoman/systemd-report: document --url= and other options
Zbigniew Jędrzejewski-Szmek [Tue, 28 Apr 2026 22:53:20 +0000 (00:53 +0200)] 
man/systemd-report: document --url= and other options

5bbbe210a4e3856385d95e16074d8aa98cff909b added the options but not the
documentation.

8 days agotest: make TEST-64 btrfs_basic cleanup robust against reruns
Luca Boccassi [Tue, 5 May 2026 09:43:45 +0000 (10:43 +0100)] 
test: make TEST-64 btrfs_basic cleanup robust against reruns

The LUKS subtest in testcase_btrfs_basic leaves stale LUKS headers on
the underlying SCSI devices, so if the VM is rebooted the test fails
because the LUKS signature is still there and blkid finds it.

[    7.683] + udevadm lock ... mkfs.btrfs -f -L btrfs_root -U deadbeef-dead-dead-beef-000000000000 /dev/disk/by-id/scsi-0systemd_foobar_deadbeefbtrfs0
[    7.729]   Label: btrfs_root
[    7.729]   UUID:  deadbeef-dead-dead-beef-000000000000
[    7.743] + udevadm wait --settle --timeout=30 /dev/disk/by-id/scsi-0systemd_foobar_deadbeefbtrfs0 /dev/disk/by-uuid/deadbeef-dead-dead-beef-000000000000 /dev/disk/by-label/btrfs_root
[    7.788] sda: ... SYMLINK+="disk/by-label/$env{ID_FS_LABEL_ENC}": Added device node symlink "disk/by-label/encdisk0".
[   37.998] Timed out for waiting devices being initialized.
[   38.002] TEST-64-UDEV-STORAGE-btrfs_basic.service: Main process exited, code=exited, status=1/FAILURE

Likewise for the BTRFS UUID:

ERROR: non-unique UUID: deadbeef-dead-dead-beef-000000000001

So wipe that too.

8 days agovmspawn-qmp: take temporary ref in drive_info_add_fail 41951/head
Luca Boccassi [Tue, 5 May 2026 12:55:54 +0000 (13:55 +0100)] 
vmspawn-qmp: take temporary ref in drive_info_add_fail

drive_info_add_fail() calls bridge_unregister_drive() followed by
drive_info_unref(), then continues to access the DriveInfo object.
While all current callers hold their own reference, it is a bit
fragile and it trips static analyzers. Take a local reference.

CID#1655804

Follow-up for 1d0a8e5dbd267c803e100d9030d70d327eddf8b1

8 days agoupdate TODO 41877/head
Lennart Poettering [Mon, 20 Apr 2026 10:34:48 +0000 (12:34 +0200)] 
update TODO

8 days agoci: add CI test for systemd-sysinstall
Lennart Poettering [Wed, 29 Apr 2026 19:49:58 +0000 (21:49 +0200)] 
ci: add CI test for systemd-sysinstall

8 days agosysinstall: new component
Lennart Poettering [Thu, 28 Aug 2025 09:51:11 +0000 (11:51 +0200)] 
sysinstall: new component

8 days agobootctl: allow extra files on 'link' be specified as literal data
Lennart Poettering [Mon, 20 Apr 2026 11:12:44 +0000 (13:12 +0200)] 
bootctl: allow extra files on 'link' be specified as literal data

8 days agoscsi_id: fix memory leak of option_get_synopsis() return value
Luca Boccassi [Tue, 5 May 2026 12:55:00 +0000 (13:55 +0100)] 
scsi_id: fix memory leak of option_get_synopsis() return value

option_get_synopsis() returns a heap-allocated string. Capture it in
a _cleanup_free_ variable so it is freed after being used in the log
message.

CID#1657828

Follow-up for 05fea7df1bd6579dc382455626e0e84acb2a8912

8 days agonetworkctl: use proper errno in mesage 41881/head
Zbigniew Jędrzejewski-Szmek [Thu, 30 Apr 2026 07:20:02 +0000 (09:20 +0200)] 
networkctl: use proper errno in mesage

$ build/networkctl --lines=4883284838483883838383
Failed to parse --lines setting '4883284838483883838383': Numerical result out of range