1
0
mirror of https://github.com/systemd/systemd.git synced 2025-01-26 14:04:03 +03:00

74739 Commits

Author SHA1 Message Date
Yu Watanabe
4abbd3a9c6 mkosi: replace PackageManagerTrees= with SandboxTrees=
(cherry picked from commit 4e3f16b5ef122996f9545d883af74ff1235833eb)
2024-11-13 19:48:10 +00:00
Jörg Behrmann
39a46aced6 ukify: Require both key and cert be set in generate_keys
If either is None the write in this branch of the code will fail.

(cherry picked from commit 9ba53499b97d59cc57ce763b8ba7f272a876dd25)
2024-11-13 19:48:10 +00:00
Daan De Meyer
c7762098ec systemd-update-helper: Show executed commands if debug logging is enabled
(cherry picked from commit 8b8668b9e71837cb541cd432bc37e4c9405e49cd)
2024-11-13 19:48:10 +00:00
Lennart Poettering
389fbf4649 seccomp: allowlist uretprobe() syscall
This is a new syscall provided by the kernel used to implement faster
uprobes. It's not supposed to be called by userspace, but only by kernel
generated uprobe code.

It should be fine to allow this, as the kernel authenticates the
invocation itself, and we shouldn't break compat with things.

Note that this allowlisting is not sufficient to make ureprobe() work.
libseccomp must be tought the syscall too, but this can happen
independently.

Fixes: #34615
(cherry picked from commit d693c483a2bb3eae490fd78d68fc16d0a731fee2)
2024-11-13 19:48:10 +00:00
Daan De Meyer
4d2999eb53 mkosi: Fix up ownership of testuser home directory on first boot
When building unprivileged, the testuser home directory ends up
owned by root:root because mkosi can't chown directories to other
owners when running unprivileged. So let's fix up the testuser
ownership on first boot with tmpfiles instead.

(cherry picked from commit 0d0ecaab000cf2768a3edf1e73119bf2fce952b0)
2024-11-13 19:48:10 +00:00
David Rheinsberg
a9aa75145b docs/DESKTOP_ENVIRONMENTS: clarify name aliases
Add a note to the service-file naming scheme that reminds developers
that those names might be aliases. Hence, when parsing such unit names,
the entire name-array of a unit must be parsed, rather than just the
unit ID.

The service-name of existing applications might be already part of their
API. Hence, not all applications can switch the service ID to this new
naming scheme, but can provide suitable aliases. Document this behavior.

(cherry picked from commit b3b7cf8b7c35df14c6eb4f79da1a241dc0aa8c7e)
2024-11-13 19:48:10 +00:00
David Rheinsberg
361021a522 docs/DESKTOP_ENVIRONMENT: clarify <RANDOM> usage
The <RANDOM> part is optional in the naming scheme of application units.
However, this is only true for service files. Scope units must include
the <RANDOM> part, otherwise it would be impossible to parse:

The schema would be:

    `app[-<launcher>]-<ApplicationID>[-<RANDOM>].scope`

in which case a two-part name would be impossible to parse, since it is
unclear whether the launcher of the random bit where omitted.

(cherry picked from commit cbaebf811e6edb79279f72950b2d63189be314d3)
2024-11-13 19:48:10 +00:00
Lennart Poettering
c14a47547d meson: sort includes
(cherry picked from commit 882032faaf9e2d2524936e82ccc770903d4c38d6)
2024-11-13 19:48:10 +00:00
Mike Yuan
f4df9627ae core/manager: still send out STATUS=Ready for user manager
This effectively reverts 37d15cd132f3a8a0bf42fb252c1604e804171ff2.

The offending commit wrongly assumed that the second READY=1
notification is for system scope only, but it also serves the purpose
of flushing out previous STATUS= containing user unit job status.

(cherry picked from commit da81a108653e2ef19102698dbc0184bd18b084d9)
2024-11-13 19:48:10 +00:00
David Rheinsberg
3a0c77aeb9 docs/DESKTOP_ENVIRONMENTS: fix formatting
The annotation about omittance is meant to be about the `RANDOM` string.
However, the current formatting makes it look like the entire naming
scheme is optional. Fix this.

