1
1
mirror of https://github.com/systemd/systemd-stable.git synced 2025-03-12 08:58:20 +03:00

70141 Commits

Author SHA1 Message Date
Lennart Poettering
064de0b7cd 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 f6793bbcf0e3f0a6daa77add96183b88d5ec2117)
(cherry picked from commit 38e0f618ee26d1030a61884db3ba5c317ece3122)
2024-11-29 22:39:33 +00:00
Luca Boccassi
a95efebffc 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 fe077a1a582a43a6378ff29452a373cc7d393764)
(cherry picked from commit fec28cb4f94c033f42480b0b99ac30bd2bdae046)
2024-11-29 22:39:33 +00:00
Antonio Alvarez Feijoo
acb760fbe8 man/kernel-command-line: fix typo
(cherry picked from commit a04d42821bb5350b0ffa82834e50e9b679279854)
(cherry picked from commit 03b993a9bfd97d42ebc0b3713e583c806c89e632)
2024-11-29 22:39:33 +00:00
Antonio Alvarez Feijoo
ade617cf3d 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 2b251491debf9cab695f5f34da9908ca46f085fe)
(cherry picked from commit 4a3d55a032053525ab331e4af6f95ec2dc053ee9)
2024-11-29 22:39:33 +00:00
Lennart Poettering
e00cc22e30 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 54646b1ca95373dfa3ebe5d6e7e27deeed9e77b0)
(cherry picked from commit ff4b66be4a35fd21ef001bbf6492e3e1f837ee1c)
2024-11-29 22:39:33 +00:00
Lennart Poettering
809b265172 nspawn: --private-users-ownership= value is called 'chown', not 'own'
(cherry picked from commit bae936b418e08063b68c95f4df53c3cd4f70e881)
(cherry picked from commit bdf3f9b8f274d958befa54c95811910013b39a80)
2024-11-29 22:39:33 +00:00
Lennart Poettering
cab88476b2 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 4b20ae9a0e914e61d6bac095e5fc9664510ac03e)
(cherry picked from commit cf7b3cc18225ef8824f9cac9c88b7ea0b0dce3cd)
2024-11-29 22:39:33 +00:00
Luca Boccassi
8f24348e72 ci: link systemd-keyutil into place
The mkosi action.yaml links systemd main, and instealls an hard-coded
set of binaries. ukify now depends on the new systemd-keyutil, which
cannot be in that list. Link it manually.
2024-11-15 13:57:14 +00:00
Luca Boccassi
cf74f26bb7 test: fix test scripts filename pattern
In this branch it's testsuite-xy.foo, not TEST-XY-FOO

Follow-up for 41ebd133657cbf83b202fe132ea96c0ae2906fc8
Follow-up for e6f8282051e2066d8b32b46aba7776883e5cb953
2024-11-15 13:57:14 +00:00
Luca Boccassi
3e302689c3 Revert "socket: fix socket activation of stopped services with pinned FD store"
The test does not work on older releases, so revert the change as we
cannot validate it properly.

This reverts commit 3888d11d2da1d6b63d321cfbd93086e1222dcad5.
2024-11-15 13:57:14 +00:00
Luca Boccassi
71829dcbd3 mkosi: disable slow tests
Workaround for https://github.com/systemd/systemd/issues/34471
v255.14
2024-11-15 00:04:54 +00:00
Luca Boccassi
3471f60ff5 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)
(cherry picked from commit d8ec2770b7bb6ba9f7e3c31cb8094a2983139952)
2024-11-15 00:04:54 +00:00
Yu Watanabe
45b39f98c9 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.
(cherry picked from commit 04ee5e25a1082d4c6c0c52a154d5ad5fc959a853)
2024-11-15 00:04:54 +00:00
Yu Watanabe
2e956d0840 network-generator: drop wrong warning for rd.peerdns without value
(cherry picked from commit 2a774f064815573efc33d43dfe3548590e42e9c2)
(cherry picked from commit 56cc8acf45dbff227d1713d509bc3b71386df5d8)
2024-11-15 00:04:54 +00:00
Yu Watanabe
f9f74a067c network-generator: parse vlan ID from vlan interface name
Fixes #33954.

