1
0
mirror of https://github.com/systemd/systemd.git synced 2025-01-31 05:47:30 +03:00

74859 Commits

Author SHA1 Message Date
Luca Boccassi
a2240d1cf9 meson: bump version to 256.8 v256.8 2024-11-14 18:11:30 +00:00
Luca Boccassi
d8ec2770b7 test: skip TEST-84-STORAGETM if running with bugged libnvme
libnvme 1.11 appears to require a kernel built with NVME TLS
kconfigs, and fails hard if it is not, as the expected
privileged keyring '.nvme' is not present. We cannot just
create it from userspace, as privileged keyrings can only
be created by the kernel itself (those starting with '.').

Skip the test if the library exactly matches this version.

https://github.com/linux-nvme/nvme-cli/issues/2573

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

(cherry picked from commit 893aa45886ef84b1827445dc438e410ad89fbbbf)
2024-11-14 18:10:26 +00:00
Yu Watanabe
04ee5e25a1 nspawn: ignore failure in creating /dev/net/tun when --private-network is unspecified
Follow-up for efedb6b0f3cff37950112fd37cb750c16d599bc7.
Closes #35116.

(cherry picked from commit 985ea98e7f90c92fcc0b8441fafb190353d2feb8)
Really rewritten from scratch.
2024-11-14 17:07:30 +01:00
Yu Watanabe
56cc8acf45 network-generator: drop wrong warning for rd.peerdns without value
(cherry picked from commit 2a774f064815573efc33d43dfe3548590e42e9c2)
2024-11-14 13:12:13 +00:00
Yu Watanabe
74f85451cb network-generator: ignore kernel command line without value
And drop duplicated log messages.

(cherry picked from commit 551b21eb0a5ea691d7bce0aff6b1281dd1f98819)
2024-11-14 13:12:13 +00:00
Yu Watanabe
4cd435ca49 network-generator: parse vlan ID from vlan interface name
Fixes #33954.

(cherry picked from commit e31a55edf136e777aabdf19894ee886eac47c20e)
2024-11-14 13:12:13 +00:00
Yu Watanabe
209eaef60f network-generator: allow to create bridge or friends without slave interfaces
(cherry picked from commit c40ef3f8ff3fd212b88aa84b9e17d1d49aca4ddb)
2024-11-14 13:12:13 +00:00
Yu Watanabe
f3baba9442 network-generator: vlan= can be specified multiple times
(cherry picked from commit 9eee6b1b3f00d46459eebefb70be50ea6af30ddb)
2024-11-14 13:12:13 +00:00
Lennart Poettering
dbf933478f shutdown: replace unbounded fsync() with bounded sync_with_progress()
Let's put a time-out on this syncing.

Inspired-by: #34289 #34283
(cherry picked from commit b4b66b26620bfaf5818c95d5cffafd85207694e7)
2024-11-14 13:12:13 +00:00
Lennart Poettering
05df6c3419 shutdown: teach sync_with_progress() to optionally sync a specific fd only
This is preparation for reusing the logic for syncing DM and other
devices with a timeout applied.

(cherry picked from commit 13b5225d6278af15e84ebd1889f04cfe81b47787)
2024-11-14 13:12:13 +00:00
Mike Yuan
489cf962ad shutdown: clean up sync_with_progress a bit
Also, ignore the error on caller's side.

(cherry picked from commit 758760a3610e3c6674de8a1d51b12b991eafef7c)
2024-11-14 13:12:13 +00:00
andre4ik3
a9d9db7f4e boot: allocate cleanup pages below 4GiB only on x86
Outside of x86, some machines (e.g. Apple silicon, AMD Opteron A1100) have
physical memory mapped above 4GiB, meaning this allocation will fail, causing
the entire boot process to fail on these machines.

This commit makes it so that the below-4GB address space allocation requirement
is only set on x86 platforms, and not on other platforms (that don't have the
specific Linux x86 boot protocol), thereby fixing boot on those that have no
memory mapped below 4GiB in their address space.

