1
0
mirror of https://github.com/systemd/systemd.git synced 2025-01-09 01:18:19 +03:00
Commit Graph

74867 Commits

Author SHA1 Message Date
Antonio Alvarez Feijoo
03b993a9bf man/kernel-command-line: fix typo
(cherry picked from commit a04d42821b)
2024-11-28 15:05:52 +01:00
Yu Watanabe
7bb3040cc4 ndisc-option: use memcpy_safe() at one more place
As 'len' may be 8.

Follow-up for a163404cc8.

(cherry picked from commit c8ddd5ff72)
2024-11-28 15:04:56 +01:00
Antonio Alvarez Feijoo
4a3d55a032 cryptenroll: show better log message if slot to wipe does not exist
```
$ systemd-cryptenroll /dev/vda3
SLOT TYPE
   0 password
$ systemd-cryptenroll --wipe-slot 1 /dev/vda3
Failed to wipe slot 1, continuing: No such file or directory
```

(cherry picked from commit 2b251491de)
2024-11-28 15:04:47 +01:00
Mantas Mikulėnas
1877797299 ssh-generator: silence "Binding to socket" messages
(cherry picked from commit 2424a67c02)
2024-11-28 15:04:37 +01:00
Lennart Poettering
ff4b66be4a systemctl: grey out tasks limit the same way we grey out the fd store limit in the output
"systemctl status systemd-logind" otherwise looks a bit weird, since the
tasks and the fdstore lines are so close to each other but formatted
quite differently when it comes to coloring.

(cherry picked from commit 54646b1ca9)
2024-11-28 15:03:05 +01:00
Lennart Poettering
bdf3f9b8f2 nspawn: --private-users-ownership= value is called 'chown', not 'own'
(cherry picked from commit bae936b418)
2024-11-28 15:00:40 +01:00
Lennart Poettering
cf7b3cc182 pid1: make clear that $WATCHDOG_USEC is set for the shutdown binary, noone else
We use the $WATCHDOG_USEC variable for two very closely uses: as part of
the sd_watchdog_enabled() protocol for implementing service watchdogs.
And as part of the protocol between the service manager and
systemd-shutdown across the PID 1 execve() transition during shutdown.

Apparently some exitrds tools got confused by the latter use. Let's
address that by setting $WATCHDOG_PID to 1, in accordance to the
sd_watchdog_enabled() protocol to make clear this is only intended for
PID 1 and nothing else.

Replaces: #35135
(cherry picked from commit 4b20ae9a0e)
2024-11-28 15:00:30 +01:00
Daan De Meyer
80462e5dfe Add proper dependencies to ukify target
Also remove the systemd-measure dependency from the mkosi target as
mkosi doesn't invoke systemd-measure itself.

(cherry picked from commit 1a077e05fb)
2024-11-28 15:00:17 +01:00
Luca Boccassi
a2240d1cf9 meson: bump version to 256.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 893aa45886)
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 efedb6b0f3.
Closes #35116.

(cherry picked from commit 985ea98e7f)
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 2a774f0648)
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 551b21eb0a)
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 e31a55edf1)
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 c40ef3f8ff)
2024-11-14 13:12:13 +00:00
Yu Watanabe
f3baba9442 network-generator: vlan= can be specified multiple times
(cherry picked from commit 9eee6b1b3f)
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 b4b66b2662)
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 13b5225d62)
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 758760a361)
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 6e207b370e.
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 2f2058da0b)
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 3034dc0013)
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 77579c66ef)
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 49c46fbaf1)
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 f6bda694f9 (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 5b2dce150d)
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
5327c910d2, 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
e4da7d8c79, and also in
94293d65cd.

Fixes #34825.

(cherry picked from commit 0cc496b2d2)
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 5e48fd0506)
2024-11-13 19:48:10 +00:00
Štěpán Němec
1bc1a5ea7e man/systemd.special: fix a typo
(cherry picked from commit 62ec4798f2)
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 597c6cc119)
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 8254755091)
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 2ae79a31b7)
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 fe45f8dc9b)
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 088793239e)
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 94a46c20da)
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 d0ab0e5fa5)
2024-11-13 19:48:10 +00:00
Yu Watanabe
4d574b106f man/udev: fix typo
Follow-up for df8f9b88bd.

(cherry picked from commit 9dcf5c226e)
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 df8f9b88bd)
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 607d297487)
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 2f69ad26ca)
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 ac804bc2f8)
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 5adc433799)
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 b711737096)
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 ecbe9ae5a0)
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 af080967ba)
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 78b032d727)
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 9810899ef2)
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 ee95e86ae1)
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 8a3ac7afa6)
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 441922336b)
2024-11-13 19:48:10 +00:00