1
0
mirror of https://github.com/systemd/systemd.git synced 2024-12-31 21:18:09 +03:00
Commit Graph

74889 Commits

Author SHA1 Message Date
Yu Watanabe
d51236d833 man: several more assorted fixes
Continuation of 4ebbb5bfe8.
Closes #35307.

(cherry picked from commit f29a07f3fc)
2024-11-29 14:26:57 +01:00
Lennart Poettering
b2751b9ae9 sd-varlink: fix bug when enqueuing messages with fds asynchronously
When determining the poll events to wait for we need to take the queue
of pending messages that carry fds into account. Otherwise we might end
up not waking up if such an fd-carrying message is enqueued
asynchronously (i.e. not from a dispatch callback).

(cherry picked from commit 7b4b3a8f7b)
2024-11-29 14:26:56 +01:00
Winterhuman
09accdb68c man/systemd-system.conf: Correct "struct" to "strict" (#35364)
(cherry picked from commit 5bed97dd57)
2024-11-29 14:26:56 +01:00
Yu Watanabe
6f2483eed8 man: use MIT-0 license for example codes in daemon(7)
This page contains many short example codes. I do not think we should
add SPDX-License-Identifier for all codes.

Closes #35356.

(cherry picked from commit 6046cc3660)
2024-11-29 14:26:56 +01:00
Yu Watanabe
8cca30da53 man: update documentation about basic .netdev file handling
Follow-up for #34909 and later PRs.

(cherry picked from commit d07fbf22ed)
2024-11-29 14:26:56 +01:00
Yu Watanabe
95f9307b65 man: asorted fixes
Closes #35307.

(Changes to files with conflicts were dropped.)
(cherry picked from commit 4ebbb5bfe8)
2024-11-29 14:26:56 +01:00
Yu Watanabe
d696e5aef1 TEST-17: add reproducer for issue #35329
Without the previous commit, the test case will fail.

(cherry picked from commit 675feaf521)
2024-11-29 14:26:56 +01:00
Yu Watanabe
69a95d442f core/device: ignore ID_PROCESSING udev property on enumerate
This partially reverts the commit 405be62f05
"tree-wide: refuse enumerated device with ID_PROCESSING=1".

Otherwise, when systemd-udev-trigger.service is (re)started just before
daemon-reexec, which can be easily happen on systemd package update, then
udev database files for many devices may have ID_PROCESSING=1 property,
thus devices may not be enumerated on daemon-reexec. That causes many
units especially mount units being deactivated after daemon-reexec.

Fixes #35329.

(cherry picked from commit c4fc22c4de)
2024-11-29 14:26:56 +01:00
Yu Watanabe
ce997e944f curl-util: do not configure new io event source when the event loop is already dead
Similar to c5ecf09494, but for io event source.

Fixes #35322.

(cherry picked from commit 5b2926d941)
2024-11-29 14:26:56 +01:00
Lennart Poettering
95c20d0b62 nspawn: improve log message on bad incoming sd_notify() message
It's the PID that is wrong, not the UID/GID, be precise.

(cherry picked from commit 95116bdfd5)
2024-11-29 14:26:56 +01:00
Yu Watanabe
b30364a037 shutdown: close DM block device before issuing DM_DEV_REMOVE ioctl
Otherwise, the ioctl() may fail with EBUSY.

Follow-up for b4b66b2662.
Hopefully fixes #35243.

(cherry picked from commit b76730f3fe)
2024-11-29 14:26:56 +01:00
Zbigniew Jędrzejewski-Szmek
eb841e9b8e Undeprecate commandline params forcequotacheck, fastboot, and forcefsck
Those are historical names, but there is nothing wrong with them. The files on
/ (/fastboot, /forcefsck, and /forcequotacheck) are problematic because they
require a modification of the root file system. But the commandline params work
fine. They have the obvious advantage compared to our "modern" option that they
are much easier to type without looking up the spelling in the docs. Undeprecate
them to avoid unnecessary churn.

(cherry picked from commit 5598454a3f)
2024-11-29 14:26:56 +01:00
Lennart Poettering
3d85366ab8 userdbctl: fix counting
Fixes: #35294
(cherry picked from commit 7f8a4f12df)
2024-11-29 14:26:56 +01:00
Lennart Poettering
aed4e90456 userbdctl: show 'mapped' user range only inside of userns
Outside of userns the concept makes no sense, there cannot be users
mapped from further outside.

(cherry picked from commit e412fc5e04)
2024-11-29 14:26:56 +01:00
Lennart Poettering
ddcc0bc151 cryptenroll: it's called PKCS#11, not PKCS11
In the --help text we really should use the official spelling, just like
in the man page.

(cherry picked from commit cc6baba720)
2024-11-29 14:26:56 +01:00
Yu Watanabe
6dcb53ba0a core/service: service_add_fd_store() consumes passed fd
Without this change, the fd is closed twice on failure.

Fixes a bug introduced by dff9808a62.

Fixes #35288.

(cherry picked from commit d99198819c)
2024-11-29 14:26:56 +01:00
Lennart Poettering
38e0f618ee killall: gracefully handle processes inserted into containers via nsenter -a
"nsenter -a" doesn't migrate the specified process into the target
cgroup (it really should). Thus the cgroup will remain in a cgroup
that is (due to cgroup ns) outside our visibility. The kernel will
report the cgroup path of such cgroups as starting with "/../". Detect
that and print a reasonably error message instead of trying to resolve
that.

(cherry picked from commit f6793bbcf0)
2024-11-28 15:11:07 +01:00
Mike Yuan
3808937ff6 core/exec-invoke: suppress placeholder home only in build_environment()
Currently, get_fixed_user() employs USER_CREDS_SUPPRESS_PLACEHOLDER,
meaning home path is set to NULL if it's empty or root. However,
the path is also used for applying WorkingDirectory=~, and we'd
spuriously use the invoking user's home as fallback even if
User= is changed in that case.

Let's instead delegate such suppression to build_environment(),
so that home is proper initialized for usage at other steps.
shell doesn't actually suffer from such problem, but it's changed
too for consistency.

Alternative to #34789

(cherry picked from commit b718b86e1b)
2024-11-28 15:08:36 +01:00
Mike Yuan
e70064370d core/exec-invoke: minor cleanup for apply_working_directory() error handling
Assign exit_status at the same site where error log is emitted,
for readability.

(cherry picked from commit d911778877)
2024-11-28 15:08:34 +01:00
Mike Yuan
c6721db367 basic/user-util: split out placeholder suppression from USER_CREDS_CLEAN into its own flag
No functional change, preparation for later commits.

(cherry picked from commit eea9d3eb10)
2024-11-28 15:08:33 +01:00
Mike Yuan
3a8d7a83ff basic/user-util: introduce shell_is_placeholder() helper
(cherry picked from commit 579ce77ead)
2024-11-28 15:08:25 +01:00
Luca Boccassi
fec28cb4f9 units: add initrd directory to list of conditions for systemd-confext
systemd-sysext has the same check, but it was forgotten for confexts.
Needed to activate confexts from the ESP in the initrd.

(cherry picked from commit fe077a1a58)
2024-11-28 15:06:21 +01:00
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