(cherry picked from commit 5697bce82b1b37602255ac12e4a8f4a12305dc03)
2024-11-13 19:48:10 +00:00
Lennart Poettering
ca9b0afd91 docs: don't mention split-usr path anymore
We don't support split /usr/ anymore. Hence fix the paths. This
apparently matters because of PK validating the binary path.

Fixes: #34712
(cherry picked from commit c28a13b5afcf021191494bfa565c55b784dc08fa)
2024-11-13 19:48:10 +00:00
Yu Watanabe
d9d4cbfe5f mkosi: fix sections for settings
Follow-up for 963157ca78429c51feb3103828d8cc94440956f3.

(cherry picked from commit 727dc1f23a2e16da7f1e24810157d5b7c9136525)
2024-11-13 19:48:10 +00:00
Lennart Poettering
ff667d8c2e man: reword comment a bit regarding ExecStartPre= multiple commands
The documentation claimed that ExecStartPre=/ExecStartPost= accepts
multiple command lines, in contrast to ExecStart=. This is half an
untruth, because ExecStart= allows that too – as long as Type=oneshot is
set.

Hence, reword this a bit, and do not emphasize the contrast.

Prompted by: #34570

(cherry picked from commit c3069a6bfb454a0e02607ad21b5badf9847fe11a)
2024-11-13 19:48:10 +00:00
Jörg Behrmann
50b42bb82b ukify: Fix systemd-measure detection in tests
Fixes: 206fa93c854e3d5c94e56da9b53e107245f31503
(cherry picked from commit e9984357ad60f087528fbdfd6f4577e93fca8cee)
2024-11-13 19:48:10 +00:00
WilliButz
b96e3bbd9f test/repart: add test case for hash size derived from max data size
(cherry picked from commit e16153a40342b3da984ffbf4e382e16e713f447a)
2024-11-13 19:48:10 +00:00
WilliButz
5ea69f9f6d repart: derive hash partition size from SizeMaxBytes= of data sibling
This change makes it possible for repart to create dm-verity hash
partitions for a custom amount of protected data. When the property
`SizeMaxBytes=` is specified for a dm-verity data partition, the size
of the corresponding hash partition is set to accommodate hash data
for this maximum size, rather than the actual contents its data
sibling. However, the contained hash data continues to be generated
from said sibling.

(cherry picked from commit d3032e651e2131c47d276e3fbdcbdf9fc51c8ef9)
2024-11-13 19:48:10 +00:00
Chen Guanqiao
44e1774660 mount: optimize mountinfo traversal by decoupling device discovery
In mount_load_proc_self_mountinfo(), device_found_node() is synchronously called
during the traversal of mountinfo entries. When there are a large number of
mount points, and the device types are not significantly different, this results
in excessive time consumption during device discovery, causing a performance
bottleneck. This issue is particularly prominent on servers with a large number
of cores in IDC.

This patch decouples device discovery from the mountinfo traversal process,
avoiding redundant device operations. As a result, it significantly improves
performance, especially in environments with numerous mount points.

Signed-off-by: Chen Guanqiao <chen.chenchacha@foxmail.com>
(cherry picked from commit 00ad3f02275b507a753495ace5e5f84cb38b604d)
2024-11-13 19:48:10 +00:00
David Joaquín Shourabi Porcel
697d247e30 man: machinectl(1): Fix description of subcommand poweroff
(cherry picked from commit a41da1e7037dc36a601d3428343bbc7f0eed3e20)
2024-11-13 19:48:10 +00:00
David Joaquín Shourabi Porcel
5a2f94d2da man: systemd-nspawn(1): Fix some typos
(cherry picked from commit f4e3c6e5b318d22a9c40144c6d52ae68a70c264c)
2024-11-13 19:48:10 +00:00
Yu Watanabe
b64601d454 test: add test cases for timestamp with time zone
(cherry picked from commit 25999f868fe0e9684af7a364224ac42071b70f74)
2024-11-13 19:48:10 +00:00
Yu Watanabe
38d55448b9 time-util: copy input string before fork()
Fixes #34670.

