]> git.ipfire.org Git - thirdparty/systemd.git/log
thirdparty/systemd.git
3 days agomeson: exit earlier from the subdirectory when bash/zshcompletiondir is 'no' 39816/head
Yu Watanabe [Thu, 20 Nov 2025 05:46:18 +0000 (14:46 +0900)] 
meson: exit earlier from the subdirectory when bash/zshcompletiondir is 'no'

3 days agomeson: sort shell completions
Yu Watanabe [Thu, 20 Nov 2025 05:39:13 +0000 (14:39 +0900)] 
meson: sort shell completions

3 days agoshell-completion: add bash script for varlinkctl
Luca Boccassi [Thu, 20 Nov 2025 02:09:48 +0000 (02:09 +0000)] 
shell-completion: add bash script for varlinkctl

3 days agocore: SMACK label to Unix socket path and FD (#39772)
Yu Watanabe [Thu, 20 Nov 2025 04:23:51 +0000 (13:23 +0900)] 
core: SMACK label to Unix socket path and FD (#39772)

Currently, when a socket unit specifies SmackLabel=,
the label is not applied to the underlying Unix socket file or its file
descriptor.

This change ensures that the SMACK label is applied both to the
Unix socket path on the filesystem and to all associated socket FDs
when the socket is created.

Testing:

- Tested on Fedora 43 with kernel 6.17.7 with SMACK enabled.
- Created a systemd socket unit:

    [Unit]
    Description=UNIX socket

    [Socket]
    ListenStream=/run/test.sock
    SmackLabel=label

    [Install]
    WantedBy=sockets.target

- Created a corresponding service:

    [Unit]
    Description=UNIX socket service
    Requires=test.socket

    [Service]
    ExecStart=/usr/bin/socat -v - -
    StandardInput=socket

    [Install]
    WantedBy=multi-user.target

- Verified SMACK labels using getfattr:

  - Without SmackLabel:
    ```
    # file: run/test.sock
    security.SMACK64="_"
    # file: proc/<pid>/fd/*
    security.SMACK64="*"
    ```
  - With SmackLabel=label:
    ```
    # file: run/test.sock
    security.SMACK64="label"
    # file: proc/<pid>/fd/*
    security.SMACK64="label"
    ```

3 days agoSimplify source lists in meson config (#39811)
Yu Watanabe [Thu, 20 Nov 2025 04:20:41 +0000 (13:20 +0900)] 
Simplify source lists in meson config (#39811)

4 days agoNEWS: fix typo
Yu Watanabe [Thu, 20 Nov 2025 01:08:38 +0000 (10:08 +0900)] 
NEWS: fix typo

4 days agomeson: automatically add 'extract' to 'sources' 39811/head
Zbigniew Jędrzejewski-Szmek [Wed, 19 Nov 2025 10:20:18 +0000 (11:20 +0100)] 
meson: automatically add 'extract' to 'sources'

In all cases, everything that we list in 'extract', we also list in
'sources'. We can simplify things by automatically appending the first
list to the second.

In the listings, move 'extract' key right below 'sources', since now
they are both "sources", just with slightly different meanings.

4 days agosocket-label: apply SMACK label to socket and its file descriptor 39772/head
Marc-Antoine Riou [Thu, 6 Nov 2025 10:21:12 +0000 (10:21 +0000)] 
socket-label: apply SMACK label to socket and its file descriptor

When a socket unit specifies SmackLabel=, the label was previously
not applied to the underlying Unix socket file or its file descriptor.
This change ensures that the SMACK label is applied both to the
socket path on the filesystem and to the opened socket FD.

4 days agosocket-label: move prototype of socket_address_listen() and string table for SocketAd...
Yu Watanabe [Thu, 20 Nov 2025 00:39:32 +0000 (09:39 +0900)] 
socket-label: move prototype of socket_address_listen() and string table for SocketAddressBindIPv6Only

The function socket_address_listen() is declared at shared/socket-label.c,
however its prototype was in basic/socket-util.h. This moves the
prototype to shared/socket-label.h.

Also, enum SocketAddressBindIPv6Only is not used anymore in basic/*.[ch].
Let's move the definition and its string table to shared/socket-label.[ch].

Follow-up for b25a930f0e2ebe77bc8b0f0acfac8a3b27ef1f0a.

4 days agocore: Verify inherited FDs are writable for stdout/stderr (#39674)
Yu Watanabe [Wed, 19 Nov 2025 23:19:46 +0000 (08:19 +0900)] 
core: Verify inherited FDs are writable for stdout/stderr (#39674)

When inheriting file descriptors for stdout/stderr (either from stdin or
when making stderr inherit from stdout), we previously just assumed they
would be writable and dup'd them. This could lead to broken setups if
the inherited FD was actually opened read-only.

Before dup'ing any inherited FDs to stdout/stderr, verify they are
actually writable using the new fd_is_writable() helper. If not, fall
back to /dev/null (or reopen the terminal in the TTY case) with a
warning, rather than silently creating a broken setup where output
operations would fail.

4 days agonetwork: clear existing routes if Gateway= is empty in [Network]
Quentin Deslandes [Tue, 18 Nov 2025 20:36:49 +0000 (21:36 +0100)] 
network: clear existing routes if Gateway= is empty in [Network]

Add support for an empty Gateway= in [Network] to clear the existing
routes. This change will allow users to remove the default route from a
drop-in file.

4 days agoman: add 'testing' as one of the suggestions for DEPLOYMENT=
Zbigniew Jędrzejewski-Szmek [Wed, 19 Nov 2025 15:19:16 +0000 (16:19 +0100)] 
man: add 'testing' as one of the suggestions for DEPLOYMENT=

Looking at the list, "test" or "testing" seems to be a fairly generic entry
that is missing from the list of suggestions. I went with "testing" because it
fits better with the other item, e.g. "staging".

In https://github.com/systemd/systemd/issues/38743 "laboratory" was also
suggested. I didn't include this because that is more about the location, not
deployment type. Any of the other deployments could be in a "laboratory".

Closes https://github.com/systemd/systemd/issues/38743.

4 days agotests: ASSERT_SIGNAL: Prevent hallucinating parent as child and confusing exit codes...
Chris Down [Wed, 19 Nov 2025 19:52:02 +0000 (03:52 +0800)] 
tests: ASSERT_SIGNAL: Prevent hallucinating parent as child and confusing exit codes with signals (#39807)

This series fixes two distinct, pretty bad bugs in `ASSERT_SIGNAL`.
These bugs can allow failing tests to pass, and can also cause the test
runner to silently terminate prematurely in a way that looks like
success.

This is not theoretical, see
https://github.com/systemd/systemd/pull/39674#discussion_r2540552699 for
a real case of this happening.

---

Bug 1: Parent process hallucinates it is the child and re-executes the
expression being tested

Previously, assert_signal_internal() returned 0 in two mutually
exclusive states:

1. We are the child process (immediately after fork()).
2. We are the parent process, and the child exited normally (status 0).

The macro failed to distinguish these cases. If a child failed to crash
as expected, the parent received 0, incorrectly interpreted it as it
being the child, and re-executed the test expression inside the parent
process.

This can cause tests to falsely pass. The parent would successfully run
the expression (which wasn't supposed to crash in the parent), succeed,
and call _exit(EXIT_SUCCESS).

The second consequence is silent truncation. When the parent called
_exit(), it terminated the entire test runner immediately. Any
subsequent tests in the same binary were never executed.

---

Bug 2: Conflation of exit codes and signals

The harness returned the raw si_status without checking si_code. This
meant that an exit code was indistinguishable from a signal number. For
example, if a child process failed and called exit(6), the harness
reported it as having been killed by SIGABRT (signal 6).

---

This PR both fixes the bugs and reworks the ASSERT_SIGNAL infrastructure
to ensure this is very unlikely to regress:

- assert_signal_internal now returns an explicit control flow enum
(FORK_CHILD / FORK_PARENT) separate from the status data. This makes it
structurally impossible for the parent to hallucinate that it is the
child.
- The output parameter is only populated with a signal number if si_code
confirms the process was killed by a signal. Normal exits return 0.

4 days agodocs: elf metadata specs have moved to uapi-group
Luca Boccassi [Wed, 19 Nov 2025 17:30:24 +0000 (17:30 +0000)] 
docs: elf metadata specs have moved to uapi-group

4 days agotests: ASSERT_SIGNAL: Do not allow parent to hallucinate it is the child 39807/head
Chris Down [Wed, 19 Nov 2025 14:06:03 +0000 (22:06 +0800)] 
tests: ASSERT_SIGNAL: Do not allow parent to hallucinate it is the child

assert_signal_internal() returns 0 in two distinct cases:

1. In the child process (immediately after fork returns 0).
2. In the parent process, if the child exited normally (no signal).

ASSERT_SIGNAL fails to distinguish these cases. When a child exited
normally (case 2), the parent process receives 0, incorrectly interprets
it as meaning it is the child, and re-executes the test expression
inside the parent process. Goodness gracious!

This causes two severe test integrity issues:

1. False positives. The parent can run the expression, succeed, and call
   _exit(EXIT_SUCCESS), causing the test to pass even though no signal
   was raised.
2. Silent truncation. The _exit() call in the parent terminates the test
   runner prematurely, preventing subsequent tests in the same file from
   running.

Example of the bug in action, from #39674:

    ASSERT_SIGNAL(fd_is_writable(closed_fd), SIGABRT)

This test should fail (fd_is_writable does not SIGABRT here), but with
the bug, the parent hallucinated being the child, re-ran the expression
successfully, and exited with success.

Fix this by refactoring assert_signal_internal() to be much more strict
about separating control flow from data.

The signal status is now returned via a strictly typed output parameter,
guaranteeing that determining whether we are the child is never
conflated with whether the child exited cleanly.

4 days agotests: ASSERT_SIGNAL: Ensure sanitisers do not mask expected signals
Chris Down [Wed, 19 Nov 2025 13:45:40 +0000 (21:45 +0800)] 
tests: ASSERT_SIGNAL: Ensure sanitisers do not mask expected signals

ASAN installs signal handlers to catch crashes like SIGSEGV or SIGILL.
When these signals are raised, ASAN traps them, prints an error report,
and then typically terminates the process with a different signal (often
SIGABRT) or a non-zero exit code.

This interferes with ASSERT_SIGNAL when checking for specific crash
signals (for example, checking that a function raises SIGSEGV). In such
a case, the test harness sees the ASAN termination signal rather than
the expected signal, causing the test to fail.

Fix this by resetting the signal handler to SIG_DFL in the child process
immediately before executing the test expression. This ensures the
kernel kills the process directly with the expected signal, bypassing
ASAN's interceptors.

4 days agotests: ASSERT_SIGNAL: Stop exit codes from masquerading as signals
Chris Down [Wed, 19 Nov 2025 08:50:38 +0000 (16:50 +0800)] 
tests: ASSERT_SIGNAL: Stop exit codes from masquerading as signals

When a child process exits normally (si_code == CLD_EXITED),
siginfo.si_status contains the exit code. When it is killed by a signal
(si_code == CLD_KILLED or CLD_DUMPED), si_status contains the signal
number.  However, assert_signal_internal() returns si_status blindly.
This causes exit codes to be misinterpreted as signal numbers.

This allows failing tests to silently pass if their exit code
numerically coincides with the expected signal. For example, a test
expecting SIGABRT (6) would incorrectly pass if the child simply exited
with status 6 instead of being killed by a signal.

Fix this by checking si_code. Only return si_status as a signal number
if the child was actually killed by a signal (CLD_KILLED or CLD_DUMPED).
If the child exited normally (CLD_EXITED), return 0 to indicate that no
signal occurred.

4 days agocore: Verify inherited FDs are writable for stdout/stderr 39674/head
Chris Down [Mon, 10 Nov 2025 20:26:10 +0000 (04:26 +0800)] 
core: Verify inherited FDs are writable for stdout/stderr

When inheriting file descriptors for stdout/stderr (either from stdin
or when making stderr inherit from stdout), we previously just assumed
they would be writable and dup'd them. This could lead to broken setups
if the inherited FD was actually opened read-only.

Before dup'ing any inherited FDs to stdout/stderr, verify they are
actually writable using the new fd_is_writable() helper. If not, fall
back to /dev/null (or reopen the terminal in the TTY case) with a
warning, rather than silently creating a broken setup where output
operations would fail.

4 days agofd-util: Add fd_is_writable() to check if FD is opened for writing
Chris Down [Mon, 17 Nov 2025 03:05:09 +0000 (11:05 +0800)] 
fd-util: Add fd_is_writable() to check if FD is opened for writing

This checks whether a file descriptor is valid and opened in a mode that
allows writing (O_WRONLY or O_RDWR). This is useful when we want to
verify that inherited FDs can actually be used for output operations
before dup'ing them.

The helper explicitly handles O_PATH file descriptors, which cannot be
used for I/O operations and thus are never writable.

4 days agocore/socket: do not log failure in setting socket option with number
Yu Watanabe [Tue, 18 Nov 2025 19:01:17 +0000 (04:01 +0900)] 
core/socket: do not log failure in setting socket option with number

This also downgrade to the debug level when the option is simply not
supported.

Follow-up for b81a14b91efea17631d634f5dbd69314780815ab.
Fixes #39792.

4 days agotest/TEST-74-AUX-UTILS: fix racy check
Zbigniew Jędrzejewski-Szmek [Wed, 19 Nov 2025 14:57:29 +0000 (15:57 +0100)] 
test/TEST-74-AUX-UTILS: fix racy check

We were getting a list of invocation IDs, picking one at random,
and then querying the unit. This is obviously racy.

TEST-74-AUX-UTILS.sh[2873]: + varlinkctl call /run/systemd/io.systemd.Manager io.systemd.Unit.List
                              '{"invocationID": "2052c9a5-7983-4f72-9910-c49e38c91dab"}'
TEST-74-AUX-UTILS.sh[3707]: Method call io.systemd.Unit.List() failed: io.systemd.Unit.NoSuchUnit

The complicated varlink + jq callout is replaced by a simple systemctl call.
I think that's better to avoid a complicated jq expression.

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

4 days agomeson: drop unnessary variable
Zbigniew Jędrzejewski-Szmek [Wed, 19 Nov 2025 10:21:37 +0000 (11:21 +0100)] 
meson: drop unnessary variable

4 days agocryptsetup: fix wrong argument order for mechanism vs. name
Martin Hundebøll [Wed, 19 Nov 2025 11:52:25 +0000 (12:52 +0100)] 
cryptsetup: fix wrong argument order for mechanism vs. name

Fixes: https://github.com/systemd/systemd/issues/39655
4 days agoDeduplicate and improve messages from ssh-generator (#39785)
Zbigniew Jędrzejewski-Szmek [Wed, 19 Nov 2025 15:00:34 +0000 (16:00 +0100)] 
Deduplicate and improve messages from ssh-generator (#39785)

4 days agotests: Avoid variable shadowing in ASSERT_SIGNAL
Chris Down [Wed, 19 Nov 2025 08:49:22 +0000 (16:49 +0800)] 
tests: Avoid variable shadowing in ASSERT_SIGNAL

The ASSERT_SIGNAL macro uses a fixed variable name, `_r`. This prevents
nesting the macro (like ASSERT_SIGNAL(ASSERT_SIGNAL(...))), as the inner
instance would shadow the outer instance's variable.

Switch to using the UNIQ_T helper to generate unique variable names at
each expansion level. This allows the macro to be used recursively,
which is required for upcoming regression tests regarding signal
handling logic.

4 days agotools: Add script to detect unused symbols in libshared
Daan De Meyer [Wed, 19 Nov 2025 09:30:01 +0000 (10:30 +0100)] 
tools: Add script to detect unused symbols in libshared

Symbols exported by libshared can't get pruned by the linker, so
every unused exported symbol is effectively dead code we ship to users
for no good reason. Let's add a script to analyze how many such symbols
we have.

We also add a meson test to run the script on all of our binaries.
Since it detects unused symbols and still has a few false positives,
don't enable the test by default similar to the clang-tidy tests.

The script was 100% vibe coded by Github Copilot with Claude Sonnet 4.5
as the model.

Current results are (without the unused symbols list):

Analysis of libsystemd-shared-259.so
======================================================================
Total exported symbols: 4830
  (excluding public API symbols starting with 'sd_')
Used symbols: 4672
Unused symbols: 158
Usage rate: 96.7%

4 days agolibudev: Don't pull in libshared_static
Daan De Meyer [Wed, 19 Nov 2025 08:59:19 +0000 (09:59 +0100)] 
libudev: Don't pull in libshared_static

- Move devices-nodes.c to src/basic as it's super trivial anyway
- Duplicate udev_queue_is_empty() in libudev-util.c as it's trivial
  anyway.

4 days agossh-generator: suppress error message for vsock EADDRNOTAVAIL 39785/head
Zbigniew Jędrzejewski-Szmek [Tue, 18 Nov 2025 10:37:59 +0000 (11:37 +0100)] 
ssh-generator: suppress error message for vsock EADDRNOTAVAIL

In logs in the Fedora OpenQA CI:
Nov 17 22:20:06 fedora systemd-ssh-generator[4117]: Failed to query local AF_VSOCK CID: Cannot assign requested address
Nov 17 22:20:06 fedora (generato[4088]: /usr/lib/systemd/system-generators/systemd-ssh-generator failed with exit status 1.
Nov 17 22:20:06 fedora systemd[1]: sshd-vsock.socket: Unit configuration changed while unit was running, and no socket file descriptors are open. Unit not functional until restarted.

AF_VSOCK is not configured there and systemd-ssh-generator should just exit
quietly. vsock_get_local_cid() already does some logging at debug level, so we
don't need to.

There is also a second bug, we report modifications to the unit have just
created. I think we have an issue open for this somewhere, but cannot find it.

4 days agossh-generator: split out one more helper function
Zbigniew Jędrzejewski-Szmek [Tue, 18 Nov 2025 10:34:37 +0000 (11:34 +0100)] 
ssh-generator: split out one more helper function

4 days agossh-generator: split out common helper function
Zbigniew Jędrzejewski-Szmek [Tue, 18 Nov 2025 10:19:41 +0000 (11:19 +0100)] 
ssh-generator: split out common helper function

4 days agoman: use prefix number that matches the general suggestion
Christoph Anton Mitterer [Wed, 19 Nov 2025 04:54:40 +0000 (05:54 +0100)] 
man: use prefix number that matches the general suggestion

`systemd.network(5)` recommends “that each filename is prefixed with a number
smaller than "70" (e.g.  10-eth0.network)”.

Reduce that used by the example accordingly, but stay above the number (`50`)
used in the earlier example for static configuration, so that would take
precedence over the dynamic one if both match for the same network.

5 days agoImprove systemd-analyze man page and bash completion (#39778)
Luca Boccassi [Tue, 18 Nov 2025 22:54:01 +0000 (22:54 +0000)] 
Improve systemd-analyze man page and bash completion (#39778)

This updates example output in systemd-analyze's man page after the
tool's output was changed in a previous commit.

Additionally bash completion is added for `systemd-analyze filesystems`
and improved for `systemd-analyze calendar`.

5 days agoshell-completion: bash: Add systemd-analyze calendar options 39778/head
Simon Barth [Tue, 11 Nov 2025 19:59:30 +0000 (20:59 +0100)] 
shell-completion: bash: Add systemd-analyze calendar options

Add completion for the systemd-analyze calendar options --iterations and
--base-time.

5 days agoUser and group error messages (#39783)
Zbigniew Jędrzejewski-Szmek [Tue, 18 Nov 2025 18:39:57 +0000 (19:39 +0100)] 
User and group error messages (#39783)

I'm using separate commit here because this changes are a bit finicky.

5 days agonetworkd: use STRERROR_{USER,GROUP} 39783/head
Zbigniew Jędrzejewski-Szmek [Tue, 18 Nov 2025 11:41:45 +0000 (12:41 +0100)] 
networkd: use STRERROR_{USER,GROUP}

5 days agonspawn,vmspawn: improve errors for unknown users and groups
Zbigniew Jędrzejewski-Szmek [Tue, 18 Nov 2025 09:29:40 +0000 (10:29 +0100)] 
nspawn,vmspawn: improve errors for unknown users and groups

5 days agologin: use STREROR_USER helper
Zbigniew Jędrzejewski-Szmek [Tue, 18 Nov 2025 09:28:53 +0000 (10:28 +0100)] 
login: use STREROR_USER helper

5 days agocreds: improve message about unknown user
Zbigniew Jędrzejewski-Szmek [Tue, 18 Nov 2025 09:18:25 +0000 (10:18 +0100)] 
creds: improve message about unknown user

Before:
$ build/systemd-creds --uid=asdf
Failed to resolve user 'asdf': No such process
Now:
$ build/systemd-creds --uid=asdf
Failed to resolve user 'asdf': Unknown user

5 days agocore: improve messages about unknown users and groups
Zbigniew Jędrzejewski-Szmek [Tue, 18 Nov 2025 09:08:41 +0000 (10:08 +0100)] 
core: improve messages about unknown users and groups

$ sudo build/systemd-run --uid=asdf whoami
$ journalctl -e
(whoami)[1007784]: run-p1007782-i5200512.service: Failed to determine user credentials: No such process
(whoami)[1007784]: run-p1007782-i5200512.service: Failed at step USER spawning /usr/sbin/whoami: No such process
systemd[1]: run-p1007782-i5200512.service: Main process exited, code=exited, status=217/USER
systemd[1]: run-p1007782-i5200512.service: Failed with result 'exit-code'.

Now:
(whoami)[1013204]: run-p1013202-i5205932.service: Failed to determine credentials for user 'asdf': Unknown user
(whoami)[1013204]: run-p1013202-i5205932.service: Failed at step USER spawning /usr/sbin/whoami: Invalid argument
systemd[1]: run-p1013202-i5205932.service: Main process exited, code=exited, status=217/USER
systemd[1]: run-p1013202-i5205932.service: Failed with result 'exit-code'.

5 days agorun: improve log message for unknown user/group
Zbigniew Jędrzejewski-Szmek [Tue, 18 Nov 2025 08:26:49 +0000 (09:26 +0100)] 
run: improve log message for unknown user/group

Before:
$ sudo build/systemd-run --scope --uid=asdf whoami
Failed to resolve user asdf: No such process
Now:
$ sudo build/systemd-run --scope --uid=asdf whoami
Failed to resolve user 'asdf': Unknown user

5 days agotmpfiles: improve error message for missing user/group
Zbigniew Jędrzejewski-Szmek [Tue, 18 Nov 2025 08:21:02 +0000 (09:21 +0100)] 
tmpfiles: improve error message for missing user/group

From a boot with a dracut initrd:
systemd-tmpfiles[242]: /usr/lib/tmpfiles.d/tpm2-tss-fapi.conf:2: Failed to resolve user 'tss': No such process
systemd-tmpfiles[242]: Failed to parse ACL "default:group:tss:rwx", ignoring: Invalid argument
systemd-tmpfiles[242]: /usr/lib/tmpfiles.d/tpm2-tss-fapi.conf:4: Failed to resolve user 'tss': No such process
systemd-tmpfiles[242]: Failed to parse ACL "default:group:tss:rwx", ignoring: Invalid argument
systemd-tmpfiles[242]: /usr/lib/tmpfiles.d/tpm2-tss-fapi.conf:6: Failed to resolve group 'tss': No such process
systemd-tmpfiles[242]: /usr/lib/tmpfiles.d/tpm2-tss-fapi.conf:7: Failed to resolve group 'tss': No such process

5 days agoudev: define a generic helper to print messages about unknown users and groups
Zbigniew Jędrzejewski-Szmek [Tue, 18 Nov 2025 08:47:51 +0000 (09:47 +0100)] 
udev: define a generic helper to print messages about unknown users and groups

We cannot just use %m, because strerror returns a confusing error message
for ESRCH or ENOEXEC. udev code was doing a good job, but the error handling
was very verbose. Let's encapsulate the customized error messages in a
helper.

No functional change, except that the error messages have a slightly different
form now. The old messages were a bit better, but we don't have as much
flexibility in the new scheme. "Failed to resolve user 'foo': Unknown user"
should be good enough.

5 days agotest: wait for a process ID instead of job ID
Frantisek Sumsal [Tue, 18 Nov 2025 12:49:03 +0000 (13:49 +0100)] 
test: wait for a process ID instead of job ID

Since depending on job control turned out to be flaky [0], let's just
explicitly wait for a process ID instead.

Follow-up for 3849b0701a7713c147400f205e7ddb3e3f93ad26.
Resolves: #39543

[0] https://github.com/systemd/systemd/issues/39543#issuecomment-3529418583

5 days agomkosi: Add sanitizer libraries to the CentOS/Fedora tools tree
Daan De Meyer [Fri, 14 Nov 2025 20:21:16 +0000 (21:21 +0100)] 
mkosi: Add sanitizer libraries to the CentOS/Fedora tools tree

5 days agoNEWS: fix typo
Armin Brauns [Tue, 18 Nov 2025 12:54:11 +0000 (12:54 +0000)] 
NEWS: fix typo

5 days agotree-wide: fix log messages using %m without an errno
Zbigniew Jędrzejewski-Szmek [Tue, 18 Nov 2025 07:56:04 +0000 (08:56 +0100)] 
tree-wide: fix log messages using %m without an errno

5 days agonetwork: gracefully disable resolve hook when socket is disabled
Zbigniew Jędrzejewski-Szmek [Mon, 17 Nov 2025 16:57:24 +0000 (17:57 +0100)] 
network: gracefully disable resolve hook when socket is disabled

systemd-networkd cannot create the directory /run/systemd/resolve.hook/. Even
if the directory exists, it is not owned by systemd-network user/group, so
systemd-networkd cannot create socket file in the directory. Hence, if the
systemd-networkd-resolve-hook.socket unit is disabled, networkd fails to open
the varlink socket, and fail to start:

  systemd-networkd[1304645]: Failed to bind to systemd-resolved hook Varlink socket: Permission denied
  systemd-networkd[1304645]: Could not set up manager: Permission denied
  systemd[1]: systemd-networkd.service: Main process exited, code=exited, status=1/FAILURE
  systemd[1]: systemd-networkd.service: Failed with result 'exit-code'.
  systemd[1]: Failed to start systemd-networkd.service - Network Management.

If the socket unit is disabled, that should mean the system administrator wants
to disable the feature. Let's not try to setup the varlink socket in that case.

Now the resolve hook feature can be toggled by enabling/disabling the socket
unit, let's drop the $SYSTEMD_NETWORK_RESOLVE_HOOK environment variable.

Follow-up for a7fa29b1b52210e33f4e43efc1a2f06b7c7233c0.
Co-authored-by: Yu Watanabe <watanabe.yu+github@gmail.com>
5 days agoVarious documentation updates
Daan De Meyer [Tue, 4 Nov 2025 22:13:55 +0000 (23:13 +0100)] 
Various documentation updates

6 days agouser-record: use clzll() instead of clzl() for uint64_t
Mike Yuan [Mon, 17 Nov 2025 22:49:53 +0000 (23:49 +0100)] 
user-record: use clzll() instead of clzl() for uint64_t

6 days agocore/unit: unit_process_job() tweaks (#39753)
Yu Watanabe [Mon, 17 Nov 2025 23:32:59 +0000 (08:32 +0900)] 
core/unit: unit_process_job() tweaks (#39753)

6 days agolabeler: match the whole tree of shell-completion/
Mike Yuan [Mon, 17 Nov 2025 22:59:57 +0000 (23:59 +0100)] 
labeler: match the whole tree of shell-completion/

6 days agoshell-completion: bash: Add systemd-analyze filesystems
Simon Barth [Mon, 10 Nov 2025 21:27:57 +0000 (22:27 +0100)] 
shell-completion: bash: Add systemd-analyze filesystems

6 days agoman: Fix systemd-analyze exit-status example output
Simon Barth [Mon, 10 Nov 2025 20:57:24 +0000 (21:57 +0100)] 
man: Fix systemd-analyze exit-status example output

The output of `systemd-analyze exit-status` changed in commit
e04ed6db6b44681b7a7876b9c4a1e6adaf877670, so that the exit-status class
for EXIT_SUCCESS and EXIT_FAILURE is "libc" instead of "glibc".

This commit makes the example output in the man-page match the actual
output again.

6 days agomeson: bump version to v259~rc1 v259-rc1
Luca Boccassi [Mon, 17 Nov 2025 14:03:15 +0000 (14:03 +0000)] 
meson: bump version to v259~rc1

6 days agomeson: bump library sonames for v259~rc1
Luca Boccassi [Mon, 17 Nov 2025 13:54:52 +0000 (13:54 +0000)] 
meson: bump library sonames for v259~rc1

6 days agoNEWS: finalize time and place
Luca Boccassi [Mon, 17 Nov 2025 13:56:26 +0000 (13:56 +0000)] 
NEWS: finalize time and place

6 days agoNEWS: update contributors list
Luca Boccassi [Mon, 17 Nov 2025 13:56:18 +0000 (13:56 +0000)] 
NEWS: update contributors list

6 days agoNEWS: copy yet again sysvinit scripts removal announcement
Luca Boccassi [Mon, 17 Nov 2025 15:31:17 +0000 (15:31 +0000)] 
NEWS: copy yet again sysvinit scripts removal announcement

Soon (TM)

6 days agocore/unit: modernize unit_process_job() a bit 39753/head
Mike Yuan [Sun, 16 Nov 2025 14:33:53 +0000 (15:33 +0100)] 
core/unit: modernize unit_process_job() a bit

* Inline one condition
* Annotate boolean args with names

6 days agomusl: gracefully disable utmp support (#39775)
Yu Watanabe [Mon, 17 Nov 2025 18:29:34 +0000 (03:29 +0900)] 
musl: gracefully disable utmp support (#39775)

6 days agocore/unit: always propagate reload_result as job result, even if state is unexpected
Mike Yuan [Sat, 15 Nov 2025 20:08:50 +0000 (21:08 +0100)] 
core/unit: always propagate reload_result as job result, even if state is unexpected

The end state of unit shouldn't have any impact on reload job, as
either way the reload operation has been aborted.

6 days agocore/unit: mark running reload job as canceled if the unit deactivated
Mike Yuan [Sat, 15 Nov 2025 20:06:39 +0000 (21:06 +0100)] 
core/unit: mark running reload job as canceled if the unit deactivated

The semantics of reload is that the service updates its extrinsic state
and continues execution. If it actually deactivated we shouldn't
spuriously notify the caller that reload succeeded.

6 days agocore/unit: no need to handle intermediate job types in unit_process_job()
Mike Yuan [Sun, 16 Nov 2025 14:59:28 +0000 (15:59 +0100)] 
core/unit: no need to handle intermediate job types in unit_process_job()

Installed jobs are always collapsed, i.e. can only be of types
accepted by job_run_and_invalidate() modulo JOB_NOP which is
stored in Unit.nop_job (if any). Let's trim the unreachable
branches.

6 days agoRevert "musl: utmpx: add several missing definitions" 39775/head
Yu Watanabe [Mon, 17 Nov 2025 18:06:02 +0000 (03:06 +0900)] 
Revert "musl: utmpx: add several missing definitions"

This reverts commit 3ae7d8fd8731c3412df878e8d1e8af9a8e644576.

Now utmp support is always disabled when building with musl,
and all definitions are unused in that case. Let's remove it.

6 days agomusl: meson: gracefully disable utmp support
Yu Watanabe [Mon, 17 Nov 2025 17:52:38 +0000 (02:52 +0900)] 
musl: meson: gracefully disable utmp support

musl only provides fake utmp functions, and these are not usable.
Let's disable the feature when building with musl.

6 days agoRevert "musl: meson: add libutmps support"
Yu Watanabe [Mon, 17 Nov 2025 17:45:28 +0000 (02:45 +0900)] 
Revert "musl: meson: add libutmps support"

This reverts commit bf9bc5beb090bb35184caf34cc641e708615e83a.

libutmps does not support utmpxname(), the function always fails
with ENOSYS, and always uses their own file.
However, our code relies on the funtion needs to succeed.

Let's revert the change now, and revisit later when musl users
request to support libutmps.

6 days agorepart: prefix LUKS superblock label with "luks-" by default, and add explicit Volume...
Luca Boccassi [Mon, 17 Nov 2025 17:46:39 +0000 (17:46 +0000)] 
repart: prefix LUKS superblock label with "luks-" by default, and add explicit VolumeLabel= setting to control it (#39713)

Alternative-to: #39536
6 days agoNEWS: menton future removal of SysV support and requirement bump
Yu Watanabe [Mon, 17 Nov 2025 17:40:22 +0000 (02:40 +0900)] 
NEWS: menton future removal of SysV support and requirement bump

6 days agoSplit out script for musl builds (#39758)
Yu Watanabe [Mon, 17 Nov 2025 17:17:05 +0000 (02:17 +0900)] 
Split out script for musl builds (#39758)

6 days agodocs: Update MEMORY_PRESSURE to mention recent improvements in GLib
Philip Withnall [Sun, 2 Nov 2025 11:34:03 +0000 (11:34 +0000)] 
docs: Update MEMORY_PRESSURE to mention recent improvements in GLib

See https://gitlab.gnome.org/GNOME/glib/-/issues/2931 for the changes in
GLib upstream. Using `GMemoryMonitor` is now more compliant with the
systemd recommended approach, but it needs further work to read the
recommended environment variables rather than unconditionally accessing
the per-cgroup PSI kernel file directly.

Signed-off-by: Philip Withnall <pwithnall@gnome.org>
6 days agofs-util: enable automatic access mode logic in xopenat()
Lennart Poettering [Tue, 11 Nov 2025 10:35:16 +0000 (11:35 +0100)] 
fs-util: enable automatic access mode logic in xopenat()

6 days agotest: modernize test-log and add test cases for log_format_iovec() (#39750)
Yu Watanabe [Mon, 17 Nov 2025 16:31:02 +0000 (01:31 +0900)] 
test: modernize test-log and add test cases for log_format_iovec() (#39750)

6 days agoci: whitespace fix 39758/head
Zbigniew Jędrzejewski-Szmek [Mon, 17 Nov 2025 10:43:59 +0000 (11:43 +0100)] 
ci: whitespace fix

6 days agomusl: split out script to setup build
Zbigniew Jędrzejewski-Szmek [Sun, 16 Nov 2025 19:36:07 +0000 (20:36 +0100)] 
musl: split out script to setup build

This makes it easier to set up a local build with musl:
$ tools/setup-musl-build.sh build-meson
$ ninja -C build-meson

6 days agomusl: drop unused temporary pkgonfig directory
Zbigniew Jędrzejewski-Szmek [Mon, 17 Nov 2025 15:56:51 +0000 (16:56 +0100)] 
musl: drop unused temporary pkgonfig directory

6 days agotmpfile-util: make sure errno is left untouched by CLEANUP_TMPFILE_AT()
Lennart Poettering [Tue, 11 Nov 2025 10:35:45 +0000 (11:35 +0100)] 
tmpfile-util: make sure errno is left untouched by CLEANUP_TMPFILE_AT()

This mimics how rm_rf_physical_and_free() operate, and we should do the
same here, and make clean-up error paths not touch errno needlessly.

6 days agonspawn: move oci code to use json_dispatch_strv_environment()
Lennart Poettering [Tue, 11 Nov 2025 10:37:30 +0000 (11:37 +0100)] 
nspawn: move oci code to use json_dispatch_strv_environment()

6 days agoVarious comment and whitespace cleanups (#39740)
Zbigniew Jędrzejewski-Szmek [Mon, 17 Nov 2025 15:52:38 +0000 (16:52 +0100)] 
Various comment and whitespace cleanups (#39740)

6 days agotree-wide: drop space after shell redirection ops 39740/head
Zbigniew Jędrzejewski-Szmek [Sat, 15 Nov 2025 15:13:47 +0000 (16:13 +0100)] 
tree-wide: drop space after shell redirection ops

Those are all unary operators.

6 days agocore/namespace: tidy up comments and debug logs
Zbigniew Jędrzejewski-Szmek [Tue, 4 Nov 2025 13:08:37 +0000 (14:08 +0100)] 
core/namespace: tidy up comments and debug logs

Saying "table" everywhere is not needed. Everybody can see that the table
is a table is a table. Also tweak the grammar in various places to make
reading nicer.

6 days agotest: add testcase for VolumeLabel= 39713/head
Lennart Poettering [Mon, 17 Nov 2025 15:43:21 +0000 (16:43 +0100)] 
test: add testcase for VolumeLabel=

6 days agodissect-tool: accept encryption password via $PASSWORD
Lennart Poettering [Mon, 17 Nov 2025 15:42:58 +0000 (16:42 +0100)] 
dissect-tool: accept encryption password via $PASSWORD

6 days agonspawn: fix flags type for chase()
Lennart Poettering [Wed, 12 Nov 2025 15:47:17 +0000 (16:47 +0100)] 
nspawn: fix flags type for chase()

6 days agodiscover-image: support reading metadata from verity enabled DDI images, too
Lennart Poettering [Wed, 12 Nov 2025 15:48:26 +0000 (16:48 +0100)] 
discover-image: support reading metadata from verity enabled DDI images, too

6 days agohwdb: Fix keyboard backlight keys on Acer Nitro 5 AN515-58 (#39769)
Pranay Pawar [Mon, 17 Nov 2025 15:33:42 +0000 (21:03 +0530)] 
hwdb: Fix keyboard backlight keys on Acer Nitro 5 AN515-58 (#39769)

Pressing Fn+F10 on Acer Nitro 5 AN515-58 incorrectly triggers display
brightness down (scancode 0xef) instead of keyboard backlight control,
causing the screen to go completely dark. Similarly, Fn+F9 (scancode
0xf0) has no function explictily stated in hwdb causing unknown keycode
debug messages.

Both keys should control the keyboard backlight as labeled on the
keyboard. Map scancodes 0xef and 0xf0 to kbdillumup and kbdillumdown
respectively to enable proper keyboard backlight control.

6 days agoDrop remaining CGroup v1 specific code (#38969)
Yu Watanabe [Mon, 17 Nov 2025 14:48:29 +0000 (23:48 +0900)] 
Drop remaining CGroup v1 specific code (#38969)

6 days agoNEWS: mention the LUKS superblock default labelling change.
Lennart Poettering [Thu, 13 Nov 2025 09:11:00 +0000 (10:11 +0100)] 
NEWS: mention the LUKS superblock default labelling change.

This is a (weak) compat break, hence document it in NEWS.

6 days agoNEWS: insert hyphen
Yu Watanabe [Mon, 17 Nov 2025 14:37:19 +0000 (23:37 +0900)] 
NEWS: insert hyphen

6 days agorepart: avoid label string clashes between LUKS superblocks and the filesystems on...
Lennart Poettering [Thu, 13 Nov 2025 09:09:50 +0000 (10:09 +0100)] 
repart: avoid label string clashes between LUKS superblocks and the filesystems on them

Let's make sure that by default /dev/disk/by-label/ symlinks avoid
ambiguities, and the LUKS volume carries a different one than the file
system inside it.

Alternative-to: #39536
6 days agorepart: fix typo
Yu Watanabe [Mon, 17 Nov 2025 14:34:39 +0000 (23:34 +0900)] 
repart: fix typo

Follow-up for cfb6c543245be0a1908c270941b7881ac7395d1b.

6 days agoNEWS: cleanups and rewordings, extend the section about musl
Zbigniew Jędrzejewski-Szmek [Mon, 17 Nov 2025 14:17:23 +0000 (15:17 +0100)] 
NEWS: cleanups and rewordings, extend the section about musl

I think we should make it clear that the "incomplete musl support" does not
mean that it'll for certain be completed later. The feedback from users will be
an important consideration.

6 days agotest-log: add test cases for log_format_iovec() 39750/head
Yu Watanabe [Sun, 16 Nov 2025 07:54:53 +0000 (16:54 +0900)] 
test-log: add test cases for log_format_iovec()

6 days agotest-log: migrate to use ASSERT_OK() and friends
Yu Watanabe [Sun, 16 Nov 2025 06:31:28 +0000 (15:31 +0900)] 
test-log: migrate to use ASSERT_OK() and friends

6 days agolog: replace format string in LOG_ITEM() to a dummy one when analyzed by Coverity
Yu Watanabe [Sun, 16 Nov 2025 10:18:45 +0000 (19:18 +0900)] 
log: replace format string in LOG_ITEM() to a dummy one when analyzed by Coverity

Hopefully silence many false-positives.

6 days agolog: make each string generated in log_format_iovec() NUL terminated
Yu Watanabe [Sun, 16 Nov 2025 11:14:00 +0000 (20:14 +0900)] 
log: make each string generated in log_format_iovec() NUL terminated

Nowadays, we append an extra NUL for each data if possible for safety.
We already do the same for example at write_to_kmsg(), log_do_context(),
write_to_journal(), log_struct_iovec_internal(), and so on.
This does not change any behavior, as the iov_len field is unchanged.

6 days agorepart: adjust "partno" column
Zbigniew Jędrzejewski-Szmek [Fri, 24 Oct 2025 08:34:17 +0000 (10:34 +0200)] 
repart: adjust "partno" column

In a typical output from systemd-repart, the output is very wide any any wasted
space is bad because it pushes the interesting information even further to the
right. We usually need at most one or two digits to express the partition
numbers, so let's shorten the title of the column to effectively remove two
columns in the output.

In JSON output, the old field name is retained. This follows the pattern
already used for field "drop-in_files".

Also right-align the columns with numbers always to the right. I doesn't make
sense to align the columns which are only used for JSON output, so stop setting
alignment for those.

6 days agocoredumpctl: remove unnecessary line break
Lennart Poettering [Mon, 10 Nov 2025 11:12:47 +0000 (12:12 +0100)] 
coredumpctl: remove unnecessary line break

6 days agohwdb: Add Elecom IST Pro trackball (#39762)
Charlie Le [Mon, 17 Nov 2025 13:34:03 +0000 (08:34 -0500)] 
hwdb: Add Elecom IST Pro trackball (#39762)

Added entries for the Elecom IST Pro via its three connection methods- a
USB cable, the included G1000 USB receiver, and Bluetooth.

The G1000 USB receiver _may_ have to be removed in the future depending
on the input devices that can connect to it. According to Elecom, the
receiver can have up to three different input devices connected such as
trackballs, mice, keyboards, etc. That said, as far as I can tell, the
IST Pro is the only released Elecom device that uses the receiver. The
non-pro model and the upcoming Elecom Huge Plus might use the same
receiver, but that should not matter as both devices are trackballs.

6 days agoNEWS: fix typos
Jörg Behrmann [Mon, 17 Nov 2025 13:13:36 +0000 (14:13 +0100)] 
NEWS: fix typos

6 days agoNEWS: more adjustments for v259~rc1
Luca Boccassi [Mon, 17 Nov 2025 12:38:05 +0000 (12:38 +0000)] 
NEWS: more adjustments for v259~rc1