Tested on an Apple silicon M1 laptop and an AMD x86_64 desktop tower.

Fixes: #35026

Manual backport of 6e207b370e91e681efb08c497a6c8ad78e3c8d83.
2024-11-14 13:12:13 +00:00
Mike Yuan
018c7fb18a portable: do not use SYNTHETIC_ERRNO for sd_bus_error_set_errno()
The concept of synthetic errnos is about logging, which
is irrelevant irt bus error and we don't do any special
treatment in sd-bus for them, meaning the value propagated
would be spurious.

(cherry picked from commit 2f2058da0b88535cb3a95fc98e7b2f1ae4d35601)
2024-11-14 13:12:13 +00:00
Luca Boccassi
7e36a73e2e hwdb: update to main@{2024-11-12}
git restore -s origin/main hwdb.d/ test/hwdb.d
2024-11-13 19:48:10 +00:00
Luca Boccassi
cdaf50e71d mkosi: update opensuse commit reference
It was force-pushed again

(cherry picked from commit 3034dc001394bba6d94d16a2a9c7a8cefd53035e)
2024-11-13 19:48:10 +00:00
Luca Boccassi
d7ced5c3e0 mkosi: update opensuse commit reference and switch branch
'factory' was reset to 8 years ago

(cherry picked from commit 77579c66ef4b8aec1e723f9ed6c63efd10fb2688)
2024-11-13 19:48:10 +00:00
Yu Watanabe
c479007d18 TEST-17-UDEV: check if udev database file is removed on remove event
(cherry picked from commit 49c46fbaf15b95a8264d01213539914e15fdc6fe)
2024-11-13 19:48:10 +00:00
Yu Watanabe
b2ce8fa2f1 udev: do not re-create database on remove event
Fixes a bug introduced by f6bda694f908cc227b002570b893029aa4c9e173 (v256).

With the offending commit, on remove event, database file for a device is once
removed in event_execute_rules_on_remove(), but later re-created here.
This fixes the issue, and makes the database file not re-created on remove event.

(cherry picked from commit 5b2dce150d5eadcd33d620e095c9c1e2de51dd24)
2024-11-13 19:48:10 +00:00
Yu Watanabe
dc44fd69b0 core/namespace: honor MountEntry.read_only, .options, and so on in static entries
Otherwise, ProtectHome=tmpfs makes /home/ and friends not read-only.
Also, mount options for /run/ specified in MountAPIVFS=yes are not
applied.

The function append_static_mounts() was introduced in
5327c910d2fc1ae91bd0b891be92b30379c7467b, but at that time, there were
neither .read_only nor .options in the struct. But, when later the
struct is extended, the function was not updated and they were not
copied from the static table.
The fields has been used in static tables since
e4da7d8c796a1fd11ecfa80fb8a48eac9e823f06, and also in
94293d65cd4125347e21b3e423d0e245226b1be2.

Fixes #34825.

(cherry picked from commit 0cc496b2d21f73d0a03414ce40eceb9e3af76e22)
2024-11-13 19:48:10 +00:00
Yu Watanabe
3093ac05ab network/tunnel: allow Local=/Remote=any for all tunnel types
It seems there is no restriction for local and remote addresses.

Fixes #34930.

(cherry picked from commit 5e48fd0506ed6212c9db2276d5845ab77aa9bce4)
2024-11-13 19:48:10 +00:00
Štěpán Němec
1bc1a5ea7e man/systemd.special: fix a typo
(cherry picked from commit 62ec4798f28ccf02926c2ae53d2a772b088383ee)
2024-11-13 19:48:10 +00:00
Štěpán Němec
a07693cda5 man: fix incorrect volume numbers in internal man page references
Some ambiguity (e.g., same-named man pages in multiple volumes)
makes it impossible to fully automate this, but the following
Python snippet (run inside the man/ directory of the systemd repo)
helped to generate the sed command lines (which were subsequently
manually reviewed, run and the false positives reverted):

