]> git.ipfire.org Git - thirdparty/systemd.git/log
thirdparty/systemd.git
9 hours agotest: temporarily skip the EnterNamespace= test w/o embedded debuginfo
Frantisek Sumsal [Fri, 10 Oct 2025 18:09:51 +0000 (20:09 +0200)] 
test: temporarily skip the EnterNamespace= test w/o embedded debuginfo

The EnterNamespace= feature currently doesn't work if the debuginfo is
separated from the crashing binary. Until that's resolved, let's run the
test only if the test binary has embedded debuginfo (.debug_info
section; e.g. when systemd is built without WITH_DEBUG=1) or it contains
MiniDebugInfo (.gnu_debugdata section; default on Fedora and CentOS).

See: https://github.com/systemd/systemd/pull/39268#issuecomment-3390745718
(cherry picked from commit 80b4cacf1b121c8b1ec444970cc566dc4efd1837)

9 hours agomkosi: install test dependencies for EnterNamespace= test
Frantisek Sumsal [Thu, 9 Oct 2025 15:54:58 +0000 (17:54 +0200)] 
mkosi: install test dependencies for EnterNamespace= test

The test for the EnterNamespace= feature [0] has been both broken and
disabled since the migration to the mkosi framework, as it's missing the
libdw.pc file for pkg-config, so the test is skipped completely, and
it's also missing gcc to actually build the test binary.

[0] Part of TEST-87-AUX-UTILS-VM.coredump.sh

(cherry picked from commit 4d8e8d44ab3f6f99102faf0dcb53ca4de4d517ae)

9 hours agotest: exclude test-stacktrace(-not)?-symbolized from the coredump check
Frantisek Sumsal [Thu, 9 Oct 2025 15:57:25 +0000 (17:57 +0200)] 
test: exclude test-stacktrace(-not)?-symbolized from the coredump check

As they are expected coredumps from the EnterNamespace= feature test.

(cherry picked from commit cfb604f8f7c83912648d69bd3ad89c2436b4b8ef)

9 hours agotest: build the crashing test binary outside of the test
Frantisek Sumsal [Thu, 9 Oct 2025 21:08:19 +0000 (23:08 +0200)] 
test: build the crashing test binary outside of the test

So we don't have to pull in gcc and other stuff into it.

Also, make the test itself a bit more robust and debug-able.

(cherry picked from commit 937f609b41b9e27eba69c5ddbab4df2232e5a37b)

9 hours agotest: use relative paths to executables
Yu Watanabe [Sun, 21 Sep 2025 13:10:21 +0000 (22:10 +0900)] 
test: use relative paths to executables

This also makes shebang always use env command, and drops unnecessary
'bash -c' or 'sh -c' when a signle command is invoked in the shell,
like sleep or echo.

(cherry picked from commit e2c5e9c0116f410a87958c9eeb361cd47fdc34b0)