(cherry picked from commit 6d3012bab4ce4c1ed260598d05b4e9f2ea471658)
2024-11-13 19:48:10 +00:00
Yu Watanabe
c7a00c4cae time-util: fix parsing timestamp with NZ timezone
Fixes a bug caused by ef658a63f8163607d9e04f710cd26c0d36ff68ce.

(cherry picked from commit eb87d3e1e9210d9387536cc3ece4e32aacdc5009)
2024-11-13 19:48:10 +00:00
Lennart Poettering
964f7772ad resolved: fix fastopen fallback
We should not invalidate the socket address size before we use it.

Fixes: #34579
(cherry picked from commit 5699e4c2d470a12c922c4b7c86a8987837911626)
2024-11-13 19:48:10 +00:00
Vito Caputo
5e45c58274 mmap-cache: add some stats about files/windows/unused
Let's give some visibility into the ratio of files:windows:unused
by the time we're done using the cache.

(cherry picked from commit 284802c597aa0194dc1504db65ee24941d9721eb)
2024-11-13 19:48:10 +00:00
Vito Caputo
3dcde32fed mmap-cache: enforce an unused windows minimum
With many fds the global windows count generally exceeds the
minimum.   This results in always reusing the unused entry if
there is one, which becomes a sort of degenerate case where we're
just constantly unmapping->mapping.

Instead let's try always have at least several unused windows on
the unused list before we resort to churning through it.

Fixes #34516

(cherry picked from commit 176f73272e6e3116caab3900eb553be54f520a68)
2024-11-13 19:48:10 +00:00
Daan De Meyer
933686348b
Merge pull request #34728 from DaanDeMeyer/backport-logging-improvements
Backport logging improvements to v256-stable
2024-10-11 20:40:07 +02:00
Daan De Meyer
814be7116d core: Log in more scenarios about which process initiated an operation
Exit/Reboot/Poweroff and similar operations are invasive enough that
logging about who initiated them is very useful to debug issues.

(cherry picked from commit acb0f501f4291efce82bcf89d4ad92b6a895f4fa)
2024-10-11 18:14:45 +02:00
Daan De Meyer
31e38b55b2 core: Bump log level of reexecute request to notice
A daemon-reload is important enough to deserve logging at notice
level.

(cherry picked from commit 4ee41be82507348fbbc9d3ab28aae6330eb51663)
2024-10-11 18:13:35 +02:00
Daan De Meyer
871ee2f087 bus-util: Log more information when connecting to a bus socket fails
Let's log about which bus we're trying to connect to and what transport
we're using to do it.

(cherry picked from commit d8a77d55e6ad7f251ae0eb6758af6bba111095df)
2024-10-11 18:12:38 +02:00
Frantisek Sumsal
c5baa5d9d9 test: drop removed SCSI passthrough feature
This feature has been deprecated since QEMU 5.0 and finally removed in
QEMU 9.1 [0] which now causes issues when running the storage tests on
latest Arch:

------ testcase_long_sysfs_path: BEGIN ------
...
qemu-system-x86_64: -device virtio-blk-pci,drive=drive0,scsi=off,bus=pci_bridge25: Property 'virtio-blk-pci.scsi' not found
E: qemu failed with exit code 1

[0] a271b8d7b2

(cherry picked from commit cd57920fbf6a8f7769a82cfc9bebc12965de0199)
2024-10-09 15:32:29 +01:00
Luca Boccassi
abd44e2654 doc-sync: strip point release from version before uploading
We create subdirectories for each major release, but not for point releases
so strip the suffix if it is present

(cherry picked from commit 59e6059513ea53954176096152b8c04f20198cbf)
2024-10-08 16:47:25 +01:00
Luca Boccassi
7635d01869 meson: bump version to 256.7 v256.7 2024-10-08 16:42:30 +01:00
Yu Watanabe
259a8413a6 test: add test cases for --volatile= with -U
For issue #34254.