(cherry picked from commit e31a55edf136e777aabdf19894ee886eac47c20e)
(cherry picked from commit 4cd435ca49950c2bba86a95b500c6d239f18efe1)
2024-11-15 00:04:54 +00:00
Yu Watanabe
be571ff648 network-generator: vlan= can be specified multiple times
(cherry picked from commit 9eee6b1b3f00d46459eebefb70be50ea6af30ddb)
(cherry picked from commit f3baba94425e6ccaf7a672903148dbb2b9e022f7)
2024-11-15 00:04:54 +00:00
Lennart Poettering
74667d46ba 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)
(cherry picked from commit dbf933478f16d68b61150b845c4f897ae3b7a91a)
2024-11-15 00:04:54 +00:00
Lennart Poettering
be91329e17 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)
(cherry picked from commit 05df6c341951e40aca02cb116002b05ec2a26c16)
2024-11-15 00:04:54 +00:00
Mike Yuan
f11fa8399c shutdown: clean up sync_with_progress a bit
Also, ignore the error on caller's side.

(cherry picked from commit 758760a3610e3c6674de8a1d51b12b991eafef7c)
(cherry picked from commit 489cf962ada63e3d26d8f91b589aff170bc65317)
2024-11-15 00:04:54 +00:00
andre4ik3
8923d93768 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.

(cherry picked from commit a9d9db7f4e4a75f6dbda5c31fbbf325eff9d63b4)
2024-11-15 00:04:54 +00:00
Mike Yuan
39c2b7fd58 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)
(cherry picked from commit 018c7fb18ae8aff5414d5e74cb41fb98b72c0554)
2024-11-15 00:04:54 +00:00
Luca Boccassi
6e29d791df hwdb: update to main@{2024-11-12}
git restore -s origin/main hwdb.d/ test/hwdb.d