18 hours agoman: systemd-measure. Remove 'tpm2-pcrs=' from cryptenroll command (#39590)
cvlc12 [Thu, 6 Nov 2025 20:54:06 +0000 (21:54 +0100)] 
man: systemd-measure. Remove 'tpm2-pcrs=' from cryptenroll command (#39590)

This is now default since 4b840414be3b2d6520599d86d2b718a37574aabf.

(cherry picked from commit c3e80f8f2bbd2b79350684f52638cedec00eb8ad)

18 hours agonss-systemd: fix memory leak
jouyouyun [Thu, 6 Nov 2025 03:18:10 +0000 (11:18 +0800)] 
nss-systemd: fix memory leak

(cherry picked from commit 9ebf0d260da18fd84e2f3d587895a82803ed99e2)

18 hours agoask-password-api: return if read_credential() failed
David Tardon [Thu, 6 Nov 2025 13:04:32 +0000 (14:04 +0100)] 
ask-password-api: return if read_credential() failed

The current code causes assertion in strv_parse_nulstr() if
read_credential() results in an error different from ENXIO or ENOENT
(strace shows I'm getting EACCES):

 # homectl create waldo --real-name=Waldo --disk-size=200M

Before:

 Assertion 's || l <= 0' failed at src/basic/nulstr-util.c:32, function strv_parse_nulstr_full(). Aborting.

After:

 Failed to acquire password: Permission denied

Follow-up-for: 8806bb4bc7fa15d6ca46e81b8d535730209a3b66
(cherry picked from commit 399c9f847e222d6e62c553ac9ea2bebeb7c1be7f)

18 hours agohomectl: fix memory leak
David Tardon [Thu, 6 Nov 2025 12:54:35 +0000 (13:54 +0100)] 
homectl: fix memory leak

 # valgrind --leak-check=full homectl create waldo --real-name=Waldo --disk-size=200M --setopt=FOO=bar

Before:

==25155== HEAP SUMMARY:
==25155==     in use at exit: 12,879 bytes in 39 blocks
==25155==   total heap usage: 90 allocs, 51 frees, 53,964 bytes allocated
==25155==
==25155== 8 bytes in 1 blocks are definitely lost in loss record 4 of 38
==25155==    at 0x4845866: malloc (vg_replace_malloc.c:446)
==25155==    by 0x547FC2E: strdup (strdup.c:42)
==25155==    by 0x4B2647C: strv_env_replace_strdup_passthrough (env-util.c:435)
==25155==    by 0x42D547: parse_argv (homectl.c:3909)
==25155==    by 0x43999C: run (homectl.c:5606)
==25155==    by 0x4399F5: main (homectl.c:5613)
==25155==
==25155== LEAK SUMMARY:
==25155==    definitely lost: 8 bytes in 1 blocks

After:

==25224== HEAP SUMMARY:
==25224==     in use at exit: 12,871 bytes in 38 blocks
==25224==   total heap usage: 90 allocs, 52 frees, 53,964 bytes allocated
==25224==
==25224== LEAK SUMMARY:
==25224==    definitely lost: 0 bytes in 0 blocks

Follow-up-for: aaf057c4bbc6055040d7d2c1ec3655ff89249ebd
(cherry picked from commit 5efcbae259826a184dc962822a4e060a21f5175c)

18 hours agoman: clarify what “failed” means
Christoph Anton Mitterer [Sun, 2 Nov 2025 19:13:35 +0000 (20:13 +0100)] 
man: clarify what “failed” means

systemd.service(5)’s documentation of `ExecCondition=` uses “failed” with
respect to the unit active state.
In particular the unit won’t be considered failed when `ExecCondition=`’s
command exits with a status of 1 through 254 (inclusive). It will however, when
it exits with 255 or abnormally (e.g. timeout, killed by a signal, etc.).

The table “Defined $SERVICE_RESULT values” in systemd.exec(5) uses “failed”
however rather with respect to the condition.

Tests seem to have shown that, if the exit status of the `ExecCondition=`
command is one of 1 through 254 (inclusive), `$SERVICE_RESULT` will be
`exec-condition`, if it is 255, `$SERVICE_RESULT` will be `exit-code` (but
`$EXIT_CODE` and `$EXIT_STATUS` will be empty or unset), if it’s killed because
of `SIGKILL`, `$SERVICE_RESULT` will `signal` and if it times out,
`$SERVICE_RESULT` will be `timeout`.

This commit clarifies the table at least for the case of an exit status of 1
through 254 (inclusive).
The others (signal, timeout and 255 are probably also still ambiguous (e.g.
`signal` uses “A service process”, which could be considered as the actual
service process only).

Signed-off-by: Christoph Anton Mitterer <mail@christoph.anton.mitterer.name>
(cherry picked from commit 07f471824288433d17ebe097e94dfca85e74fea6)

18 hours agonss-resolve: fix the ip addr family validity check method
jouyouyun [Wed, 5 Nov 2025 10:03:34 +0000 (18:03 +0800)] 
nss-resolve: fix the ip addr family validity check method

`i` only counts the number of matches with the current family,
while `n_addresses` counts the number of matches with the family INET or INET6.
If the address contains both INET and INET6, `assert(i == n_addresses)` will fail.

(cherry picked from commit fea7f5d68b5a6272ce8989e872a57b42121b5205)

18 hours agoman: fix username prefix mentioned in manual for capsule users (#39573)
Nils K [Wed, 5 Nov 2025 22:33:56 +0000 (23:33 +0100)] 
man: fix username prefix mentioned in manual for capsule users (#39573)

(cherry picked from commit bea3b300bc07271664e0c6f8b73c6e049df9aa1a)

18 hours agotest: ensure test checking status runs first
Luca Boccassi [Thu, 6 Nov 2025 17:13:16 +0000 (17:13 +0000)] 
test: ensure test checking status runs first

The test messes a bit with the ESP, which might cause bootctl status output to change.
Run the test that simply checks status without changing anything first.

[  188.633908] TEST-87-AUX-UTILS-VM.sh[1101]: + bootctl status --quiet
[  188.681082] TEST-87-AUX-UTILS-VM.sh[1155]: System:
[  188.681082] TEST-87-AUX-UTILS-VM.sh[1155]:       Firmware: UEFI 2.70 (EDK II 1.00)
[  188.681082] TEST-87-AUX-UTILS-VM.sh[1155]:  Firmware Arch: x64
[  188.681082] TEST-87-AUX-UTILS-VM.sh[1155]:    Secure Boot: enabled (user)
<...>
[  198.938717] TEST-87-AUX-UTILS-VM.sh[1679]: ++ printf '\6\0\0\0\1'
[  198.939235] TEST-87-AUX-UTILS-VM.sh[1678]: + cmp /sys/firmware/efi/efivars/SecureBoot-8be4df61-93ca-11d2-aa0d-00e098032b8c /dev/fd/63
[  198.944957] TEST-87-AUX-UTILS-VM.sh[1678]: + cmp /sys/firmware/efi/efivars/SetupMode-8be4df61-93ca-11d2-aa0d-00e098032b8c /dev/fd/63
[  198.945808] TEST-87-AUX-UTILS-VM.sh[1681]: ++ printf '\6\0\0\0\0'
[  198.950459] TEST-87-AUX-UTILS-VM.sh[1684]: + bootctl status
[  198.951357] TEST-87-AUX-UTILS-VM.sh[1685]: + grep -q 'Secure Boot: enabled'
[  199.004142] TEST-87-AUX-UTILS-VM.sh[1086]: + echo 'Subtest /usr/lib/systemd/tests/testdata/units/TEST-87-AUX-UTILS-VM.bootctl.sh failed'

Follow-up for 5ae58ac2b93a4046fbae4e0c825b8cc9d03d10d8

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

(cherry picked from commit 7a62cbfc6d1ca687ac5bceb63356ae1faf34be1e)

18 hours agotest: sync journal after the test unit finishes
Frantisek Sumsal [Thu, 6 Nov 2025 13:40:56 +0000 (14:40 +0100)] 
test: sync journal after the test unit finishes

In these two cases we need to sync the journal _after_ the unit finishes
as well, because we try to match messages from systemd itself, not
(only) from the unit, and the messages about units are dispatched
asynchronously.

That is, in the first case (silent-success.service) we want to make sure
that LogLevelMax= filters out messages _about_ units (from systemd) as
well, including messages like "Deactivated..."  and "Finished...", which
are sent out only when/after the unit is stopped.

In the second case we try to match messages with the "systemd" syslog
tag, but these messages come from systemd (obviously) and are sent out
asynchronously, which means they might not reach the journal before we
call `journalctl --sync` from the test unit itself, like happened here:

[ 1754.150391] TEST-04-JOURNAL.sh[13331]: + systemctl start verbose-success.service
[ 1754.172256] bash[13692]: success
[ 1754.221210] TEST-04-JOURNAL.sh[13694]: ++ journalctl -b -q -u verbose-success.service -t systemd
[ 1754.221493] TEST-04-JOURNAL.sh[13331]: + [[ -n '' ]]
[ 1754.175709] systemd[1]: Starting verbose-success.service - Verbose successful service...
[ 1754.221697] TEST-04-JOURNAL.sh[122]: + echo 'Subtest /usr/lib/systemd/tests/testdata/units/TEST-04-JOURNAL.journal.sh failed'
[ 1754.221697] TEST-04-JOURNAL.sh[122]: Subtest /usr/lib/systemd/tests/testdata/units/TEST-04-JOURNAL.journal.sh failed
[ 1754.221697] TEST-04-JOURNAL.sh[122]: + return 1
[ 1754.205408] systemd[1]: verbose-success.service: Deactivated successfully.
[ 1754.205687] systemd[1]: Finished verbose-success.service - Verbose successful service.

By syncing the journal after the unit is stopped we have much bigger
chance that the systemd messages already reached the journal - the race
is technically still there, but the chance we'd hit it should be pretty
negligible.

Resolves: #39555
(cherry picked from commit 7b3046e693cef3e0ce54058852deb8148254bba7)

18 hours agotest: wait for the backgrounded socat job
Frantisek Sumsal [Wed, 5 Nov 2025 14:47:46 +0000 (15:47 +0100)] 
test: wait for the backgrounded socat job

It should exit on its own anyway and this will work even if the job has
already finished* (unlike kill).

[*] assuming job control is off, as it's the case when running the
    test suite

Resolves: #39543
(cherry picked from commit 3849b0701a7713c147400f205e7ddb3e3f93ad26)

18 hours agotest: wait until the nspawn process is completely dead
Frantisek Sumsal [Wed, 5 Nov 2025 17:13:58 +0000 (18:13 +0100)] 
test: wait until the nspawn process is completely dead

Before calling io.systemd.MachineImage.List.

The systemd-nspawn process takes a lock in the run() function in
nspawn.c and holds it for the entire runtime of that function. If we
call `machinectl terminate` the machine gets unregistered _before_ we
release the lock, so the original `machinectl status` check would return
early, allowing for a race where we call io.systemd.MachineImage.List
over Varlink when systemd-nspawn still holds the lock because the
process is still running.:

[   41.691826] TEST-13-NSPAWN.sh[1102]: + machinectl terminate long-running
[   41.695009] systemd-nspawn[2171]: Trying to halt container by sending TERM to container PID 1. Send SIGTERM again to trigger immediate termination.
[   41.698235] systemd-machined[1192]: Machine long-running terminated.
[   41.709520] TEST-13-NSPAWN.sh[1102]: + systemctl kill --signal=KILL systemd-nspawn@long-running.service
[   41.709169] systemd-nspawn[2171]: Failed to unregister machine: No machine 'long-running' known
[   41.720869] TEST-13-NSPAWN.sh[2346]: + varlinkctl --more call /run/systemd/machine/io.systemd.MachineImage io.systemd.MachineImage.List '{}'
[   41.723359] TEST-13-NSPAWN.sh[2347]: + grep long-running
...
[   41.735453] TEST-13-NSPAWN.sh[2352]: + varlinkctl call /run/systemd/machine/io.systemd.MachineImage io.systemd.MachineImage.List '{"name":"long-running", "acquireMetadata": "yes"}'
[   41.736222] TEST-13-NSPAWN.sh[2353]: + grep OSRelease
[   41.739500] TEST-13-NSPAWN.sh[2352]: Method call io.systemd.MachineImage.List() failed: Device or resource busy
[   41.740641] systemd[1]: Received SIGCHLD.
[   41.740670] systemd[1]: Child 2171 (systemd-nspawn) died (code=killed, status=9/KILL)
[   41.740725] systemd[1]: systemd-nspawn@long-running.service: Child 2171 belongs to systemd-nspawn@long-running.service.
[   41.740748] systemd[1]: systemd-nspawn@long-running.service: Main process exited, code=killed, status=9/KILL
[   41.740755] systemd[1]: systemd-nspawn@long-running.service: Will spawn child (service_enter_stop_post): systemd-nspawn
[   41.740872] systemd[1]: systemd-nspawn@long-running.service: About to execute: systemd-nspawn --cleanup --machine=long-running
...

Let's mitigate this by waiting until the corresponding
systemd-nspawn@.service instance enters the 'inactive' state where the
lock should be properly released.

Resolves: #39547
(cherry picked from commit ed4903660c90e862c7834ea39772b887b88f8982)

18 hours agotest: terminate the test containers cleanly on SIGTERM
Frantisek Sumsal [Wed, 5 Nov 2025 17:12:39 +0000 (18:12 +0100)] 
test: terminate the test containers cleanly on SIGTERM

So they exit with 0 instead of 143 when we call `machinectl terminate`
on them.

(cherry picked from commit 79a93bb7f52ce71b9d5027e640f59c0f08fbbbcc)

18 hours agotest-network: disable several more sandbox features when running with sanitizers
Yu Watanabe [Wed, 5 Nov 2025 15:03:16 +0000 (00:03 +0900)] 
test-network: disable several more sandbox features when running with sanitizers

These settings also imply seccomp.
Hopefully fixes #39567.

(cherry picked from commit 454ce423050890bdc8c3c90add3713592a3cab38)

18 hours agotest-network: read default values from environment variables
Yu Watanabe [Wed, 5 Nov 2025 15:21:22 +0000 (00:21 +0900)] 
test-network: read default values from environment variables

Nowadays, the test script is run as a service, and no argument about
sanitizers are passed. Let's read them from the environment variables.

(cherry picked from commit da665b708a5fb734c3114089f2f58783644b7f6f)

18 hours agotest: stop piping post-test journalctl commands to /failed
Luca Boccassi [Tue, 4 Nov 2025 12:51:09 +0000 (12:51 +0000)] 
test: stop piping post-test journalctl commands to /failed

We can't see what the actual issues are when tests fail at that point, eg:

https://github.com/systemd/systemd/actions/runs/19034752357/job/54356278052
(cherry picked from commit 22311a12912509dd8f275b4f5d42383ee70327eb)

18 hours agoci: never go to raw tpm device, always go via resource manager
Lennart Poettering [Mon, 27 Oct 2025 15:15:41 +0000 (16:15 +0100)] 
ci: never go to raw tpm device, always go via resource manager

(cherry picked from commit a9d02df0c7b25e11fce74756009014185bbc3377)

18 hours agoTEST-87-AUX-UTILS-VM: Propagate SYSTEMD_PAGER at one more place
Daan De Meyer [Fri, 31 Oct 2025 07:44:16 +0000 (08:44 +0100)] 
TEST-87-AUX-UTILS-VM: Propagate SYSTEMD_PAGER at one more place

(cherry picked from commit cfabf3eb3b27f26175b54bbc562003404e80fa1e)

18 hours agotest: properly wait for the forked process
Frantisek Sumsal [Thu, 23 Oct 2025 08:28:07 +0000 (10:28 +0200)] 
test: properly wait for the forked process

The process forked off by `systemd-notify --fork` is not a child of the
current shell, so using `wait` doesn't work. This then later causes a
race, when the test occasionally fails because it attempts to start a
new systemd-socket-activate instance before the old one is completely
gone:

[ 1488.947744] TEST-74-AUX-UTILS.sh[1938]: Child 1947 died with code 0
[ 1488.947952] TEST-74-AUX-UTILS.sh[1933]: + assert_eq hello hello
[ 1488.949716] TEST-74-AUX-UTILS.sh[1948]: + set +ex
[ 1488.950112] TEST-74-AUX-UTILS.sh[1950]: ++ cat /proc/1938/comm
[ 1488.945555] systemd[1]: Started systemd-networkd.service - Network Management.
[ 1488.950365] TEST-74-AUX-UTILS.sh[1933]: + assert_in systemd-socket systemd-socket-
[ 1488.950563] TEST-74-AUX-UTILS.sh[1951]: + set +ex
[ 1488.950766] TEST-74-AUX-UTILS.sh[1933]: + kill 1938
[ 1488.950766] TEST-74-AUX-UTILS.sh[1933]: + wait 1938
[ 1488.950766] TEST-74-AUX-UTILS.sh[1933]: .//usr/lib/systemd/tests/testdata/units/TEST-74-AUX-UTILS.socket-activate.sh: line 14: wait: pid 1938 is not a child of this shell
[ 1488.950766] TEST-74-AUX-UTILS.sh[1933]: + :
[ 1488.951486] TEST-74-AUX-UTILS.sh[1952]: ++ systemd-notify --fork -- systemd-socket-activate -l 1234 --now socat ACCEPT-FD:3 PIPE
[ 1488.952222] TEST-74-AUX-UTILS.sh[1953]: Failed to listen on [::]:1234: Address already in use
[ 1488.952222] TEST-74-AUX-UTILS.sh[1953]: Failed to open '1234': Address already in use
[ 1488.956831] TEST-74-AUX-UTILS.sh[1933]: + PID=1953
[ 1488.957078] TEST-74-AUX-UTILS.sh[102]: + echo 'Subtest /usr/lib/systemd/tests/testdata/units/TEST-74-AUX-UTILS.socket-activate.sh failed'
[ 1488.957078] TEST-74-AUX-UTILS.sh[102]: Subtest /usr/lib/systemd/tests/testdata/units/TEST-74-AUX-UTILS.socket-activate.sh failed

(cherry picked from commit c05758663b162c64da4729944023dec8cf684c75)

18 hours agoTEST-75-RESOLVED: stop socket units before stopping the main service
Yu Watanabe [Sun, 19 Oct 2025 03:38:35 +0000 (12:38 +0900)] 
TEST-75-RESOLVED: stop socket units before stopping the main service

Fixes the following warning:
TEST-75-RESOLVED.sh[2251]: ++ restart_resolved
TEST-75-RESOLVED.sh[2251]: ++ systemctl stop systemd-resolved.service
TEST-75-RESOLVED.sh[2271]: Stopping 'systemd-resolved.service', but its triggering units are still active:
TEST-75-RESOLVED.sh[2271]: systemd-resolved-monitor.socket, systemd-resolved-varlink.socket

(cherry picked from commit f88f0271f84f11643fa20198e2346a2ec4e629ed)

18 hours agotest: wait for signed.test's zone DS records to get pushed to the parent zone
Frantisek Sumsal [Wed, 15 Oct 2025 11:26:44 +0000 (13:26 +0200)] 
test: wait for signed.test's zone DS records to get pushed to the parent zone

It looks like the 4 second sleep might not be enough on some slower
machines (like the ARM GH Actions nodes) which can lead to the DS RRs
propagation to clash with the manual test zone edit, and the
signed.test zone then might end up not properly signed:

TEST-75-RESOLVED.sh[749]: + : '--- ZONE: signed.test (static DNSSEC) ---'
TEST-75-RESOLVED.sh[749]: + run_delv @ns1.unsigned.test signed.test
TEST-75-RESOLVED.sh[749]: + run delv -a /etc/bind.keys @ns1.unsigned.test signed.test
TEST-75-RESOLVED.sh[778]: + delv -a /etc/bind.keys @ns1.unsigned.test signed.test
TEST-75-RESOLVED.sh[779]: + tee /tmp/tmp.2KOIiyrgth
TEST-75-RESOLVED.sh[779]: ;; /etc/bind.keys:1: option 'managed-keys' is deprecated
TEST-75-RESOLVED.sh[779]: ;; validating signed.test/DS: no valid signature found
TEST-75-RESOLVED.sh[779]: ;; validating signed.test/A: no valid signature found
TEST-75-RESOLVED.sh[779]: ; unsigned answer
TEST-75-RESOLVED.sh[779]: signed.test. 86400 IN A 10.0.0.10
TEST-75-RESOLVED.sh[779]: signed.test. 86400 IN RRSIG A 13 2 86400 20251028114356 20251014101356 39330 signed.test. oo3ca8WPusbBPRhzsEKw3bsBBqFtI8i4bckoMVNzt7lY+udGW6PlaSYj OjpQGgY9oglowVM9bteNtwJKHUbvtw==
TEST-75-RESOLVED.sh[749]: + grep -qF '; fully validated' /tmp/tmp.2KOIiyrgth
[FAILED] Failed to start TEST-75-RESOLVED.service - TEST-75-RESOLVED.

Let's explicitly wait for the DS records propagation to finish before we
start editing the test zone to avoid this.

I'm still not completely sure if this is the root cause, but it's the
best shot I currently have, so I'll let the CIs decide.

(cherry picked from commit 92631f1962b1bbd253e5d56a4290ab82805dc43a)

18 hours agotest: sign extension images used by TEST-50-DISSECT
Luca Boccassi [Wed, 15 Oct 2025 17:46:26 +0000 (18:46 +0100)] 
test: sign extension images used by TEST-50-DISSECT

(cherry picked from commit c581bc8ad810a7e84952791ec644c569c30bbc56)

18 hours agotest: enable TEST-06-SELINUX in openSUSE
Antonio Alvarez Feijoo [Tue, 14 Oct 2025 14:57:57 +0000 (16:57 +0200)] 
test: enable TEST-06-SELINUX in openSUSE

openSUSE switched to SELinux by default for quite some time now, so this test is
also successful.

(cherry picked from commit 2fbfbfc5fad59031d0351e600c058b3ad218c338)

18 hours agotest: call bash with -o pipefail when piping commands in TEST-50-DISSECT
Luca Boccassi [Wed, 15 Oct 2025 21:58:18 +0000 (22:58 +0100)] 
test: call bash with -o pipefail when piping commands in TEST-50-DISSECT

We want the tests to fail if one of the intermediate commands fails,
otherwise it is hard to spot failures

(cherry picked from commit 0ce88a9132c5f653f50246a0cf1aa274ca2c0c62)

18 hours agotest: also test verity signatures on debian testing/unstable
Luca Boccassi [Wed, 15 Oct 2025 17:46:00 +0000 (18:46 +0100)] 
test: also test verity signatures on debian testing/unstable

debian testing/unstable do not set VERSION_ID, so if missing, assume
it's testing/unstable which are new enough

(cherry picked from commit dc88805d16f9ca28deb061322bcab1bc52e5f0a0)

18 hours agotest: move checks around in TEST-50-DISSECT so that they can be used from multiple...
Luca Boccassi [Wed, 15 Oct 2025 14:27:54 +0000 (15:27 +0100)] 
test: move checks around in TEST-50-DISSECT so that they can be used from multiple subtests

Also set it up so that unprivileged tests can be done

(cherry picked from commit e8d1a26d9c0920c4d190629e239d94e0edcf11a1)

21 hours agonss-myhostname: use FAMILY_ADDRESS_SIZE instead of the integer 16 when copying ip...
jouyouyun [Tue, 4 Nov 2025 12:59:01 +0000 (20:59 +0800)] 
nss-myhostname: use FAMILY_ADDRESS_SIZE instead of the integer 16 when copying ip addr

To avoid copying extra characters when using IPv4.

(cherry picked from commit 05b880ac46b27c65de09d7add6b0e2f5ac3bcd9a)

21 hours agocore: Only apply unprivileged userns logic to user managers
Chris Down [Wed, 5 Nov 2025 10:41:17 +0000 (18:41 +0800)] 
core: Only apply unprivileged userns logic to user managers

Commit 38748596f078 ("core: Make DelegateNamespaces= work for user
managers with CAP_SYS_ADMIN") refactored the logic for when an
unprivileged process should create a new user namespace for sandboxing.

This refactor inadvertently removed a check (`params->runtime_scope !=
RUNTIME_SCOPE_USER`) that differentiated between system services and user
services.

This causes a regression in rootless containers where systemd runs
unprivileged. When starting a system service (like `dbus-broker`) that
uses sandboxing features (eg. with `PrivateTmp=yes`), systemd now
incorrectly creates a new, minimal `PRIVATE_USERS_SELF` namespace.

This new namespace only maps UID/GID 0. When dbus-broker attempts to
drop privileges to the `dbus` user (GID 81), the `setresgid(81, 81, 81)`
call fails because GID 81 is not mapped.

Restore the check to ensure that the special unprivileged sandboxing
logic is only applied to user services, as was the original intent.
System services in a rootless context will now correctly run in the
container's main user namespace, where all necessary UIDs/GIDs are
mapped.

Fixes: https://github.com/systemd/systemd/issues/39563
Fixes: https://bugzilla.redhat.com/show_bug.cgi?id=2391343
(cherry picked from commit 666cd35be493e2d796c5424eed9a3deeddc9b0fe)

21 hours agoTEST-74-AUX-UTILS.run: add test case for #39038
Mike Yuan [Sat, 25 Oct 2025 19:26:54 +0000 (21:26 +0200)] 
TEST-74-AUX-UTILS.run: add test case for #39038

(cherry picked from commit 7400e375786ab45c2c350b7eb6e1209ab54df802)

21 hours agocore/exec-invoke: gracefully handle lack of privilege for initgroups() in user mode
Mike Yuan [Fri, 19 Sep 2025 22:00:14 +0000 (00:00 +0200)] 
core/exec-invoke: gracefully handle lack of privilege for initgroups() in user mode

Otherwise specifying User=SELF also fails because we got
no privilege to call setgroups().

Fixes #39038

(cherry picked from commit c86914667a4ad1debea0cb0cab44df3f10b36dbf)

21 hours agosysext: Check for /etc/initrd-release in given --root= tree
Kai Lueke [Tue, 28 Oct 2025 11:56:45 +0000 (20:56 +0900)] 
sysext: Check for /etc/initrd-release in given --root= tree

Both sysext and confext used the host's /etc/initrd-release file even
when --root=/somewhere was specified. A workaround was the
SYSTEMD_IN_INITRD= env var but without knowing this it was quite
confusing. Aside from users validating their extensions, the primary
use case for this to matter is when the extensions are set up from the
initrd where the initrd-release file is present when running but we want
to prepare the extensions for the final system and thus should match
for the right scope.
Make systemd-sysext check for /etc/initrd-release inside the given
--root= tree. An alternative would be to always ignore the
initrd-release check when --root= is passed but this way it is more
consistent. The image policy logic for EFI-loader-passed extensions
won't take effect when --root= is used, though.

(cherry picked from commit 570eae5007cbf2852f7c314f80224ecf3c828b25)

21 hours agotest: Add missing test cleanup for the last sysext test
Kai Lueke [Tue, 28 Oct 2025 15:08:42 +0000 (00:08 +0900)] 
test: Add missing test cleanup for the last sysext test

The last sysext test leaked things into new tests added later,
uncovered by any new tests leftover check.
Remove the mutable folder state through a trap as done in other tests.

(cherry picked from commit 6649562924f361edca98ce3d015bd7dcda97b076)

21 hours agocgls: print error messages when --unit and --user-unit are used together
jouyouyun [Tue, 4 Nov 2025 08:10:31 +0000 (16:10 +0800)] 
cgls: print error messages when --unit and --user-unit are used together

Mixing the `--unit` and `--user-unit` options will result in error messages.
During the parsing phase, only the `arg_show_unit` record of the last
occurrence of the option is used; all names are placed in the same `arg_names`,
thus mixing the two types of units in the query.

For example, `-u foo --user-unit bar` will also treat `foo` as a user unit and
query it in the user service.

(cherry picked from commit 2b8c7adbecb929f131dc05d8b88babd87cc0ab22)

21 hours agosystemctl: Fix shutdown time parsing across DST changes
Chris Down [Tue, 4 Nov 2025 10:19:07 +0000 (18:19 +0800)] 
systemctl: Fix shutdown time parsing across DST changes

When parsing an absolute time specification like `hh:mm` for the
`shutdown` command, the code interprets a time in the past as "tomorrow
at this time". It currently implements this by adding a fixed 24-hour
duration (`USEC_PER_DAY`) to the timestamp.

This assumption breaks across DST transitions, as the day might not be
24 hours long. This can cause the shutdown to be scheduled at the wrong
time (typically off by one hour in either direction).

Change the logic to perform calendar arithmetic instead of timestamp
arithmetic. If the calculated time is in the past, we increment
`tm.tm_mday` and call `mktime_or_timegm_usec()` a second time.

This delegates all date normalization logic to `mktime()`, which
correctly handles all edge cases, including DST transitions, month-end
rollovers, and leap years.

Fixes: https://github.com/systemd/systemd/issues/39232
(cherry picked from commit a8c3ac66721de23cceff359d946ecd9695bbacb8)

21 hours agosystemctl: downgrade or silence warnings for --now
Zbigniew Jędrzejewski-Szmek [Sun, 26 Oct 2025 10:57:56 +0000 (11:57 +0100)] 
systemctl: downgrade or silence warnings for --now

When calling systemctl enable/disable/reenable --now, we'd always fail with
error when operating offline. This seemly overly restricitive. In particular,
if systemd is not running at all, the service is not running either, so
complaining that we can't stop it is completely unnecessary. But even when
operating in a chroot where systemd is not running, let's just emit a warning
and return success. It's fairly common to have installation or package scripts
which do such calls and not starting/restarting the service in those scenarios
is the desired and expected operation. (If --now is called in combination
with --global or --root=, keep returning an error.)

Also make the messages nicer. I was adding some docs to tell the user to run
'systemctl enable --now', and checked how the command can fail, and the error
message that the user might see in some common scenarios was too complicated.
Split it up to be nicer.

(cherry picked from commit 77a1cc8fa09c264991d147ec71d70a4b5d2a553e)

21 hours agosystemctl: convert return value of install_client_side() to enum
Zbigniew Jędrzejewski-Szmek [Sun, 26 Oct 2025 10:34:22 +0000 (11:34 +0100)] 
systemctl: convert return value of install_client_side() to enum

The checks are reordered to do checks that don't require interacting with the
system first.

(cherry picked from commit 0ff5985176acaccf4d2f220f92e14cd0f6ee82bf)

21 hours agoTEST-65-ANALYZE: Add missing --no-pager
Daan De Meyer [Tue, 28 Oct 2025 10:19:16 +0000 (11:19 +0100)] 
TEST-65-ANALYZE: Add missing --no-pager

(cherry picked from commit da30f59f602c61dc3219d4d7bfea1cccfcc7a139)

21 hours agohomed: always report that registered users are members of their own groups
Lennart Poettering [Tue, 28 Oct 2025 09:04:40 +0000 (10:04 +0100)] 
homed: always report that registered users are members of their own groups

As per the userdb spec we should report in GetMemberships() that users
are in their own groups. Hence follow the spec.

Fixes: #26061
(cherry picked from commit 9851382c124dc81bad559c7bd0a86e8ff37f82ab)

21 hours agorm-rf: make sure we can safely remove dirs we have no access to via rm_rf_at()
Lennart Poettering [Wed, 20 Aug 2025 09:39:41 +0000 (11:39 +0200)] 
rm-rf: make sure we can safely remove dirs we have no access to via rm_rf_at()

Previously, we'd first empty a dir, and then remove it. This works fine
as long as we have access to a dir. But in some cases (like for example
a foreign owned container tree) we might not have access to the dir, but
are still able to remove it (because it is empty, and in a dir we own).
Hence let's try that first. If it works, we do not need to enter the dir
(and thus fail).

(cherry picked from commit 502f7a2b804370d32adb373e661831f583565075)

21 hours agosd-varlink: when expecting a type and refusing due to mismatch say what was received
Luca Boccassi [Sat, 25 Oct 2025 18:57:40 +0000 (19:57 +0100)] 
sd-varlink: when expecting a type and refusing due to mismatch say what was received

Sometimes it is not obvious why a message is not accepted,
so explicitly say what type was received in the log message

(cherry picked from commit d08b2f2a06da445e15f3eb007e3b348e1cd71923)

21 hours agorules: apply loopback block device rule only onto loopback block devices
Lennart Poettering [Fri, 24 Oct 2025 15:03:02 +0000 (17:03 +0200)] 
rules: apply loopback block device rule only onto loopback block devices

Fixes: #39426
Follow-up for: 9422ce83c201ab4154de832331f0b351fc5137f6

(cherry picked from commit 6fac8bb9b1f42bd08236dfc53cf8c37e66a72212)

21 hours agocoredump: handle ENOBUFS and EMSGSIZE the same way
Michal Sekletar [Fri, 24 Oct 2025 10:55:20 +0000 (12:55 +0200)] 
coredump: handle ENOBUFS and EMSGSIZE the same way

Depending on the runtime configuration, e.g. sysctls
net.core.wmem_default= and net.core.rmem_default and on the actual
message size, sendmsg() can fail also with ENOBUFS. E.g. alloc_skb()
failure caused by net.core.[rw]mem_default=64MiB and huge fdinfo list
from process that has 90k opened FDs.

We should handle this case in the same way as EMSGSIZE and drop part of
the message.

(cherry picked from commit 28e62e684b631f928f1d857b04f45f0d34441675)

21 hours agorpm: Make sure we only match files in the directories in triggers
Daan De Meyer [Wed, 22 Oct 2025 20:13:36 +0000 (22:13 +0200)] 
rpm: Make sure we only match files in the directories in triggers

/usr/lib/systemd/system will match /usr/lib/systemd/systemd-networkd,
which is definitely not the intention.

(cherry picked from commit 1835ce2f045815f70849c29426c0c9c0f1a5af9c)

21 hours agomachine-bind-user: Use machine in log messages instead of container
DaanDeMeyer [Fri, 22 Aug 2025 08:52:17 +0000 (10:52 +0200)] 
machine-bind-user: Use machine in log messages instead of container

(cherry picked from commit 9aa6c30bbdd43f62a322516f82ba9ac1780a492b)

21 hours agonspawn: Add --bind-user-shell= to --help
Daan De Meyer [Tue, 21 Oct 2025 19:31:29 +0000 (21:31 +0200)] 
nspawn: Add --bind-user-shell= to --help

(cherry picked from commit 64d5bb4d53a5d002b15d9ff6aa1a0a09597e2074)

21 hours agoMissing policies for polkit as mentioned in freedesktop.org/software/systemd/man
theSillywhat [Sat, 18 Oct 2025 19:55:35 +0000 (15:55 -0400)] 
Missing policies for polkit as mentioned in freedesktop.org/software/systemd/man

(cherry picked from commit 3331d99b491fd334a0695064fcbd19b651016c51)

21 hours agoDo not use "critical assert_return" in libsystemd or libudev
Zbigniew Jędrzejewski-Szmek [Mon, 13 Oct 2025 18:44:05 +0000 (20:44 +0200)] 
Do not use "critical assert_return" in libsystemd or libudev

Previously, when compiled in developer mode, a call into libsystemd with
invalid parameters would result in an abort. This means that it's effectively
impossible to install such libsystemd in a normal system, since various
third-party programs may now abort. A shared library should generally never
abort or exit the calling program.

In python-systemd, the test suite calls into libsystemd, to check if the proper
return values are received and propagated through the Python wrappers.
Obviously with libsystemd compiled from git, the test suite now fails
in a nasty way.

So rework the code to set assert_return_is_critical similarly to how we handle
mempool enablement: the function that returns true is declared as a week
symbol, and we "opt in" by linking a file that provides the function in
libsystemd-shared. Effectively, libsystemd and libudev always have
assert_return_is_critical==false, and our binaries and modules enable it
conditionally.

(cherry picked from commit 0bb0316f5eb2c8d30e91feac571404687c6a0dc2)

21 hours agobasic/mempool: mark mempool_enabled as _pure_
Zbigniew Jędrzejewski-Szmek [Mon, 13 Oct 2025 17:23:55 +0000 (19:23 +0200)] 
basic/mempool: mark mempool_enabled as _pure_

The function internally does caching which means that the result must
always be the same, the definition of a pure function. The compiler might
be able to optimize some repeated calls to the function.

(cherry picked from commit 882dfbde1c3159689eabadfab430aa9c272af163)

21 hours agoRemove dns0.eu from default DNS servers
Septatrix [Tue, 21 Oct 2025 14:07:18 +0000 (16:07 +0200)] 
Remove dns0.eu from default DNS servers

The service has ceased operation.
Partially reverts 02527e95b55f3f970d29d3001269311c60f6717c.

(cherry picked from commit 93b6d432535d954793360e211802ecb2139c6ce1)

21 hours agounits: use Title Case for network generator description string
Lennart Poettering [Mon, 20 Oct 2025 11:01:28 +0000 (13:01 +0200)] 
units: use Title Case for network generator description string

We use Title Case for all other units, do so here too.

(cherry picked from commit 15fec4b6464304dd4abaaea4088b0228c4dfdf6c)

21 hours agocoredumpctl: fix condition for checking coredump journal entry
Yu Watanabe [Fri, 17 Oct 2025 13:48:07 +0000 (22:48 +0900)] 
coredumpctl: fix condition for checking coredump journal entry

If one of PID, UID, GID, or SIGNAL is missing, then parse_uid() and
friends in the below will trigger assertion. This fixes that.

Also, only PID, UID, GID, SIGNAL, and COMM are mandatory fields, but
others are not, hence this drops others from the condition.

Moreover, this mekes 'coredumpctl --list' not fail even if there exists a
broken coredump entry in journal.

(cherry picked from commit 94a23e9c440962634e28b52babcb2b8aadd6ae96)

21 hours agohwdb: don't tag a named Mouse device as pointingstick
Peter Hutterer [Thu, 9 Oct 2025 00:56:54 +0000 (10:56 +1000)] 
hwdb: don't tag a named Mouse device as pointingstick

The generic kernel hid drivers split up devices based on the application
collection, appending a suffix for each collection (e.g. Touchpad,
Mouse, ...). Many i2c touchpads get a "... Mouse" event node which is
mislabelled as pointingstick by the input_id builtin, see commit
3d7ac1c655ec40f3829543072494dcdfb92dbc6b.

Closes: https://github.com/systemd/systemd/issues/36677
(cherry picked from commit c4f072aaadedd9029bf0bef2036fdab8a4a3c180)

21 hours agorules: extend 60-input-id.rules to allow for bus/vid/pid/name matches
Peter Hutterer [Thu, 9 Oct 2025 00:55:16 +0000 (10:55 +1000)] 
rules: extend 60-input-id.rules to allow for bus/vid/pid/name matches

Same approach as used in 70-mouse.rules, allow for a name-based match
optionally combined with bus/vid/pid (which the existing modalias rule
would already allow us anyway). Note that ID_BUS isn't assigned until
after this rule has run so we need to use the id/bustype attribute
directly.

Related to https://github.com/systemd/systemd/issues/36677

(cherry picked from commit 5b647b84a935abd57ff7aaa61d3a64c5c6ffd0db)

21 hours agobpf: do not leak dlopen object
Luca Boccassi [Fri, 17 Oct 2025 10:13:00 +0000 (11:13 +0100)] 
bpf: do not leak dlopen object

CID#1609833

(cherry picked from commit 8112069be0aed99cc56777800481303d4f613550)

21 hours agoefivars: fix potential memory leak
Luca Boccassi [Fri, 17 Oct 2025 09:23:28 +0000 (10:23 +0100)] 
efivars: fix potential memory leak

If 'ret' is not passed, 'x' is leaked

Follow-up for c8d60ae79d1763c6ef16fdb306b65d909a769de8

CID#1621673

(cherry picked from commit 05d45875f74cfb7455d127a5229dca440986e689)

21 hours agodissect: drop leftover assert
Luca Boccassi [Fri, 17 Oct 2025 09:15:24 +0000 (10:15 +0100)] 
dissect: drop leftover assert

This was refactored, and the assert is now wrongly placed. Drop
it to fix coverity warning.

Follow-up for dfdeb0b1cbb05a213f0965eedfe0e7ef06cd39d3

CID#1639975

(cherry picked from commit d2754100864d6de14a4758bfea5d8e4401120c69)

21 hours agocore/mount: properly handle REMOUNTING_* states in mount_stop()
Mike Yuan [Sun, 9 Feb 2025 22:12:15 +0000 (23:12 +0100)] 
core/mount: properly handle REMOUNTING_* states in mount_stop()

Currently, mount_stop() simply turns REMOUNTING_* into corresponding
UNMOUNTING_* states. However the transition is bogus, because
the interruption of remount does not bring down the mount.
Let's instead follow the logic of service_stop(), i.e. terminate
the remount process and spawn umount.

(cherry picked from commit 6ebb91d92fb5ea7d43b22bec1b76cde1230b0e12)

21 hours agocore/mount: remove one more unused temporary variable
Mike Yuan [Fri, 4 Jul 2025 15:05:38 +0000 (17:05 +0200)] 
core/mount: remove one more unused temporary variable

Similar to 3cea9c403c6d5ff0edb2b8fc99884f2243b1456e,
but for mount_get_what_escaped().

(cherry picked from commit a8fe8e83447a39831a23d82a82614fc19f2b9b46)

21 hours agocore: Don't use TTYPath= for PAM unless StandardInput=tty
Daan De Meyer [Thu, 16 Oct 2025 06:42:03 +0000 (08:42 +0200)] 
core: Don't use TTYPath= for PAM unless StandardInput=tty

Fixes #39334

(cherry picked from commit f875a8026ec2dfa6026da3ee216782e9f7c04a43)

21 hours agonsresource: fix varlink method dispatch table
Yu Watanabe [Wed, 15 Oct 2025 01:25:11 +0000 (10:25 +0900)] 
nsresource: fix varlink method dispatch table

Follow-up for 716bf93c4bde07c1870b9b0837f2ec33f36686f1 (v258).

(cherry picked from commit 0d87de0b8ed77f05c3f60dbee7b801cf3dd5f647)

21 hours agotimer: rebase the next elapse timestamp only if timer didn't already run
Frantisek Sumsal [Mon, 13 Oct 2025 15:36:55 +0000 (17:36 +0200)] 
timer: rebase the next elapse timestamp only if timer didn't already run

The test added in f4c3c107d9be4e922a080fc292ed3889c4e0f4a5 uncovered a
corner case while recalculating the next elapse timestamp of a timer unit
that uses RandomizedDelaySec= during deserialization.

If the scheduled time (without RandomizedDelaySec=) already elapsed,
systemd "rebases" the next elapse timestamp to the time when systemd
first started, to make the RandomizedDelaySec= feature work even at
boot. However, since it was done unconditionally, it always overrode the
next elapse timestamp, which could then cause the final next elapse
timestamp to fall out of the expected window.

With a couple of additional debug logs one of the test fail looks like
this:

[  132.129815] TEST-53-TIMER.sh[384]: + : 'Next elapse timestamp after daemon-reload, try #328'
[  132.129815] TEST-53-TIMER.sh[384]: + systemctl daemon-reload
[  132.136352] systemd[1]: Reload requested from client PID 16399 ('systemctl') (unit TEST-53-TIMER.service)...
[  132.136636] systemd[1]: Reloading...
[  132.446160] systemd[1]: Rebasing next elapse timestamp
[  132.446168] systemd[1]: v->next_elapse: Tue 2025-10-14 00:10:00 CEST
[  132.446170] systemd[1]: rebased: Tue 2025-10-14 00:10:56 CEST
[  132.446172] systemd[1]: v->next_elapse after rebase: Tue 2025-10-14 00:10:56 CEST
[  132.447361] systemd[1]: Reloading finished in 310 ms.
[  132.484041] TEST-53-TIMER.sh[384]: + check_elapse_timestamp
[  132.484041] TEST-53-TIMER.sh[384]: + systemctl status timer-RandomizedDelaySec-16377.timer
[  132.533657] TEST-53-TIMER.sh[16440]: ● timer-RandomizedDelaySec-16377.timer
[  132.533657] TEST-53-TIMER.sh[16440]:      Loaded: loaded (/run/systemd/system/timer-RandomizedDelaySec-16377.timer; static)
[  132.533657] TEST-53-TIMER.sh[16440]:      Active: active (waiting) since Mon 2025-10-13 23:00:00 CEST; 1h 13min ago
[  132.533657] TEST-53-TIMER.sh[16440]:  Invocation: 5555d4f060114a5493ff228013830d17
[  132.533657] TEST-53-TIMER.sh[16440]:     Trigger: Tue 2025-10-14 22:10:04 CEST; 21h left
[  132.533657] TEST-53-TIMER.sh[16440]:    Triggers: ● timer-RandomizedDelaySec-16377.service
[  132.533657] TEST-53-TIMER.sh[16440]: Oct 14 00:13:07 H systemd[1]: timer-RandomizedDelaySec-16377.timer: Changed dead -> waiting
[  132.533657] TEST-53-TIMER.sh[16440]: Oct 14 00:13:07 H systemd[1]: timer-RandomizedDelaySec-16377.timer: Adding 15h 35min 1.230173s random time.
[  132.533657] TEST-53-TIMER.sh[16440]: Oct 14 00:13:07 H systemd[1]: timer-RandomizedDelaySec-16377.timer: Realtime timer elapses at Tue 2025-10-14 15:45:58 CEST.
[  132.533657] TEST-53-TIMER.sh[16440]: Oct 14 00:13:07 H systemd[1]: timer-RandomizedDelaySec-16377.timer: Changed dead -> waiting
[  132.533657] TEST-53-TIMER.sh[16440]: Oct 14 00:13:08 H systemd[1]: timer-RandomizedDelaySec-16377.timer: Adding 16h 29min 44.084409s random time.
[  132.533657] TEST-53-TIMER.sh[16440]: Oct 14 00:13:08 H systemd[1]: timer-RandomizedDelaySec-16377.timer: Realtime timer elapses at Tue 2025-10-14 16:40:41 CEST.
[  132.533657] TEST-53-TIMER.sh[16440]: Oct 14 00:13:08 H systemd[1]: timer-RandomizedDelaySec-16377.timer: Changed dead -> waiting
[  132.533657] TEST-53-TIMER.sh[16440]: Oct 14 00:13:08 H systemd[1]: timer-RandomizedDelaySec-16377.timer: Adding 21h 59min 7.955828s random time.
[  132.533657] TEST-53-TIMER.sh[16440]: Oct 14 00:13:08 H systemd[1]: timer-RandomizedDelaySec-16377.timer: Realtime timer elapses at Tue 2025-10-14 22:10:04 CEST.
[  132.533657] TEST-53-TIMER.sh[16440]: Oct 14 00:13:08 H systemd[1]: timer-RandomizedDelaySec-16377.timer: Changed dead -> waiting
[  132.535386] TEST-53-TIMER.sh[384]: + systemctl show -p InactiveExitTimestamp timer-RandomizedDelaySec-16377.timer
[  132.537727] TEST-53-TIMER.sh[16442]: InactiveExitTimestamp=Mon 2025-10-13 23:00:00 CEST
[  132.540317] TEST-53-TIMER.sh[16444]: ++ systemctl show -P NextElapseUSecRealtime timer-RandomizedDelaySec-16377.timer
[  132.547745] TEST-53-TIMER.sh[384]: + NEXT_ELAPSE_REALTIME='Tue 2025-10-14 22:10:04 CEST'
[  132.548020] TEST-53-TIMER.sh[16445]: ++ date '--date=Tue 2025-10-14 22:10:04 CEST' +%s
[  132.550218] TEST-53-TIMER.sh[384]: + NEXT_ELAPSE_REALTIME_S=1760472604
[  132.550218] TEST-53-TIMER.sh[384]: + : 'Next elapse timestamp should be Tue 2025-10-14 00:10:00 CEST <= Tue 2025-10-14 22:10:04 CEST <= Tue 2025-10-14 22:10:00 CEST'
[  132.550218] TEST-53-TIMER.sh[384]: + assert_ge 1760472604 1760393400
[  132.550555] TEST-53-TIMER.sh[16446]: + set +ex
[  132.550702] TEST-53-TIMER.sh[384]: + assert_le 1760472604 1760472600
[  132.550832] TEST-53-TIMER.sh[16447]: + set +ex
[  132.551091] TEST-53-TIMER.sh[16447]: FAIL: '1760472604' > '1760472600'

Here the original next elapse timestamp was Tue 2025-10-14 00:10:00 CEST
as expected, but it was overridden by the rebased timestamp:
Tue 2025-10-14 00:10:56 CEST. And when a new randomized delay was added
to it (21h 59min 7.955828s) the final next elapse timestamp fell out of
the expected window, i.e. Tue 2025-10-14 00:10:00 (scheduled time) <
Tue 2025-10-14 22:10:04 CEST (rebased elapse timestamp + randomized
delay) < Tue 2025-10-14 22:10:00 CEST (scheduled time + maximum from
RandomizedDelaySec=, i.e. 22h).

By limiting the timestamp rebase only the case where the unit hasn't
already run should prevent this from happening during daemon-reload.

(cherry picked from commit bdb8e584f4509de0daebbe2357d23156160c3a90)

21 hours agotest: format the min/max timestamps in "systemd" style
Frantisek Sumsal [Mon, 13 Oct 2025 15:35:02 +0000 (17:35 +0200)] 
test: format the min/max timestamps in "systemd" style

Before:
  Next elapse timestamp should be Sun Oct 12 00:10:00 UTC 2025 <= Sun 2025-10-12 05:43:04 UTC <= Sun Oct 12 22:10:00 UTC

After:
  Next elapse timestamp should be Tue 2025-10-14 00:10:00 CEST <= Tue 2025-10-14 19:39:11 CEST <= Tue 2025-10-14 22:10:00 CEST
(cherry picked from commit 62ca845ac776d5877fe46dab52692053df6c8efa)

21 hours agocore: allow split /usr/local/s?sbin with merged /usr/s?bin
Zbigniew Jędrzejewski-Szmek [Fri, 10 Oct 2025 12:29:50 +0000 (14:29 +0200)] 
core: allow split /usr/local/s?sbin with merged /usr/s?bin

Previously, we used either the fully split path or the fully merged path,
treating "split sbin" as a boolean condition. The idea was that conversion to
to merged bin would be a single event, so we don't need to care about the
details of the transition. But it turns out that some systems may be converted
in disparate steps. In https://bugzilla.redhat.com/show_bug.cgi?id=2400220,
there was a lengthy discussion about a coreos system where
/usr/local/{bin,sbin} were created as separate directories. Since /usr/local is
not part of the packaged system, it might remain split for a longer time. So
check /usr/local/s?bin separately and stop adding /usr/sbin to $PATH if only
/usr/local/s?bin is split. (I don't think it makes sense to handle the reverse
case, i.e. only /usr/s?bin being split, since that should be much rarer.)

Inspired by https://bugzilla.redhat.com/show_bug.cgi?id=2400220.

(cherry picked from commit e63917abe16c37c828f99710f1e9922093d9a2b9)

21 hours agocore/service: properly handle freezer action -> watchdog propagation
Mike Yuan [Mon, 6 Oct 2025 00:03:12 +0000 (02:03 +0200)] 
core/service: properly handle freezer action -> watchdog propagation

Follow-up for 25178aadb2bd04ef9e63f48c1ef42fb309f9332e

(cherry picked from commit 4f07ec2b651e40fe04455e660606d2a0f9ae375c)

21 hours agocore/service: drop "cgroup" part of service_cgroup_freezer_action()
Mike Yuan [Sun, 5 Oct 2025 23:46:58 +0000 (01:46 +0200)] 
core/service: drop "cgroup" part of service_cgroup_freezer_action()

This operates on more than cgroup, hence use generic naming,
which also aligns with slice_freezer_action().

(cherry picked from commit b5381d76d591a3cf428bc1a5f3e187dccaf5ea2e)

21 hours agounit-def: introduce freezer_state_objective()
Mike Yuan [Mon, 6 Oct 2025 00:27:55 +0000 (02:27 +0200)] 
unit-def: introduce freezer_state_objective()

No functional change, preparation for later commits.

(cherry picked from commit 1cbbb05bc76015bb6f48c217453e98a73cc30344)

28 hours agomkosi: Disable lto feature of systemd spec
Daan De Meyer [Wed, 29 Oct 2025 12:56:16 +0000 (13:56 +0100)] 
mkosi: Disable lto feature of systemd spec

This makes sure the systemd spec doesn't check if LTO is working as
expected when it is actually disabled.

(cherry picked from commit a835537f75875bdc1a5d49b82c99c0fccd598366)

28 hours agolibsystemd: drop unused header
Yu Watanabe [Tue, 4 Nov 2025 17:42:19 +0000 (02:42 +0900)] 
libsystemd: drop unused header

Follow-up for 2dbf1c0f1556bcf8fbab2491ec0f23a85884c551.

(cherry picked from commit 89040373dd989d22ca62e4aff9b9328c1d1a8d68)

28 hours agotree-wide: add missing '#pragma once'
Yu Watanabe [Sun, 2 Nov 2025 08:43:14 +0000 (17:43 +0900)] 
tree-wide: add missing '#pragma once'

(cherry picked from commit 5963cdf49867885d1d0641fe0693a3513aa4182a)

28 hours agomkosi: update fedora commit reference to 8e2833a5b64f7e2ce62ea0a2d0ec9e393e718dfa
Zbigniew Jędrzejewski-Szmek [Mon, 3 Nov 2025 11:19:37 +0000 (12:19 +0100)] 
mkosi: update fedora commit reference to 8e2833a5b64f7e2ce62ea0a2d0ec9e393e718dfa

8e2833a5b6 Automatically figure out the name of the top-level tar dir
dffbf2beba Make sure fallback source is listed first
1d3b892105 Enable sysupdate and sysupdated

(cherry picked from commit 9218e4eacc545a36a1275264013cb3d6b3eef41f)

28 hours agobacklight: fix typo
jouyouyun [Mon, 3 Nov 2025 08:04:33 +0000 (16:04 +0800)] 
backlight: fix typo

(cherry picked from commit 10cdb586905e7620fd67e723d42464e4b96dd950)

28 hours agobootctl: fix typo
jouyouyun [Mon, 3 Nov 2025 06:17:35 +0000 (14:17 +0800)] 
bootctl: fix typo

(cherry picked from commit 49ca2d87780354c5bb791da06b926111b4522450)

28 hours agodocs: add comment about requiring the mount hierarchy to be mounted MS_SHARED
Lennart Poettering [Sat, 1 Nov 2025 21:21:32 +0000 (22:21 +0100)] 
docs: add comment about requiring the mount hierarchy to be mounted MS_SHARED

This has been tripping up container manager people. let's document this
explicitly.

(Note that the container interface could really use some updates, i.e.
it was written before a time where cgroup namespacing was a thing. But I
am too lazy to fix that now, so let's just add this once facet.)

(cherry picked from commit 32f4e30be58c2d5fabff32efbd4d266ae0d7503d)

28 hours agodoc: indicate Type=oneshot also detects invocation failures
Christoph Anton Mitterer [Mon, 20 Oct 2025 01:30:58 +0000 (03:30 +0200)] 
doc: indicate Type=oneshot also detects invocation failures

Type `simple` explicitly mentions that invocation failures like a missing binary
or `User=` name won’t get detected – whereas type `exec` mentions that it does.

Type `oneshot` refers to being similar to `simple`, which could lead one to
assume it doesn’t detect such invocation failures either – it seems however it
does.

Indicate this my changing its wording to be similar to `exec`.

Signed-off-by: Christoph Anton Mitterer <mail@christoph.anton.mitterer.name>
(cherry picked from commit a983cf253fd099877eae1fa125c95bdef578a15b)

28 hours agoman: fix outdated link to freedesktop.org documentation (#39511)
Florian [Fri, 31 Oct 2025 17:03:43 +0000 (18:03 +0100)] 
man: fix outdated link to freedesktop.org documentation (#39511)

Freedesktop changed their link format.

(cherry picked from commit f2875c73a2a6816fe190eae2549681922b65925e)

28 hours agonspawn: Fix docs
Daan De Meyer [Thu, 30 Oct 2025 21:20:36 +0000 (22:20 +0100)] 
nspawn: Fix docs

(cherry picked from commit 097b6d3f662c9c2917360ea779bc531039ba96f1)

28 hours agoman: clarify quoting of `$` in command lines (#39494)
Christoph Anton Mitterer [Fri, 31 Oct 2025 06:28:57 +0000 (07:28 +0100)] 
man: clarify quoting of `$` in command lines (#39494)

When the special executable prefix `:` is used, `$$` yield the literal `$$`.

(cherry picked from commit bfb365d92445f8ac0bb5c57106a8598dc5eb56d4)

28 hours agoman: clarify requirements for BridgeVLAN to work
dgengtek [Thu, 30 Oct 2025 18:50:11 +0000 (19:50 +0100)] 
man: clarify requirements for BridgeVLAN to work

(cherry picked from commit 4207abb6e108ada8b24f2008533090f318b789e4)

28 hours agoman: handle leading/trailing/repeating whitespaces in anchor links
Frantisek Sumsal [Thu, 23 Oct 2025 13:30:52 +0000 (15:30 +0200)] 
man: handle leading/trailing/repeating whitespaces in anchor links

So even if a <term> section contains newlines, we get a reasonable
anchor link to it.

Before:
<dt id="
  bind
  UNIT
  PATH
  [PATH]
"><span class="term">
...
<a class="headerlink" title="Permalink to this term" href="#%0A%20%20%20%20%20%20%20%20%20%20%20%20bind%0A%20%20%20%20%20%20%20%20%20%20%20%20UNIT%0A%20%20%20%20%20%20%20%20%20%20%20%20PATH%0A%20%20%20%20%20%20%20%20%20%20%20%20[PATH]%0A%20%20%20%20%20%20%20%20%20%20">¶</a>

After:
<dt id="bind UNIT PATH [PATH]"><span class="term">
...
<a class="headerlink" title="Permalink to this term" href="#bind%20UNIT%20PATH%20[PATH]">¶</a>

Resolves: #39196
(cherry picked from commit 7168535165282772b0a1de56ba3c8fbf506fbe95)

28 hours agozsh: add completion for dbus bus address
Ronan Pigott [Sun, 26 Oct 2025 04:04:03 +0000 (21:04 -0700)] 
zsh: add completion for dbus bus address

The DBUS_SESSION_BUS_ADDRESS and DBUS_SYSTEM_BUS_ADDRESS parameters have
an interesting syntax thats useful to complete. Let's include a
completion definition for these parameters.

(cherry picked from commit 6f8e6e50a0e3901e347840c323b1b450945d047a)

28 hours agoman/network: extend document about the default value of IPv6AcceptRA=
Yu Watanabe [Tue, 21 Oct 2025 17:52:28 +0000 (02:52 +0900)] 
man/network: extend document about the default value of IPv6AcceptRA=

Prompted by #39304.

(cherry picked from commit cc7ccd3c6a2be9203057f81be4ef55e94b2ab85c)

28 hours agoman: Clarify usage of /usr/share/factory/ in programs
Ryan Brue [Mon, 18 Aug 2025 17:12:26 +0000 (12:12 -0500)] 
man: Clarify usage of /usr/share/factory/ in programs

As discussed in this thread:
https://github.com/redhat-performance/tuned/issues/798#issuecomment-3197697654

/usr/share/factory/ is not intended to be read from by programs,
but the wording in the FHS can be misread to think that programs
should be using /usr/share/factory/ as the vendor supplied configuration
directory rather than something like /usr/lib/foo/ or /usr/share/foo/.

This commit points developers to the UAPI configuration spec for how to
make their programs hermetic /usr/ compatible.

Signed-off-by: Ryan Brue <ryanbrue.dev@gmail.com>
(cherry picked from commit e80c5eb6e63c394fd90c2d8cf454ee649e59ae21)

28 hours agoman: fix position of </para> tag
Yu Watanabe [Mon, 20 Oct 2025 05:26:28 +0000 (14:26 +0900)] 
man: fix position of </para> tag

Follow-up for 65664bba4090816f7e1fe40ed743480c19d702ee.

(cherry picked from commit b200f57bfaf19054e5f9e175e8b760a7a8e585e4)

28 hours agodocs: fix conversion / calculation errors
Marien Zwart [Sun, 19 Oct 2025 13:41:08 +0000 (00:41 +1100)] 
docs: fix conversion / calculation errors

0x1770 is 6000, not 60000. It looks like 60000 is intended (the next
range starts at 60000 in both decimal and hex), so use that.

1000 to 60000 is 59001 users, as the range is inclusive on both sides.
Similar off-by-one for one of the "unused" ranges. After these changes,
the sizes of the ranges up to and including the "-1" ID sum up to 65536,
as expected.

I'm not sure where the size of the unused range after the container UID
range came from, but it is not correct (the "Container UID" and this
reserved range combined would be larger than the "HIC SVNT LEONES" 2^31
to 2^32-2 range...). Fix it.

It is unfortunate that the first half of this table makes more sense in
decimal while the second half makes more sense in hex (which would also
make the size in 65536 chunks easy to obtain): I'm tempted to add a
"sizes in hex" column...

(cherry picked from commit 1599b6fbe2aec1431c026fdbdc510e704e9fe8dd)

28 hours agotest: avoid divide-by-zero coverity warning
Luca Boccassi [Fri, 17 Oct 2025 10:42:20 +0000 (11:42 +0100)] 
test: avoid divide-by-zero coverity warning

CID#1587762

(cherry picked from commit d0a066a1a4a391f629f7f52b5005103f8daf411f)

28 hours agomkosi: install new knot-keymgr in Fedora rawhide
Luca Boccassi [Fri, 17 Oct 2025 12:30:37 +0000 (13:30 +0100)] 
mkosi: install new knot-keymgr in Fedora rawhide

https://src.fedoraproject.org/rpms/knot/c/52aa1c6b27ca981abe9960c0a4161be7204be75e

TEST-75-RESOLVED.sh[116]: + keymgr . generate algorithm=ECDSAP256SHA256 ksk=yes zsk=yes
TEST-75-RESOLVED.sh[454]: /usr/lib/systemd/tests/testdata/units/TEST-75-RESOLVED.sh: line 153: keymgr: command not found

(cherry picked from commit dc567bc4060131dadc482929bd03ade72f6fb6d4)

28 hours agoman/systemd-systemd.conf: describe DefaultEnvironment= and ManagerEnvironment= better
Zbigniew Jędrzejewski-Szmek [Fri, 10 Oct 2025 16:28:09 +0000 (18:28 +0200)] 
man/systemd-systemd.conf: describe DefaultEnvironment= and ManagerEnvironment= better

The description of ME= said "see above", but it was actually above the other
one. So change the order. But while reading this, I found it very hard to
understand. So reword things, hopefully in a way that is easier to understand.
The current behaviour is rather complex and unintuitive, but this description
just tries to describe it truthfully.

(cherry picked from commit 938f7fea7c953e5f5e9e199a5fcd22ac84fd1240)

28 hours agoman/crypttab: avoid using jargon spelling
Zbigniew Jędrzejewski-Szmek [Thu, 9 Oct 2025 10:17:09 +0000 (12:17 +0200)] 
man/crypttab: avoid using jargon spelling

(cherry picked from commit 5a8a6d471e8786980304d96b6ce908ad8983a368)

2 weeks agoci: add bpftool workaround to coverity too
Luca Boccassi [Sat, 18 Oct 2025 13:23:59 +0000 (14:23 +0100)] 
ci: add bpftool workaround to coverity too

(cherry picked from commit d29f181cf02100c146fc8691a5515a708d06ddbf)

2 weeks agoci: fix workaround about bpftool for codeql
Yu Watanabe [Sat, 18 Oct 2025 01:39:13 +0000 (10:39 +0900)] 
ci: fix workaround about bpftool for codeql

Follow-up for e9fd2bbfffc5c2c7cd1ea0a288d5435fc15e387f.

(cherry picked from commit a6836cfa0bdf1bb1fcf05686c5af3f2b5ad97f6b)

2 weeks agoci: add bpftool workaround to codeql job too
Luca Boccassi [Fri, 17 Oct 2025 14:39:09 +0000 (15:39 +0100)] 
ci: add bpftool workaround to codeql job too

(cherry picked from commit e9fd2bbfffc5c2c7cd1ea0a288d5435fc15e387f)

2 weeks agoci: re-enable bpf-framework option for build and unit test jobs
Luca Boccassi [Fri, 17 Oct 2025 13:00:23 +0000 (14:00 +0100)] 
ci: re-enable bpf-framework option for build and unit test jobs

Use the same trickery we do in the package build and search for
the actual bpftool binary. For the CI job any one we find is
good enough.
When we switch all jobs to 26.04 we can drop all of this.

This reverts commit cc814110af7a453db898ea2990a0281616d5ceff.

(cherry picked from commit 3b11139c0db9dd0a37b0493a8d2ad5f531a92344)

2 weeks agoci: Disable bpf-framework option for build and unit test jobs
Daan De Meyer [Fri, 17 Oct 2025 09:53:48 +0000 (11:53 +0200)] 
ci: Disable bpf-framework option for build and unit test jobs

/usr/sbin/bpftool is completely broken inside containers on
Ubuntu which makes meson blow up so disable the bpf-framework
stuff to avoid the issue.

TODO: Drop when we move off Ubuntu Noble as this will be fixed
in the next Ubuntu LTS release.

(cherry picked from commit cc814110af7a453db898ea2990a0281616d5ceff)

2 weeks agocore/unit: fail earlier before spawning executor when we failed to realize cgroup
Yu Watanabe [Tue, 23 Sep 2025 20:29:22 +0000 (05:29 +0900)] 
core/unit: fail earlier before spawning executor when we failed to realize cgroup

Before 23ac08115af83e3a0a937fa207fc52511aba2ffa, even if we failed to
create the cgroup for a unit, a cgroup runtime object for the cgroup is
created with the cgroup path. Hence, the creation of cgroup is failed,
execution of the unit will fail in posix_spawn_wrapper() and logged
something like the following:
```
systemd[1]: testservice.service: Failed to create cgroup /testslice.slice/testservice.service: Cannot allocate memory
systemd[1]: testservice.service: Failed to spawn executor: No such file or directory
systemd[1]: testservice.service: Failed to spawn 'start' task: No such file or directory
systemd[1]: testservice.service: Failed with result 'resources'.
systemd[1]: Failed to start testservice.service.
```

However, after the commit, when we failed to create the cgroup, a cgroup
runtime object is not created, hence NULL will be assigned to
ExecParameters.cgroup_path in unit_set_exec_params().
Hence, the unit process will be invoked in the init.scope.
```
systemd[1]: testservice.service: Failed to create cgroup /testslice.slice/testservice.service: Cannot allocate memory
systemd[1]: Starting testservice.service...
cat[1094]: 0::/init.scope
systemd[1]: testservice.service: Deactivated successfully.
systemd[1]: Finished testservice.service.
```
where the test service calls 'cat /proc/self/cgroup'.

To fix the issue, let's fail earlier when we failed to create cgroup.

Follow-up for 23ac08115af83e3a0a937fa207fc52511aba2ffa (v258).

(cherry picked from commit 8b4ee3d68d2e70d9a396b74d155eab3b11763311)

3 weeks agomeson: bump version to 258.1 v258.1
Zbigniew Jędrzejewski-Szmek [Mon, 13 Oct 2025 15:01:55 +0000 (17:01 +0200)] 
meson: bump version to 258.1

3 weeks agohwdb: update to main@{2025-10-13}
Zbigniew Jędrzejewski-Szmek [Mon, 13 Oct 2025 10:28:13 +0000 (12:28 +0200)] 
hwdb: update to main@{2025-10-13}

git restore -s origin/main hwdb.d/ test/hwdb.d && git checkout hwdb.d/meson.build

This primarily reverts some changes made in the previous update.