(cherry picked from commit 48878074d69a558484348f14e8887ce132938377)
2024-10-08 16:39:12 +01:00
Yu Watanabe
8f31e8ca84 nspawn: only remount /usr/ with idmap when --volatile=yes
The root directory is already mounted with a picked UID shift, hence
it is not necessary to remount with idmap. However, /usr/ is a bind-mount,
hence it must be remounted with idmap.

With this change, now '-U --volatile=yes' works fine.

Fixes #34254.

(cherry picked from commit 025be2361b3ee7cc3732fb3963d36b8583842064)
2024-10-08 16:39:12 +01:00
Yu Watanabe
8c31367d23 nspawn: mount /var/ after remount_idmap() when --volatile=state
Previously, remount_idmap() failed as /var/ was already mounted, thus
remounting (strictly speaking, unmounting old root directory) failed
with -EBUSY.

As tmpfs /var/ is mounted with picked UID shift, it should not be
remounted with idmap, but needs to be mounted after the root directory
being remounted.

This makes '-U --volatile=state' work as expected.

(cherry picked from commit 2c2511aa734c507e04e06d273b474acacac9d486)
2024-10-08 16:39:12 +01:00
Yu Watanabe
8aedc1fe29 nspawn: use strv_extend() and friends to build directories passed to remount_idmap()
No functional change, just refactoring and preparation for later change.

(cherry picked from commit 21cd84df6931a358714af9d1f8cc54b26fef1a39)
2024-10-08 16:39:12 +01:00
Lennart Poettering
c5169b4441 meson: tweak meson conditionalization for ssh{d,}_config drop-ins
Let's make sure "no" is an acceptable setting for these paths.