(cherry picked from commit 7e36a73e2e4d580b2df0f755569ca4040bfe7232)
2024-11-15 00:04:54 +00:00
Yu Watanabe
bc1320a7e2 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)
(cherry picked from commit dc44fd69b0bf2a5176ce740f9cb113c33607206f)
2024-11-15 00:04:54 +00:00
Yu Watanabe
81c84336f4 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)
(cherry picked from commit 3093ac05abcaf5a43f75ec1d5702ed226cc3ce31)
2024-11-15 00:04:54 +00:00
12paper
80efb1da3f 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)
(cherry picked from commit c89c5d04f33dbc5c6dfb67b8bc58cbd3d924b434)
2024-11-15 00:04:54 +00:00
Lidong Zhong
484d31a58d 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)
(cherry picked from commit 688eb20fdb9c4bcc6d205323f9cec119d6273169)
2024-11-15 00:04:54 +00:00
Lennart Poettering
b38386ae2b 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)
(cherry picked from commit 307a6332a63dd0f6addbc5c77d21f72ce4578070)
2024-11-15 00:04:54 +00:00
Lennart Poettering
b8a62a9f4f man: document that .path units don't care for hidden files
Fixes: #32751
(cherry picked from commit 5adc4337996f561df43c617e37ef4b157073b2e6)
(cherry picked from commit a6f9c2031666a856f137109e77c856a8e238a59b)
2024-11-15 00:04:54 +00:00
Lennart Poettering
f570985450 man: document that PrivateTmp= is unaffected by ProtectSystem=strict
Fixes: #33130
(cherry picked from commit b71173709651102081c9d8c6d6e3d2a6ef5cf17e)
(cherry picked from commit 48559a0b2207d0dfa2ef68501345624b96742a02)
2024-11-15 00:04:54 +00:00
Lennart Poettering
981ce79d9c man: don't claim SELinuxContext= only worked in the system service manager
Fixes: #34840
(cherry picked from commit ecbe9ae5a0952d968c57e59dda4a42b72e5b5e6d)
(cherry picked from commit 5a2ffc543b20fdae10c41a3df838b3ea9bae3399)
2024-11-15 00:04:54 +00:00
Lennart Poettering
d837252072 man: document the timeout applied to /usr/lib/systemd/system-shutdown/ drop-in binaries
Fixes: #34949
(cherry picked from commit af080967bad2524d2fa2fef6ba5e9fcf18d3017e)
(cherry picked from commit f792b8020b00c73a599e73b2e22b2fa7cd9b9f8b)
2024-11-15 00:04:54 +00:00
Lennart Poettering
ccc2e1ff85 run: handle gracefully if we can't find binary client-side due to perms
Fixes: #35022
(cherry picked from commit 9810899ef2f28fbb42cf659e6892b1a5074cfc83)
(cherry picked from commit 070dbe1e77fc25201a89770beb691135ce84bed1)
2024-11-15 00:04:54 +00:00
Zbigniew Jędrzejewski-Szmek
67954b4554 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)
(cherry picked from commit abd1e408203d5d445b05f4dc0ac07e35114532d1)
2024-11-15 00:04:54 +00:00
Luca Boccassi
ef1982e1e7 test: fix tool name in comment
(cherry picked from commit c53df275d512a219806a181de3bd57f02dc38dab)
(cherry picked from commit 59f5de450a99d876d3af17d6430779976d1d8af4)
2024-11-15 00:04:54 +00:00
Daan De Meyer
a8451d2be9 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)
(cherry picked from commit 9d22224e0021c15962ed153ae1c71974806a8ecc)
2024-11-15 00:04:54 +00:00
Colin Foster
cfa083d450 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)
(cherry picked from commit 4ea84288480115f7175a8cfc61d03e3a712396b8)
2024-11-15 00:04:54 +00:00
Daan De Meyer
5541b1b494 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)
(cherry picked from commit beca1de2efe7a749bfe9b35a63e6916b3a5966aa)
2024-11-15 00:04:54 +00:00
Mike Gilbert
a1099190ef 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)
(cherry picked from commit aa0aa1093d646f3efbcbc9cf09476ee032839bdd)
2024-11-15 00:04:54 +00:00
Łukasz Stelmach
79ec10aacb core: make mount(8) and swapon(8) inherit SMACK label from systemd
By default mount(8), umount(8), swapon(8) and swapoff(8) should run with
with the SMACK label inherited from systemd rather than the default one
meant for services.

Fixes: aa5ae9711ef3cd0c69b7fcfbd65bca05fb704a8a
Follow-up-for: 20bbf5ee4c6c80599a91e7a4b7474e931a27db4a
(cherry picked from commit 8144537a81c7a815af3d4c63cd8545ee17b2715d)
(cherry picked from commit 9d060fb7eb6be828c3a6a822e38dabcc627ac98d)
2024-11-15 00:04:54 +00:00
Zbigniew Jędrzejewski-Szmek
df71a5165c test-sbat: separate the two sbat sections
(cherry picked from commit 07000101eb9529c2d6b5f5402c9fe643c5f98420)
(cherry picked from commit bf681fcdf484ca01e2bb49b7b2659ad4034285df)
2024-11-15 00:04:54 +00:00
Zbigniew Jędrzejewski-Szmek
4ca8f5e68d cryptenroll,homectl,journalctl: adjust messages before qrcodes
Users will generally know what a qrcode is, so let's not treat them as dumb and
explain that it can be scanned. OTOH, we should say what the qrcode contains
and it is useful to give a hint why the users would want to scan it. Reword
messages accordingly.

(Also, don't say "to your phone", when somebody might be using a stolen phone,
or something else then a phone.)

(cherry picked from commit 10faa40ba781cf499258a3b37de02dd643822dc6)
(cherry picked from commit fefd60bf7ad9f361c85395ab38f10482f3007f15)
2024-11-15 00:04:54 +00:00
Zbigniew Jędrzejewski-Szmek
d38e29784b bsod: make message for qrcode more useful
People know what a qrcode is. We don't need to tell them to scan it.
Instead, we should say what the code contains.

