Luca Boccassi [Wed, 22 May 2024 22:17:03 +0000 (23:17 +0100)]
NEWS: finalize for v256~rc3
Luca Boccassi [Wed, 22 May 2024 22:13:35 +0000 (00:13 +0200)]
Merge pull request #32986 from bluca/chores
Chores for RC3
Luca Boccassi [Wed, 22 May 2024 20:25:35 +0000 (21:25 +0100)]
meson: set version to 256~rc3
Luca Boccassi [Wed, 22 May 2024 20:17:24 +0000 (21:17 +0100)]
Update autosuspend hwdb
ninja -C build update-hwdb-autosuspend
Luca Boccassi [Wed, 22 May 2024 20:16:39 +0000 (21:16 +0100)]
Update hwdb
ninja -C build update-hwdb
Luca Boccassi [Wed, 22 May 2024 20:14:22 +0000 (21:14 +0100)]
NEWS: update contributors list
Michal Sekletar [Wed, 22 May 2024 15:15:07 +0000 (17:15 +0200)]
libsystemd: link with '-z nodelete'
We want to avoid reinitialization of our global variables with static
storage duration in case we get dlopened multiple times by the same
application. This will avoid potential resource leaks that could have
happened otherwise (e.g. leaking journal socket fd).
Christian Göttsche [Sun, 19 May 2024 13:56:18 +0000 (15:56 +0200)]
sd-bus: close peer pidfd
Do not leak the pidfd of the peer.
Fixes:
71be64064c9e ("sd-bus: add pidfd to the sd_bus_creds structure")
Lennart Poettering [Sat, 11 May 2024 11:50:26 +0000 (13:50 +0200)]
varlinkctl: when operating in --more mode, fail correcly on Varlink method error
In varlink.c we generally do not make failing callback functions fatal,
since that should be up to the app. Hence, in case of varlinkctl (where
we want failures to be fatal), make sure to propagate the error back
explicitly.
Before this change a failing call to "varlinkctl --more call …" would result in
a zero exit code. With this it will correctly exit with a non-zero exit
code.
Yu Watanabe [Wed, 22 May 2024 15:38:38 +0000 (00:38 +0900)]
sd-ndisc: do not print "(null)" in the log message
If we received RA with no flags set, or with an invalid preference,
previously "(null)" was printed.
Follow-up for
238ed432c347ddf7dde7825feb2672b089583103.
Fixes https://github.com/systemd/systemd/pull/32308#discussion_r1600940289.
Luca Boccassi [Wed, 22 May 2024 20:07:31 +0000 (22:07 +0200)]
Merge pull request #32945 from bluca/lxc_network_test
Fix tests and services with PrivateNetwork=yes running under LXC with AppArmor
Luca Boccassi [Wed, 22 May 2024 20:03:46 +0000 (22:03 +0200)]
Merge pull request #32975 from yuwata/revert-soft-reboot-reordering
Revert soft-reboot unit reordering
Luca Boccassi [Tue, 21 May 2024 00:43:24 +0000 (01:43 +0100)]
test: do not fail network namespace test with permission issues
When running in LXC with AppArmor we'll most likely get an error when creating
a network namespace due to a kernel regression in < v6.2 affecting AppArmor,
resulting in denials. Like other tests, avoid failing in case of permission
issues and handle it gracefully.
Yu Watanabe [Wed, 22 May 2024 15:03:42 +0000 (00:03 +0900)]
units: stop systemd-journald before systemd-soft-reboot.service
Typically, soft-reboot.target is never reached. So, without this change,
systemd-journald may be killed by PID1 on soft-reboot, and may cause
journal corruption.
Yu Watanabe [Wed, 22 May 2024 14:59:32 +0000 (23:59 +0900)]
man: swap the order of soft-reboot.service and .target
Follow-up for the previous revert commit.
Yu Watanabe [Wed, 22 May 2024 14:53:13 +0000 (23:53 +0900)]
Revert "units: do not soft-reboot before soft-reboot.target reached"
This reverts commit
4263d7617f0e6ea741e227db223ac6085479165f.
Still I think this is the way to go. But the change was merged after -rc2,
and still discussion is continued. So, at least now let's revert it,
and do that after v256-final is released if approved.
Luca Boccassi [Tue, 21 May 2024 23:17:10 +0000 (00:17 +0100)]
lock-util: do not expect EACCES when it cannot happen
As per the documentation, EACCES is only returned when F_SETLK is
used, and only on some platforms, which doesn't seem to include
Linux:
https://github.com/torvalds/linux/blob/master/fs/locks.c
F_OFD_SETLK is documented to only return EAGAIN, and F_SETLKW/F_OFD_SETLKW
are blocking operations so this logic doesn't apply to them in the
first place.
Hence, only automatically convert EACCES into EAGAIN for F_SETLK
operations, and propagate the original error in the other cases.
This is important because in some cases we catch permission errors
and gracefully fallback, which is not possible if the original error
is lost.
This is an issue in practice because, due to a kernel bug present
before v6.2, AppArmor denies locking on file descriptors to LXC
containers. We support all currently maintained LTS kernels,
including v6.1, where despite a lot of effort and attempts over almost
a year, the bugfix still hasn't been backported, as it is complex and
requires large changes to AppArmor.
On affected kernels, all services running with PrivateNetwork=yes
fail and do not recover, instead of the normal behaviour of gracefully
downgrading to PrivateNetwork=no.
The integration tests in the Debian CI fail due to this issue:
https://ci.debian.net/packages/s/systemd/testing/arm64/
46828037/
Yu Watanabe [Wed, 22 May 2024 00:20:00 +0000 (09:20 +0900)]
test: also flush and rotate journal before read
Follow-up for
a610ba00d923f148702e68b1661166e887759509.
Fixes #32890.
Yu Watanabe [Wed, 22 May 2024 03:26:58 +0000 (12:26 +0900)]
test: replace journal checkers with journalctl --follow + grep -m
Recently, for slow test environments, journalctl --sync was added to the
loop in the timeout. However, journalctl --sync may be slow in such systems,
and timeout easily triggered during syncing.
Hopefully, reading journal with --follow and grep the output with an expected
line should be efficient.
Hopefully fixes #32712.
Yu Watanabe [Tue, 21 May 2024 23:06:46 +0000 (08:06 +0900)]
Merge pull request #32963 from yuwata/test-64-btrfs
test: lock device during running cryptsetup
Yu Watanabe [Tue, 21 May 2024 20:24:05 +0000 (05:24 +0900)]
test: lock device during running cryptsetup
On running cryptsetup, udevd detects two inotify events for the
underlying device. Running the test on enough fast host, the expected
symlinks based on UUID and disk label are created by the second event.
During processing a uevent for a device, udevd disables the inotify
watch for the device. If the test runs on slow system, the second
inotify event may comes during a udev worker processing the synthesized
uevent triggered by the first inotify event. Hence, no synthesized
uevent for the second inotify event will be generated, and the expected
symlinks will be never created.
To prevent the issue, we need to lock the device during cryptsetup
command is running.
Fixes #32913.
Yu Watanabe [Tue, 21 May 2024 20:35:55 +0000 (05:35 +0900)]
Revert "test: wipe filesystem before moving to the next test case"
This reverts commit
301d7ee6112c6f766ee63d1daed3cd9535a65053.
This does not solve issue #32913.
Luca Boccassi [Tue, 21 May 2024 12:32:48 +0000 (13:32 +0100)]
btrfs-util: add assert to fix Coverity warning
Coverity gets confused since the iterator change, so add an
assert to indicate that this is allocated if n_old_groups is > 0
CID#
1545922
Follow-up for
125cca1b51e19d9209a229fca4fb9d94d34c3e78
Yu Watanabe [Tue, 21 May 2024 19:39:08 +0000 (04:39 +0900)]
Merge pull request #32962 from bluca/suse_mod
pkg/opensuse: switch to SHA1 fork
Luca Boccassi [Tue, 21 May 2024 18:44:13 +0000 (20:44 +0200)]
Merge pull request #32944 from yuwata/test-74
test: several changes for TEST-74-AUX-UTILS
Luca Boccassi [Tue, 21 May 2024 18:37:17 +0000 (20:37 +0200)]
Merge pull request #32954 from YHNdnzj/run-forwarder-exit
run: when disconnected from PTY forwarder, exit event loop if not --wait
Luca Boccassi [Tue, 21 May 2024 18:07:39 +0000 (19:07 +0100)]
mkosi: explicitly install g++ in opensuse
Not pulled in by default at build time
Luca Boccassi [Tue, 21 May 2024 17:19:04 +0000 (18:19 +0100)]
pkg/opensuse: switch to SHA1 fork
src.opensuse.org switched to SHA256, which means it can no longer be
used as a submodule in a SHA1 repository. Switch to a fork on Pagure
that gets synced across and is still SHA1:
https://code.opensuse.org/package/systemd.git
Zbigniew Jędrzejewski-Szmek [Tue, 21 May 2024 16:42:08 +0000 (18:42 +0200)]
Merge pull request #32957 from mrc0mmand/fix-coverage-builds
test: make TEST-65-ANALYZE happy when built with gcov
Yu Watanabe [Tue, 21 May 2024 08:57:59 +0000 (17:57 +0900)]
test: wait a bit before stopping/killing service
Otherwise, when stopping the service, the last command may not be
started yet, and the service manager may not send SIGTERM signal to the
last command, but send SIGKILL on timeout.
===
May 21 08:23:24 test19-exit-cgroup.sh[437]: + disown
May 21 08:23:24 test19-exit-cgroup.sh[438]: + sleep infinity
May 21 08:23:24 test19-exit-cgroup.sh[437]: + systemd-notify --ready
May 21 08:23:24 test19-exit-cgroup.sh[437]: + sleep infinity
May 21 08:23:24 test19-exit-cgroup.sh[441]: + systemctl stop one
May 21 08:23:24 test19-exit-cgroup.sh[443]: + sleep infinity
(snip)
May 21 08:23:24 systemd[1]: one.service: Changed running -> stop-sigterm
May 21 08:23:24 systemd[1]: Stopping one.service - /tmp/test19-exit-cgroup.sh "systemctl stop one"...
May 21 08:23:24 systemd[1]: Received SIGCHLD from PID 441 (systemctl).
May 21 08:23:24 systemd[1]: Child 437 (bash) died (code=killed, status=15/TERM)
May 21 08:23:24 systemd[1]: one.service: Child 437 belongs to one.service.
May 21 08:23:24 systemd[1]: one.service: Main process exited, code=killed, status=15/TERM (success)
May 21 08:23:24 systemd[1]: Child 439 (bash) died (code=killed, status=15/TERM)
May 21 08:23:24 systemd[1]: one.service: Child 439 belongs to one.service.
May 21 08:23:24 systemd[1]: Child 441 (systemctl) died (code=killed, status=15/TERM)
May 21 08:23:24 systemd[1]: one.service: Child 441 belongs to one.service.
May 21 08:23:24 systemd[1]: Child 442 (bash) died (code=killed, status=15/TERM)
May 21 08:23:24 systemd[1]: one.service: Child 442 belongs to one.service.
(snip)
May 21 08:24:54 systemd[1]: one.service: State 'stop-sigterm' timed out. Killing.
May 21 08:24:54 systemd[1]: one.service: Killing process 443 (sleep) with signal SIGKILL.
May 21 08:24:54 systemd[1]: one.service: Changed stop-sigterm -> stop-sigkill
May 21 08:24:54 systemd[1]: Received SIGCHLD from PID 443 (sleep).
May 21 08:24:54 systemd[1]: Child 443 (sleep) died (code=killed, status=9/KILL)
May 21 08:24:54 systemd[1]: one.service: Child 443 belongs to one.service.
May 21 08:24:54 systemd[1]: one.service: Control group is empty.
May 21 08:24:54 systemd[1]: one.service: Failed with result 'timeout'.
May 21 08:24:54 systemd[1]: one.service: Service restart not allowed.
May 21 08:24:54 systemd[1]: one.service: Changed stop-sigkill -> failed
May 21 08:24:54 systemd[1]: one.service: Job 738 one.service/stop finished, result=done
May 21 08:24:54 systemd[1]: Stopped one.service - /tmp/test19-exit-cgroup.sh "systemctl stop one".
May 21 08:24:54 systemd[1]: one.service: Unit entered failed state.
May 21 08:24:54 systemd[1]: one.service: Releasing resources...
===
Fixes #32947.
Zbigniew Jędrzejewski-Szmek [Tue, 21 May 2024 11:27:53 +0000 (13:27 +0200)]
logind: use SD_BUS_ERROR_ACCESS_DENIED
As requested in post-merge review
https://github.com/systemd/systemd/pull/32869#pullrequestreview-
2068161094:
> NotInControl error is really about session controllers, but this here really
> is different.
Yu Watanabe [Mon, 20 May 2024 20:35:50 +0000 (05:35 +0900)]
test: collect information about loopback device on failure
Yu Watanabe [Tue, 21 May 2024 10:10:49 +0000 (19:10 +0900)]
test: wait for loop/backing_file attribute being removed
Hopefully fixes issue like
https://github.com/systemd/systemd/issues/32680#issuecomment-
2120959238
https://github.com/systemd/systemd/issues/32680#issuecomment-
2122074805
Yu Watanabe [Mon, 20 May 2024 19:48:42 +0000 (04:48 +0900)]
test: wait for unit generated from /proc/self/mountinfo to be unloaded
Fixes https://github.com/systemd/systemd/issues/32680#issuecomment-
2120974685.
===
May 21 02:45:08 TEST-74-AUX-UTILS.sh[2475]: + mountpoint /tmp/tmp.eaRV7lSbX2/mnt
May 21 02:45:08 TEST-74-AUX-UTILS.sh[2476]: /tmp/tmp.eaRV7lSbX2/mnt is not a mountpoint
May 21 02:45:08 TEST-74-AUX-UTILS.sh[2449]: + systemd-mount /dev/loop0 /tmp/tmp.eaRV7lSbX2/mnt
May 21 02:45:08 systemd-mount[2477]: Failed to start transient mount unit: Unit tmp-tmp.eaRV7lSbX2-mnt.mount was already loaded or has a fragment file.
===
Yu Watanabe [Mon, 20 May 2024 22:20:57 +0000 (07:20 +0900)]
test: also run some basic test cases on nspawn
Yu Watanabe [Mon, 20 May 2024 17:54:06 +0000 (02:54 +0900)]
test: stop container when it is not necessary anymore
Mike Yuan [Tue, 21 May 2024 13:39:02 +0000 (21:39 +0800)]
man/systemd-run: beef up info regarding interaction between --pty, --pipe, and --wait
Mike Yuan [Tue, 21 May 2024 12:10:24 +0000 (20:10 +0800)]
run: when disconnected from PTY forwarder, exit event loop if not --wait
Follow-up for
ade0789fabbf01b95bf54d32f8cab1217a753f03
The change in behavior was partly intentional, as I think
if both --wait and --pty are used, manually disconnecting
from PTY forwarder should not result in systemd-run exiting
with "Finished with ..." log. But we should check for
--wait here.
Closes #32953
Mike Yuan [Tue, 21 May 2024 12:07:01 +0000 (20:07 +0800)]
ptyfwd: add missing assertions for pty_forward_new
Andika Triwidada [Tue, 21 May 2024 11:35:59 +0000 (13:35 +0200)]
po: Translated using Weblate (Indonesian)
Currently translated at 100.0% (233 of 233 strings)
Co-authored-by: Andika Triwidada <andika@gmail.com>
Translate-URL: https://translate.fedoraproject.org/projects/systemd/main/id/
Translation: systemd/main
Zbigniew Jędrzejewski-Szmek [Tue, 21 May 2024 08:39:39 +0000 (10:39 +0200)]
shared/mountpoint-util: for old kernels, assume "norecovery" is supported by btrfs
Fixup for
e3828d7103a99a15a1e947ba3063294ead590631, as requested in
https://github.com/systemd/systemd/pull/32892#issuecomment-
2117903328.
Frantisek Sumsal [Tue, 21 May 2024 13:08:07 +0000 (15:08 +0200)]
test: add a brief comment for the chattr check
Addresses: https://github.com/systemd/systemd/pull/32907#discussion_r1605919598
Frantisek Sumsal [Tue, 21 May 2024 13:04:22 +0000 (15:04 +0200)]
test: make TEST-65-ANALYZE happy when built with gcov
systemd-analyze runs the generators in a sandbox, which makes gcov
unhappy since it can't update its counters. Let's "silence" gcov in this
particular case by telling it to look for gcov note files in /tmp (where
shouldn't be any, so gcov won't try to update any counters).
Zbigniew Jędrzejewski-Szmek [Tue, 21 May 2024 07:01:17 +0000 (09:01 +0200)]
Merge pull request #32869 from keszybz/dbus-release-session
Allow pam stack to call ReleaseSession
Luca Boccassi [Mon, 20 May 2024 20:55:54 +0000 (22:55 +0200)]
Merge pull request #32942 from yuwata/test-journal-sync-more
test: sync journal before read
Yu Watanabe [Mon, 20 May 2024 16:44:42 +0000 (01:44 +0900)]
test: extend timeout for DHCP/NDisc tests
Fixes https://github.com/systemd/systemd/pull/32932#issuecomment-
2120424121.
Yu Watanabe [Mon, 20 May 2024 16:34:34 +0000 (01:34 +0900)]
btrfs-util: check current offset before read
Fixes #32936.
Zbigniew Jędrzejewski-Szmek [Thu, 16 May 2024 15:06:24 +0000 (17:06 +0200)]
logind: make ReleaseSession "unprivileged" and allow closing of own session
Fixes https://github.com/systemd/systemd/issues/28514.
Quoting https://github.com/systemd/systemd/issues/28514#issuecomment-
1831781486:
> Whenever PAM is enabled for a service, we set up the PAM session and then
> fork off a process whose only job is to eventually close the PAM session when
> the service dies. That services we run with service privileges, both to
> minimize attack surface and because we want to use PR_SET_DEATHSIG to be get
> a notification via signal whenever the main process dies. But that only works
> if we have the same credentials as that main process.
>
> Now, if pam_systemd runs inside the PAM stack (which it normally does) it's
> session close hook will ask logind to synchronously end the session via a bus
> call. Currently that call is not accessible to unprivileged clients. And
> that's the part we need to relax: allow users to end their own sessions.
The check is implemented in a way that allows the kill if the sender is in
the target session.
I found 'sudo systemctl --user -M "zbyszek@" is-system-running' to
be a convenient reproducer.
Before:
May 16 16:25:26 x1c systemd[1]: run-u24754.service: Deactivated successfully.
May 16 16:25:26 x1c dbus-broker[1489]: A security policy denied :1.24757 to send method call /org/freedesktop/login1:org.freedesktop.login1.Manager.ReleaseSession to org.freedesktop.login1.
May 16 16:25:26 x1c (sd-pam)[
3036470]: pam_systemd(login:session): Failed to release session: Access denied
May 16 16:25:26 x1c systemd[1]: Stopping session-114.scope...
May 16 16:25:26 x1c systemd[1]: session-114.scope: Deactivated successfully.
May 16 16:25:26 x1c systemd[1]: Stopped session-114.scope.
May 16 16:25:26 x1c systemd[1]: session-c151.scope: Deactivated successfully.
May 16 16:25:26 x1c systemd-logind[1513]: Session c151 logged out. Waiting for processes to exit.
May 16 16:25:26 x1c systemd-logind[1513]: Removed session c151.
After:
May 16 17:02:15 x1c systemd[1]: run-u24770.service: Deactivated successfully.
May 16 17:02:15 x1c systemd[1]: Stopping session-115.scope...
May 16 17:02:15 x1c systemd[1]: session-c153.scope: Deactivated successfully.
May 16 17:02:15 x1c systemd[1]: session-115.scope: Deactivated successfully.
May 16 17:02:15 x1c systemd[1]: Stopped session-115.scope.
May 16 17:02:15 x1c systemd-logind[1513]: Session c153 logged out. Waiting for processes to exit.
May 16 17:02:15 x1c systemd-logind[1513]: Removed session c153.
Edit: this seems to also fix https://github.com/systemd/systemd/issues/8598.
It seems that with the call to ReleaseSession, we wait for the pam session
close hooks to finish. I inserted a 'sleep(10)' after the call to ReleaseSession
in pam_systemd, and things block on that, nothing is killed prematurely.
Zbigniew Jędrzejewski-Szmek [Thu, 16 May 2024 15:57:28 +0000 (17:57 +0200)]
logind: group policy entries by interface
Yu Watanabe [Mon, 20 May 2024 16:54:35 +0000 (01:54 +0900)]
test: sync journal before read
Similar to recent commits, e.g.
f961f0e47c2caf9af735a22e7f23210e746d0c8b.
Fixes #32926.
Yu Watanabe [Mon, 20 May 2024 16:53:02 +0000 (01:53 +0900)]
test: call journalctl --sync just before reading journals
Otherwise, journal entries comes during sleep may not be read.
Follow-up for
c22a112883a46e302dae587b809c459647363ceb.
Zbigniew Jędrzejewski-Szmek [Mon, 20 May 2024 13:10:32 +0000 (15:10 +0200)]
analyze: do not print timestamps before "start of userspace"
We have the following timestamp status:
$ systemctl show systemd-fsck-root.service | grep InactiveExitTimestamp
InactiveExitTimestamp=Thu 2023-11-02 12:27:24 CET
InactiveExitTimestampMonotonic=
15143158
$ systemctl show | grep UserspaceTimestamp
UserspaceTimestamp=Thu 2023-11-02 12:27:25 CET
UserspaceTimestampMonotonic=
15804273
i.e. UserspaceTimestamp is before InactiveExit of systemd-fsck-root.service.
This is fine, but on display, we'd subtract those values and print a huge
negative value bogusly:
$ build/systemd-analyze critical-chain systemd-remount-fs.service
The time when unit became active or started is printed after the "@" character.
The time the unit took to start is printed after the "+" character.
systemd-remount-fs.service +137ms
└─systemd-fsck-root.service @584542y 2w 2d 20h 1min 48.890s +45ms
└─systemd-journald.socket
└─system.slice
└─-.slice
In fact, list_dependencies_print() already had a branch where the check that
'times->activating > boot->userspace_time', but it didn't cover all cases. So
make it cover both branches, and also change to '>=', since it's fine if
something happened with the same timestamp.
With the patch:
$ build/systemd-analyze critical-chain systemd-remount-fs.service
The time when unit became active or started is printed after the "@" character.
The time the unit took to start is printed after the "+" character.
systemd-remount-fs.service +42ms
└─systemd-fsck-root.service
└─systemd-journald.socket
└─system.slice
└─-.slice
Fixes https://github.com/systemd/systemd/issues/17191.
Luca Boccassi [Mon, 20 May 2024 15:50:26 +0000 (17:50 +0200)]
Merge pull request #32934 from bluca/logind_regression_main
logind: do not fail creating a session when request is not from a unit
Yu Watanabe [Mon, 20 May 2024 09:47:39 +0000 (18:47 +0900)]
test: wait for partition device rather than the whole disk
Fixes #32931.
Luca Boccassi [Mon, 20 May 2024 13:03:53 +0000 (15:03 +0200)]
Merge pull request #32927 from yuwata/test-network-netdevsim
test-network: workaround for netdevsim bug
Luca Boccassi [Mon, 20 May 2024 12:12:03 +0000 (13:12 +0100)]
logind: do not fail creating a session when request is not from a unit
When running inside an LXC container the 'su' process will not be part of
any unit or slice.
manager_get_user_by_pid() which was used until v255 (included) does not fail
if it cannot find a unit/slice, but simply returns 'not found'. Do the same
in manager_get_session_by_pidref().
This was not detected as Semaphore CI does not reboot the testbed before
the logind test, so the session is started by the old logind from the base
distro, instead of the one being tested.
Follow-up for
8494f562c8963d8a936b0598e23eab277ff29374
Follow-up for
5099a50d4398e190387d204f5df81cc176bd33e2
Fixes https://github.com/systemd/systemd/issues/32929
Luca Boccassi [Mon, 20 May 2024 12:08:56 +0000 (13:08 +0100)]
logind: add one more debug log
Helped track down issue with session tracking
Luca Boccassi [Mon, 20 May 2024 12:08:26 +0000 (13:08 +0100)]
semaphore: use variable for Salsa repo URL
Makes it easier to switch for debuggin
drewbug [Mon, 20 May 2024 10:11:22 +0000 (06:11 -0400)]
man: fix grammar for Name= option in systemd.link
Yu Watanabe [Sun, 19 May 2024 20:38:24 +0000 (05:38 +0900)]
test: install more kernel modules for Fedora image
Otherwise, several tests for networkd are skipped.
Follow-up for #32666.
Yu Watanabe [Mon, 20 May 2024 00:53:26 +0000 (09:53 +0900)]
test-network: also set custom altternative name for netdevsim interface
Due to the bug in kernel 6.9 caused by
https://github.com/torvalds/linux/commit/
8debcf5832c3e8a6baaea27c75ad8a6ba5077beb,
the net_id udev builtin does not work for netdevsim interface.
So, eni99np1 cannot be used with kernel 6.9 anymore.
Workaround for #32910.
Yu Watanabe [Sun, 19 May 2024 19:29:55 +0000 (04:29 +0900)]
test-network: split out setup_netdevsim()
Luca Boccassi [Sun, 19 May 2024 22:16:16 +0000 (00:16 +0200)]
Merge pull request #32915 from yuwata/machine-id-setup
machine-id-setup: acquire machine ID from /run/machine-id if possible
Yu Watanabe [Sun, 19 May 2024 17:34:17 +0000 (02:34 +0900)]
test: sync journal before starting test
Follow-up for
c22a112883a46e302dae587b809c459647363ceb.
Hopefully fixes #32712.
Luca Boccassi [Sun, 19 May 2024 19:10:40 +0000 (21:10 +0200)]
Merge pull request #32907 from yuwata/image-fix
several fixes for os image handling
Yu Watanabe [Sun, 19 May 2024 00:14:27 +0000 (09:14 +0900)]
machine-id-setup: acquire machine ID from /run/machine-id if possible
If machine ID is previously stored at /run/machine-id, then let's reuse
it. This is important on switching root and /etc/machine-id was previously
a mount point.
Fixes #32908.
Yu Watanabe [Sat, 18 May 2024 23:46:43 +0000 (08:46 +0900)]
machine-id-setup: use empty_or_root()
Yu Watanabe [Fri, 17 May 2024 21:14:50 +0000 (06:14 +0900)]
machine: fix use-after-free in Rename() DBus method
Fixes a bug introduced by
1ddb263d21099ae42195c2bc382bdf72a7f24f82.
Note, this requires the previous two commits, and cannot backport without them.
Note, before the previous commit, the use-after-free could be triggered
only by Rename() DBus method, and could not by RenameImage(), as we did not
cache Image object when RenameImage() method is called. And machinectl
always uses RenameImage(). Hence, the issue could be triggered only when
Rename() DBus method is explicitly called by e.g. busctl.
With the previous commit, the Image object passed to the function is
always cached. Hence, the issue could be triggered even with machinectl
command, and this fix is important.
Yu Watanabe [Fri, 17 May 2024 20:33:48 +0000 (05:33 +0900)]
machine: also acquire Image object from cache when a dbus method in the main interface is called
Previously, Image objects were only cached when reading properties or
methods in the org.freedesktop.machine1.Image interface are called.
This makes that, when a method in the main interface (org.freedesktop.machine1)
for an image is called, also acquire the Image object from the cache,
and if not cached, create Image object and put into the cache, like we
do for org.freedesktop.machine1.Image.
Otherwise, if some properties of an image are updated by methods in the main
interface, e.g. MarkImageReadOnly(), the changes do not applied to the cached
Image object, and subsequent read of proerties through the interface for the
image, e.g. ReadOnly property, may provide outdated values.
Follow-up for
1ddb263d21099ae42195c2bc382bdf72a7f24f82.
Fixes #32888.
Yu Watanabe [Fri, 17 May 2024 20:31:16 +0000 (05:31 +0900)]
machine: split out manager_acquire_image() from image_object_find()
Preparation for the next commit. No functional change.
Yu Watanabe [Fri, 17 May 2024 20:46:24 +0000 (05:46 +0900)]
discover-image: also update Image.limit in image_set_limit()
Same as the previous commit, but for SetLimit DBus method vs Limit
property and friends.
Yu Watanabe [Fri, 17 May 2024 20:10:42 +0000 (05:10 +0900)]
discover-image: update Image.read_only flag in image_read_only()
Otherwise, ReadOnly DBus property in org.freedesktop.machine1.Image or
org.freedesktop.portable1.Image will not be updated by MarkReadOnly DBus
method.
Luca Boccassi [Sun, 19 May 2024 12:44:54 +0000 (14:44 +0200)]
Merge pull request #32917 from YHNdnzj/ptyfwd-cleanup
ptyfwd: a few fixes/cleanups
Yu Watanabe [Sat, 18 May 2024 22:12:48 +0000 (07:12 +0900)]
test: sync journal before read
Workaround for #32834 and #32890.
Mike Yuan [Sun, 19 May 2024 01:07:21 +0000 (09:07 +0800)]
run: pass the pty slave fd to transient service
The rationale is similar to
40e1f4ea7458a0a80eaf1ef356e52bfe0835412e.
Currently, we only pass TTYPath=/dev/pts/... to
the transient service spawned by systemd-run.
This is a bit problematic though, when ExecStartPre=
or ExecStopPost= is used. Since when these control
processes get to run, the main process is not yet
started/has already exited, hence the slave suffers
from the same vhangup problem as the mentioned commit.
By passing the slave fd in, the service manager will
hold the fd open as long as the service is alive.
Fixes #32916
Mike Yuan [Sun, 19 May 2024 00:53:07 +0000 (08:53 +0800)]
run: do not log "Error on PTY forwarding logic" when disconnected due to user operation
Mike Yuan [Sat, 18 May 2024 23:59:24 +0000 (07:59 +0800)]
vmspawn: use openpt_allocate where appropriate
Mike Yuan [Sun, 19 May 2024 01:16:56 +0000 (09:16 +0800)]
ptyfwd: trivial coding style and log cleanups
Luca Boccassi [Sun, 19 May 2024 00:50:36 +0000 (02:50 +0200)]
Merge pull request #32914 from yuwata/test-64-storage
test: several follow-ups for TEST-64-STORAGE
Yu Watanabe [Sat, 18 May 2024 20:10:28 +0000 (05:10 +0900)]
test: wipe filesystem before moving to the next test case
Yu Watanabe [Sat, 18 May 2024 19:54:25 +0000 (04:54 +0900)]
test: install modinfo to test image
Follow-up for
6c2d47d6d3ad25ffd7527c7f4de31457ee1b25d8.
Fixes the following unexpected skip:
```
[ 6.163670] TEST-64-UDEV-STORAGE.sh[596]: + modinfo btrfs
[ 6.164102] TEST-64-UDEV-STORAGE.sh[726]: /usr/lib/systemd/tests/testdata/units/TEST-64-UDEV-STORAGE.sh: line 726: modinfo: command not found
[ 6.164683] TEST-64-UDEV-STORAGE.sh[727]: + echo 'This test requires the btrfs kernel module but it is not installed, skipping the test'
[ 6.165069] TEST-64-UDEV-STORAGE.sh[728]: + tee --append /skipped
[ 6.166801] TEST-64-UDEV-STORAGE.sh[728]: This test requires the btrfs kernel module but it is not installed, skipping the test
[ 6.167177] TEST-64-UDEV-STORAGE.sh[596]: + exit 77
```
Yu Watanabe [Sat, 18 May 2024 07:32:36 +0000 (16:32 +0900)]
Merge pull request #32902 from yuwata/emergency-action-fixes
several fixes for emergency actions and document update
Yu Watanabe [Sat, 18 May 2024 07:30:03 +0000 (16:30 +0900)]
Merge pull request #32909 from arthurzam/bash-v256
shell-completion: add more missing args for bash
Arthur Zamarin [Sat, 18 May 2024 06:38:53 +0000 (09:38 +0300)]
shell-completion: add systemd-vmspawn to meson.build
Signed-off-by: Arthur Zamarin <arthurzam@gentoo.org>
Arthur Zamarin [Sat, 18 May 2024 06:34:38 +0000 (09:34 +0300)]
shell-completion: add missing args to bash systemd-nspawn
Signed-off-by: Arthur Zamarin <arthurzam@gentoo.org>
Arthur Zamarin [Sat, 18 May 2024 06:34:38 +0000 (09:34 +0300)]
shell-completion: add missing args to bash systemd-run
Signed-off-by: Arthur Zamarin <arthurzam@gentoo.org>
Yu Watanabe [Fri, 17 May 2024 18:31:37 +0000 (03:31 +0900)]
install-file: make fs_make_very_read_only() static
Yu Watanabe [Fri, 17 May 2024 17:11:34 +0000 (02:11 +0900)]
man: refer FailureAction= and SuccessAction= for explaining allowed values in JobTimeoutAction=
The allowed values are explained in FailureAction= and SuccessAction=,
rather than StartLimitAction=.
Yu Watanabe [Fri, 17 May 2024 17:07:34 +0000 (02:07 +0900)]
core: refuse invalid emergency actions for SuccessAction= and friends in user service manager
Especially, soft-reboot is not supported by user service manager.
Fixes a bug in
13ffc60749df0ca7c76cfcac317b41a05679b364 and
3cf848f6cd2151ccff89073bffb102f966d64ced.
Yu Watanabe [Fri, 17 May 2024 17:33:13 +0000 (02:33 +0900)]
man: mention soft-reboot in bootup(7)
Yu Watanabe [Fri, 17 May 2024 16:26:14 +0000 (01:26 +0900)]
units: add JobTimeoutAction= to exit.target and friends
For consistency with other targets, e.g. poweroff.target or
reboot.target.
Mike Yuan [Fri, 17 May 2024 13:07:17 +0000 (21:07 +0800)]
man/soft-reboot: order surviving services before shutdown.target
Prompted by #32895
Rather than ordering with each power operation targets,
ordering against shutdown.target which is a valid
synchronization point. This has no effect if soft-reboot
is being performed.
Zbigniew Jędrzejewski-Szmek [Fri, 17 May 2024 12:31:16 +0000 (14:31 +0200)]
man: add note about selinux to rc-local
This feature is deprecated, but if users use it, they are likely to be
tripped up by the wrong selinux context, so add a note.
https://discussion.fedoraproject.org/t/systemd-rc-local-service-doesnt-work-on-fedora-40-until-selinux-contexts-are-set-on-rc-local-script
Mike Yuan [Fri, 17 May 2024 09:35:43 +0000 (17:35 +0800)]
core/execute: do not use format str for log_object_internal
This reverts part of
210ca71cb5d9f41df3b23eef28d6742bd90a0362.
Another fallout from that commit...
Fixes #32877
Daan De Meyer [Fri, 17 May 2024 08:46:12 +0000 (10:46 +0200)]
mountpoint-util: Deal with kernel API breakage in "norecovery" mount option
"norecovery" was deprecated for btrfs in
https://github.com/torvalds/linux/commit/
74ef00185eb864252156022ff129b01549504175
and removed in
https://github.com/torvalds/linux/commit/
a1912f712188291f9d7d434fba155461f1ebef66.
Let's drop our assumption that btrfs supports "norecovery" and first query for the
new name of the option followed by querying for the old name.
Yu Watanabe [Fri, 17 May 2024 06:04:31 +0000 (15:04 +0900)]
test: wait for underlying .device unit being active before invoking systemd-mount
Fixes following failure:
===
May 17 04:12:04 TEST-74-AUX-UTILS.sh[2684]: + systemd-mount --owner=testuser /dev/loop0 /tmp/tmp.DVQdo2ou53/mnt
(snip)
May 17 04:15:04 systemd[1]: dev-loop0.device: Job dev-loop0.device/start timed out.
May 17 04:15:04 systemd[1]: dev-loop0.device: Job 5812 dev-loop0.device/start finished, result=timeout
May 17 04:15:04 systemd[1]: Timed out waiting for device dev-loop0.device - /dev/loop0.
May 17 04:15:04 systemd[1]: tmp-tmp.DVQdo2ou53-mnt.mount: Job 5804 tmp-tmp.DVQdo2ou53-mnt.mount/start finished, result=dependency
May 17 04:15:04 systemd[1]: Dependency failed for tmp-tmp.DVQdo2ou53-mnt.mount - /tmp/tmp.DVQdo2ou53/mnt.
May 17 04:15:04 systemd[1]: tmp-tmp.DVQdo2ou53-mnt.mount: Job tmp-tmp.DVQdo2ou53-mnt.mount/start failed with result 'dependency'.
May 17 04:15:04 systemd[1]: systemd-fsck@dev-loop0.service: Job 5805 systemd-fsck@dev-loop0.service/start finished, result=dependency
May 17 04:15:04 systemd[1]: Dependency failed for systemd-fsck@dev-loop0.service - File System Check on /dev/loop0.
May 17 04:15:04 systemd[1]: systemd-fsck@dev-loop0.service: Job systemd-fsck@dev-loop0.service/start failed with result 'dependency'.
May 17 04:15:04 systemd[1]: dev-loop0.device: Job dev-loop0.device/start failed with result 'timeout'.
(snip)
May 17 04:15:04 systemd-mount[2856]: A dependency job for tmp-tmp.DVQdo2ou53-mnt.mount failed. See 'journalctl -xe' for details.
Yu Watanabe [Fri, 17 May 2024 01:04:37 +0000 (10:04 +0900)]
test: dynamically generate list of test cases
Follow-up for #32666.
Yu Watanabe [Fri, 17 May 2024 05:00:12 +0000 (14:00 +0900)]
test: wait for sessions being closed
If a session in closing state, the user state will be in online.
Fixes #32698.
Daan De Meyer [Fri, 17 May 2024 07:10:33 +0000 (09:10 +0200)]
Merge pull request #32875 from yuwata/network-route-wireguard
network/route: fix unexpected removal of routes for wireguard
Yu Watanabe [Fri, 17 May 2024 05:21:44 +0000 (14:21 +0900)]
test: wait for partition device being processed by udevd
Fixes #32697.