(cherry picked from commit a8ea7c19400363847bcd62f3b9ee533fbab0e658)
2024-10-08 16:39:12 +01:00
Ronan Pigott
5dc97968d6 load-fragment: terminate the specifier table (#34421)
Otherwise an invalid specifier iterates over uninitialized data.

Fixes a bug introduced by 0b40688d1830abc6f59b1f1f67eccd757c23eb09 (v254).

(cherry picked from commit 32b8065e876c6f89f55b1bb30eeb442d3921fb3a)
2024-10-08 16:39:12 +01:00
Mike Yuan
4296a567d4 various: correct laccess() error check
laccess is our own macro that uses RET_NERRNO.

(cherry picked from commit 7c1dd9e288047a69d4a6a6dd6585725410cfdadd)
2024-10-08 16:39:12 +01:00
Daan De Meyer
902877d55e Fix generator logging
log_setup() overrides the previously set log target again so we
can't use it in log_setup_generator().

Follow-up for aa976d87889ae22b7347787a1ebd03a31dcc0a9e

(cherry picked from commit b3ebd480d6674ce4f66200858c88557595713bd5)
2024-10-08 16:39:12 +01:00
Luca Boccassi
86a9eea94c mkosi: update debian commit reference
* cb00be93e5 Upstream profile: skip dh_strip_nondeterminism
* c948e192a8 autopkgtest: skip gdm3 on armel for smoke tests
* e12116becb initramfs-tools: ensure rules file exists before invoking chzdev
* c8904f67e9 Filter out zdev rules in the initramfs hook (LP: #2044104)
* 9967984fc8 salsa-ci: test the stage1 build profile
* 2c81f4a6cc d/e/checkout-upstream: undo quilt patches before switching debian branch
* e75197fa10 d/e/checkout-upstream: do not rebase on main when building stable branches
* 7989319bca Drop patch merged upstream
* b7127a0725 Depend on new linux-bpf-dev package where available
* 7966d2543f autopkgtest: use hint-testsuite-triggers to ensure other packages changes trigger our testsuite
* 777af76cae autopkgtest: run upstream test last
* f257c53fe3 Stop installing legaly pkla file in upstream CI too
* a4b54fd693 Use d/not-installed instead of manual removals
* e0fdbb4496 Stop shipping empty /etc/init.d directory
* 202c7fc8f9 Use debian/clean instead of override in d/rules
* ba81ea64a6 Drop redundant pot build
* 9152d0e064 autopkgtest: allow localectl in localed tests
* 319a078b8e Fix D-Bus policy for locale1 blocking
* 28daa8b37b Drop last patch, all merged upstream
* 7bf7bf6f4e Drop out-of-tree localed patch and use D-Bus policy instead
* 409028b7e6 Drop /etc/sysctl.d/99-sysctl.conf symlink
* 6f37d3cb3e d/e/checkout-upstream: switch packaging branch on upstream stable PRs
* b7e53c00b2 d/e/checkout-upstream: do not fail if rebase fails
* 1364bb81d4 d/e/checkout-upstream: fix shellcheck warnings
* 796d133b0c initramfs-tools: copy network drop-ins too
2024-10-08 16:39:12 +01:00
Luca Boccassi
906a3d37ce mkosi: mark test as skipped when QEMU crashes
On Ubuntu/Debian infrastructure QEMU crashes a lot, so mark the test
as skipped in that case as there's nothing we can do about it and
we shouldn't mark runs as failed

(cherry picked from commit 0d7f5a9ae6f5fc70c5ad23398c2b7a515e9b1982)
2024-10-08 16:39:12 +01:00
Luca Boccassi
966d8a90ca semaphore: do not build docs
There are other CI runs that build manpages, speed up build which is close to 1hr limit

(cherry picked from commit d58a904d35d3abcb7265b28b14aac596631e27d6)
2024-10-08 16:39:12 +01:00
Luca Boccassi
52afaa8034 semaphore: stop building and running extra unit tests
This slows down the build, which is often near the 1hr limit. There are
other jobs running the extra unit tests.

(cherry picked from commit 3bc5480bac474263881e4c5919d5cce0debf3c40)
2024-10-08 16:39:12 +01:00
Luca Boccassi
bc0102b0ca Semaphore: switch from /tmp to /var/tmp to avoid disk space issues
Builds have been failing as we run out of space in /tmp/, move to
/var/tmp

(cherry picked from commit 0c7b5dad33ee01b7ff6b7a8c583a7e2c27ac0673)
2024-10-08 16:39:12 +01:00
Thomas Blume
7c399a4003 test: set TEST_NESTED_KVM as default
(cherry picked from commit 5540c37bb8b275cb58b1c936ff701d1c80503e9b)
2024-10-08 16:39:12 +01:00
Daan De Meyer
8bf57b2f83 mkosi: Switch to Fedora 41
It's due for release soon and will fix the flakyness of TEST-58-REPART
so let's bump the Fedora 40 job to Fedora 41.

(cherry picked from commit 12a1b02b528e1802025fdc7e3ac9de9426a14391)
2024-10-08 16:39:12 +01:00
Lukas Nykryn
7ac58949a3 core: warn if a generator is world-writable
... because that is obviously a security risk.

(cherry picked from commit da32cac8a014ddf048fc7bad84dafdbc204d4dc8)
2024-10-08 16:39:12 +01:00
Yu Watanabe
7b9e412d8a test: add test case for issue #34637
(cherry picked from commit 88d186e4829bc7ef4a4253fe2bf4857903bca830)
2024-10-08 16:39:12 +01:00
Yu Watanabe
02a5e5a323 udev-node: skip stack directory creation for diskseq
The disk/by-diskseq symlink should not be shared with multiple block
devices. Hence, it is not necessary to create stack directory for the
symlink that manages which device owns the symlink.

This is not just a optimization.
If a service unit tries to mount a disk image but the service fails, then
the diskseq of the loop device for the image may be continuously increased
during restart, and inodes in /run may increase rapidly, as the stack
directories are cleaned up only when udev queue is empty.

Fixes #34637.

(cherry picked from commit 09373c1a50297079e6b0447ea97af4e9a60f77fa)
2024-10-08 16:39:12 +01:00