from pathlib import Path

import lxml
from lxml import etree as ET

man2vol: dict[str, str] = {}
man2citerefs: dict[str, list] = {}

for file in Path(".").glob("*.xml"):
    tree = ET.parse(file, lxml.etree.XMLParser(recover=True))
    meta = tree.find("refmeta")
    if meta is not None:
        title = meta.findtext("refentrytitle")
        if title is not None:
            vol = meta.findtext("manvolnum")
            if vol is not None:
                man2vol[title] = vol
            citerefs = list(tree.iter("citerefentry"))
            if citerefs:
                man2citerefs[title] = citerefs

for man, refs in man2citerefs.items():
    for ref in refs:
        title = ref.findtext("refentrytitle")
        if title is not None:
            has = ref.findtext("manvolnum")
            try:
                should_have = man2vol[title]
            except KeyError:  # Non-systemd man page reference?  Ignore.
                continue
            if has != should_have:
                print(
                    f"sed -i '\\|<citerefentry><refentrytitle>{title}"
                    f"</refentrytitle><manvolnum>{has}</manvolnum>"
                    f"</citerefentry>|s|<manvolnum>{has}</manvolnum>|"
                    f"<manvolnum>{should_have}</manvolnum>|' {man}.xml"
                )

(cherry picked from commit 597c6cc1195a986e8f89921aa89505b0eacf8181)
2024-11-13 19:48:10 +00:00
12paper
c89c5d04f3 login: fix session_kill(..., KILL_LEADER,...) (#35105)
`loginctl kill-session --kill-whom=leader <N>` (or the D-Bus equivalent)
doesn't work because logind ends up calling `KillUnit(..., "main", ...)`
on a scope unit and these don't have a `MainPID` property. Here, I just
make it send a signal to the `Leader` directly.

(cherry picked from commit 8254755091847105c33e473c62cdc7621ed275bc)
2024-11-13 19:48:10 +00:00
Lidong Zhong
688eb20fdb udev: skipping empty udev rules file while collecting the stats
To keep align with the logic used in udev_rules_parse_file(), we also
should skip the empty udev rules file while collecting the stats during
manager reload. Otherwise all udev rules files will be parsed again whenever
reloading udev manager with an empty udev rules file. It's time consuming
and the following uevents will fail with timeout.

(cherry picked from commit 2ae79a31b7c7947e2c16e18eb85ac5607ebc40b6)
2024-11-13 19:48:10 +00:00
Zbigniew Jędrzejewski-Szmek
4cafd1a21f man: drop whitespace from final <programlisting> lines
In the troff output, this doesn't seem to make any difference. But in the
html output, the whitespace is sometimes preserved, creating an additional
gap before the following content. Drop it everywhere to avoid this.

(cherry picked from commit fe45f8dc9bf1e9be8de4e14838bc2d7befcf946b)
2024-11-13 19:48:10 +00:00
Luca Boccassi
53c85fc3c5 docs: add reminder to run update-man-rules before tagging a release
(cherry picked from commit 088793239ebc9c3a26c562be82dd5f4467162b26)
2024-11-13 19:48:10 +00:00
Luca Boccassi
42d32c0505 docs: remove 'v' prefix from meson.version
It is actually v-less

(cherry picked from commit 94a46c20dacd8859a6fa3f807b0d134f800a1e90)
2024-11-13 19:48:10 +00:00
Zbigniew Jędrzejewski-Szmek
9ab93761c1 pid1: stop refusing to boot with cgroup v1
Since v256 we completely fail to boot if v1 is configured. Fedora 41 was just
released with v256.7 and this is probably the first major exposure of users to
this code. It turns out not work very well. Fedora switched to v2 as default in
F31 (2019) and at that time some people added configuration to use v1 either
because of Docker or for other reasons. But it's been long enough ago that
people don't remember this and are now very unhappy when the system refuses to
boot after an upgrade.

Refusing to boot is also unnecessarilly punishing to users. For machines that
are used remotely, this could mean somebody needs to physically access the
machine. For other users, the machine might be the only way to access the net
and help, and people might not know how to set kernel parameters without some
docs. And because this is in systemd, after an upgrade all boot choices are
affected, and it's not possible to e.g. select an older kernel for boot. And
crashing the machine doesn't really serve our goal either: we were giving a
hint how to continue using v1 and nothing else.

If the new override is configured, warn and immediately boot to v1.
If v1 is configured w/o the override, warn and wait 30 s and boot to v2.
Also give a hint how to switch to v2.

https://bugzilla.redhat.com/show_bug.cgi?id=2323323
https://bugzilla.redhat.com/show_bug.cgi?id=2323345
https://bugzilla.redhat.com/show_bug.cgi?id=2322467
https://www.reddit.com/r/Fedora/comments/1gfcyw9/refusing_to_run_under_cgroup_01_sy_specified_on/

The advice is to set systemd.unified_cgroup_hierarchy=1 (instead of removing
systemd.unified_cgroup_hierarchy=0). I think this is easier to convey. Users
who are understand what is going on can just remove the option instead.

The caching is dropped in cg_is_legacy_wanted(). It turns out that the
order in which those functions are called during early setup is very fragile.
If cg_is_legacy_wanted() is called before we have set up the v2 hierarchy,
we incorrectly cache a true answer. The function is called just a handful
of times at most, so we don't really need to cache the response.

(cherry picked from commit d0ab0e5fa5434cac67e51dbeb1d873c6ac6f20cd)
2024-11-13 19:48:10 +00:00
Yu Watanabe
4d574b106f man/udev: fix typo
Follow-up for df8f9b88bd41320653fe1c51ea515a2d03a349df.

(cherry picked from commit 9dcf5c226e582cb664b6f14d5efbeed2350ba3bc)
2024-11-13 19:48:10 +00:00
Lennart Poettering
d4d7aa60e1 man: convert multiple left-over "See Also" sections to <simplelist>
These were forgotten during the initial conversion, probably because
most of them consisted only of a single entry.

Fix that.

(cherry picked from commit df8f9b88bd41320653fe1c51ea515a2d03a349df)
2024-11-13 19:48:10 +00:00
Lennart Poettering
d9ab18e747 man: link up D-Bus API docs from daemon man pages
Let's systematically make sure that we link up the D-Bus interfaces from
the daemon man pages once in prose and once in short form at the bottom
("See Also"), for all daemons.

Also, add reverse links at the bottom of the D-Bus API docs.

Fixes: #34996
(cherry picked from commit 607d2974870e9769f44ee179dcaf26cbec64cb20)
2024-11-13 19:48:10 +00:00
Lennart Poettering
ea8b10409b man: point people from sd-bus man page to busctl
(cherry picked from commit 2f69ad26ca21d4da7f875bdea77594a115e2deee)
2024-11-13 19:48:10 +00:00
Lennart Poettering
307a6332a6 man: tone down claims on processes having exited already in ExecStop=
Processes can easily survive the first kill operation we execute, hence
we shouldn't make strong claims about them having exited already. Let's
just say "likely" hence.

Fixes: #15032
(cherry picked from commit ac804bc2f8d814d2afcdccd88f7469ac320da1c8)
2024-11-13 19:48:10 +00:00
Lennart Poettering
a6f9c20316 man: document that .path units don't care for hidden files
Fixes: #32751
(cherry picked from commit 5adc4337996f561df43c617e37ef4b157073b2e6)
2024-11-13 19:48:10 +00:00
Lennart Poettering
48559a0b22 man: document that PrivateTmp= is unaffected by ProtectSystem=strict
Fixes: #33130
(cherry picked from commit b71173709651102081c9d8c6d6e3d2a6ef5cf17e)
2024-11-13 19:48:10 +00:00
Lennart Poettering
5a2ffc543b man: don't claim SELinuxContext= only worked in the system service manager
Fixes: #34840
(cherry picked from commit ecbe9ae5a0952d968c57e59dda4a42b72e5b5e6d)
2024-11-13 19:48:10 +00:00
Lennart Poettering
f792b8020b man: document the timeout applied to /usr/lib/systemd/system-shutdown/ drop-in binaries
Fixes: #34949
(cherry picked from commit af080967bad2524d2fa2fef6ba5e9fcf18d3017e)
2024-11-13 19:48:10 +00:00
Luca Boccassi
dadb179bec test: delete /swapfile after swapoff
[   23.608342] TEST-55-OOMD.sh[689]: + btrfs filesystem mkswapfile -s 64M /swapfile
[   23.651930] TEST-55-OOMD.sh[704]: ERROR: cannot create new swapfile: File exists

(cherry picked from commit 78b032d727e8f9e925c10c6617a1e409307ffc24)
2024-11-13 19:48:10 +00:00
Lennart Poettering
070dbe1e77 run: handle gracefully if we can't find binary client-side due to perms
Fixes: #35022
(cherry picked from commit 9810899ef2f28fbb42cf659e6892b1a5074cfc83)
2024-11-13 19:48:10 +00:00
Zbigniew Jędrzejewski-Szmek
abd1e40820 resolved: log error messages for openssl/gnutls context creation
In https://bugzilla.redhat.com/show_bug.cgi?id=2322937 we're getting
an error message:
Okt 29 22:21:03 fedora systemd-resolved[29311]: Could not create manager: Cannot allocate memory
I expect that this actually comes from dnstls_manager_init(), the
openssl version. But without real logs it's hard to know for sure.

Use EIO instead of ENOMEM, because the problem is unlikely to be actually
related to memory.

(cherry picked from commit ee95e86ae163e436384f1b782a77a7e18deba890)
2024-11-13 19:48:10 +00:00
Luca Boccassi
5a13150485 ci: add coverage for builds without sd-boot
This should catch compilation issues such as:
https://github.com/systemd/systemd/pull/35014

(cherry picked from commit 8a3ac7afa6be8447061dc6cbd98830bb332fed28)
2024-11-13 19:48:10 +00:00
Luca Boccassi
a105a9bda6 test: set nullglob to avoid failure when building without sd-boot
2024-11-04T20:13:17.3258095Z + for loader in build/src/boot/efi/*{.efi,.efi.stub}
2024-11-04T20:13:17.3258275Z ++ sbverify --list 'build/src/boot/efi/*.efi'
2024-11-04T20:13:17.3258525Z + [[ Error reading file build/src/boot/efi/*.efi: No such file or directory
2024-11-04T20:13:17.3258952Z Can't open image build/src/boot/efi/*.efi != \N\o\ \s\i\g\n\a\t\u\r\e\ \t\a\b\l\e\ \p\r\e\s\e\n\t ]]
(cherry picked from commit 441922336baf4e302e3b88849c5a08c73b602044)
2024-11-13 19:48:10 +00:00
Luca Boccassi
59f5de450a test: fix tool name in comment
(cherry picked from commit c53df275d512a219806a181de3bd57f02dc38dab)
2024-11-13 19:48:10 +00:00
Daan De Meyer
9d22224e00 pcrlock: Pad pe hash to a multiple of 8 bytes
All other tools (sbsigntools, osslsigncode, sbctl, goblin) do this
as well so let's follow suite.

(cherry picked from commit e37701a8cd2db1e67d28bcf337467d8efc6de41e)
2024-11-13 19:48:10 +00:00
Colin Foster
4ea8428848 test-dhcp-client: utilize log_info instead of printf
log_info appears to be the preferred method to convey information from
tests. Convert all the printfs to log_info to follow this standard.

(cherry picked from commit 38557d9ffbc6351b8980faf90d54619790436d43)
2024-11-13 19:48:10 +00:00
Martin Wilck
852e38edd0 udev-builtin-path_id: SAS wide ports must have num_phys > 1
Some kernel SAS drivers (e.g. smartpqi) expose ports with num_phys = 0. udev
shouldn't treat these ports as wide ports.  SAS wide ports always have
num_phys > 1. See comments for sas_port_add_phy() in the kernel sources.

Sample data from a smartpqi system to illustrate the issue below.
Here the phy device is attached to port 0:0, which has no end devices attached
and the SAS end device (where sda is attached) is associated with SAS
port 0:1, which has no associated phy device. Thus num_phys for port-0:1 is 0.
This is arguably wrong, but it's how smartpqi has always set up its devices in
sysfs.

/sys/class/sas_phy/phy-0:0 -> ../../devices/pci0000:46/0000:46:02.0/0000:47:00.0/host0/scsi_host/host0/phy-0:0/sas_phy/phy-0:0
/sys/devices/pci0000:46/0000:46:02.0/0000:47:00.0/host0/scsi_host/host0/port-0:0/phy-0:0 -> ../phy-0:0
/sys/devices/pci0000:46/0000:46:02.0/0000:47:00.0/host0/scsi_host/host0/phy-0:0/port -> ../port-0:0

/sys/class/sas_device/end_device-0:1 -> ../../devices/pci0000:46/0000:46:02.0/0000:47:00.0/host0/scsi_host/host0/port-0:1/end_device-0:1/sas_device/end_device-0:1
/sys/class/block/sda -> ../../devices/pci0000:46/0000:46:02.0/0000:47:00.0/host0/scsi_host/host0/port-0:1/end_device-0:1/target0:0:0/0:0:0:0/block/sda

Signed-off-by: Martin Wilck <mwilck@suse.com>
(cherry picked from commit 7f6674624eedc95db2a9877edc6ff424f4453531)
2024-11-13 19:48:10 +00:00
Daan De Meyer
f7d52524a7 TEST-64-UDEV-STORAGE: Don't hardcode device name in long-sysfs-path test
There's no guarantee our device will be named /dev/vda, so give it
a serial so we can query for its devname inside the test.

(cherry picked from commit 2ec809dd3baf39b83b8f581e7ea837b9732f9964)
2024-11-13 19:48:10 +00:00
Daan De Meyer
beca1de2ef TEST-17-UDEV: Don't hardcode root device name
There's no guarantee the root device will be /dev/sda, so let's use
bootctl to get the actual path instead of harcoding it.

(cherry picked from commit 29a8e71d9c0858aef502f091a0ef58d5569b1c70)
2024-11-13 19:48:10 +00:00
Ronan Pigott
c413c43c12 pam: quiet a spurious debug message
This singular debug message gets printed even if debug is not enabled.
Quiet this message when debug is not enabled for consistency.

(cherry picked from commit f4092cb9745cc2fc1f889eeaffa5cb5133969d85)
2024-11-13 19:48:10 +00:00
Mike Gilbert
aa0aa1093d posix_spawn_wrapper: do not set POSIX_SPAWN_SETSIGDEF flag
Setting this flag is a noop without a corresponding call to
posix_spawnattr_setsigdefault.

If we call posix_spawnattr_setsigdefault with a full signal set,
it causes glibc's posix_spawn implementation to call sigaction 63 times,
once for each signal. That seems wasteful.

This feature is really only useful for signals which have their
disposition set to SIG_IGN. Otherwise the dispostion gets set to
SIG_DFL automatically, either by clone(CLONE_CLEAR_SIGHAND) or the
subsequent execve.

As far as I can tell, systemd does not have any signals set to SIG_IGN
under normal operating conditions.

(cherry picked from commit ff94426f8a2d6cd4ea2e370835db152917a1684e)
2024-11-13 19:48:10 +00:00