While at it, rename "stream" to "f" in line with the usual style.

(cherry picked from commit abf1cae0a75ca07f09afbb4eaa9f11fc429b1d02)
(cherry picked from commit 0ec7854d4488a839740789333a8150bed4d5046a)
2024-11-15 00:04:54 +00:00
hugo303
a3614fd7bf analyze: Add times in seconds for Activating and Activated in tooltip
Print the times in seconds in the tooltip to remove the need to count
and trying to follow the lines in the svg diagram in order to see at
what times these events happen.

(cherry picked from commit f172dfddde3379319ee3a02666a7ecf11a5711f4)
(cherry picked from commit 40cab4a3873b9a3205d9a0db505ad1a6b21a95e2)
2024-11-15 00:04:54 +00:00
Mike Yuan
e0bb603e3e TEST-80-NOTIFYACCESS: don't specify --pid= if MAINPID= is provided explicitly
Otherwise, with recent additions, the MAINPIDFDID= generated by
systemd-notify would mismatch with overridden MAINPID=.

(cherry picked from commit c3ecb747f1e35f609f15fc94ad4d5e5ca0bda4a2)
(cherry picked from commit b2496d151ae093974e6ecd3a6b3299e1ba5f3e23)
2024-11-15 00:04:54 +00:00
Zbigniew Jędrzejewski-Szmek
a442374107 qrcode-util: avoid memleak in error path
(cherry picked from commit 439306da8b3962f683f5359c461d1669c070f377)
(cherry picked from commit bbda54c6717a0a079741ded27401d7de363f9d26)
2024-11-15 00:04:54 +00:00
Zbigniew Jędrzejewski-Szmek
f120804bb7 test-terminal-util: print value of colors_enabled()
This makes it easier to diagnose why colors are disabled.

(cherry picked from commit b137b2979868e2de5fb5c26e90bacee33597b8e7)
(cherry picked from commit bbdb5f97a96e5942bb055770366e0d48c3ee8540)
2024-11-15 00:04:54 +00:00
Zbigniew Jędrzejewski-Szmek
5071f6492f bsod: do not check for color support
When invoked on a running system, bsod would not print the qrcode.
The check for "color support" on stdout is pointless, since we're not
printing to stdout but to a terminal fd that is opened separately.

(cherry picked from commit 5a64c86936477ecea5cc1fb8dbc79faf522cf370)
(cherry picked from commit f23efaf96d3ac667c78cb07a895be8f72b46e808)
2024-11-15 00:04:54 +00:00
Zbigniew Jędrzejewski-Szmek
0a65d027ca qrcode-util: add debug message to show why a qrcode wasn't printed
(cherry picked from commit f0764b98e5c136cb948a8034949064f610acca24)
(cherry picked from commit b3fd2104bc0b30c45ec8c04e5cf867a7f9356cc3)
2024-11-15 00:04:54 +00:00
Zbigniew Jędrzejewski-Szmek
bf6dd565d2 sysv-generator: break long message into lines
The journal handles multi-line messages nicely, and they are easier
to read. Drop the recycling symbol, there is no circular process here,
we go from a to b and never back to a again.

(cherry picked from commit bb56c27fc81da2777cd7064a0b88ca011eced509)
(cherry picked from commit 6a4ff7a5c1591f8fe1aa3a3ab435d01e30c08b81)
2024-11-15 00:04:54 +00:00
Zbigniew Jędrzejewski-Szmek
b166ddd3dc sd-id128: mark functions as const, not pure
We would need to use pure if the funtion was getting pointers and
dereferencing them. But sd128_t is a structure and those functions
only access the parameters of the call.

(cherry picked from commit dc32b09b70c9bb20821df92ac82ace83d8a968e2)
(cherry picked from commit 3190a427b915976c9c11979acad20682e947a3c8)
2024-11-15 00:04:54 +00:00