1
0
mirror of https://github.com/systemd/systemd.git synced 2025-02-28 05:57:33 +03:00

68908 Commits

Author SHA1 Message Date
Nils K
76d2b8da96 Fix references to ReadOnly=
PartitionReadOnly is not a valid property and ReadOnly was meant instead.
2023-11-21 19:16:15 +00:00
Lennart Poettering
07e89d501f tpm2-util: rename json field "tpm2-pcrlock" → "tpm2_pcrlock"
We generally want to avoid to include dashes in json field names. We
historically made a mistake there which is hard to fix. But for new
fields, let's get this right. We already got it right for a bunch of new
fields, hence also make sure to use underscores rather dashes for new
additions.

This field was added post v254, and since we didn't release since then,
let's just rename it.
2023-11-21 16:58:48 +00:00
Frantisek Sumsal
7ec22d7d4b bsod: install the signal handler only just before we need it
Otherwise we might get stuck in sd_journal_wait(), since it handles
EINTR internally.

Resolves: #30084
2023-11-21 16:58:33 +00:00
Yaron Shahrabani
027b34d9fc po: Translated using Weblate (Hebrew)
Currently translated at 37.0% (84 of 227 strings)

po: Translated using Weblate (Hebrew)

Currently translated at 15.8% (36 of 227 strings)

po: Added translation using Weblate (Hebrew)

Co-authored-by: Yaron Shahrabani <sh.yaron@gmail.com>
Translate-URL: https://translate.fedoraproject.org/projects/systemd/master/he/
Translation: systemd/main
2023-11-21 14:13:56 +00:00
Yu Watanabe
54bc114fec kernel-install: do not resolve symlink in paths passed to plugins
When we resolve symlinks, paths (especially filenames) may be changed,
but plugins may expect to see the kernel added under the name specified,
not under the final name that the symlink chain resolves to.

This makes symlinks in specified paths that passed to plugins are not
resolved when neither --root nor --image specified.

Fixes #29317.
2023-11-21 12:57:00 +00:00
Arian van Putten
b0c11b5a0f
systemd.pc: Keep support for rootprefix and root_prefix (#30115)
* systemd.pc: Keep support for rootprefix and root_prefix

We dropped support for split-usr in b0d3095fd6
but kept the `rootprefix` variable in meson but ignore it to make sure we do
not break downstream builds that depend on systemd.

This is fine because we had logic in our meson.build that rootprefix and prefix need to be the
same when split-usr=false.

However we never had this logic in our systemd.pc.in file. This leads to a nasty breaking problem
downstream. Many packages [0,1,2]  (there might be more!) rely on overriding rootprefix or root_prefix when calling pkg-config to configure where
to install systemd units. This is because before split-usr we installed units in rootprefix. Setting prefix
on the pkg-config file didn't work. Even when split-usr=false people had to set rootprefix to install units
in the right position.

E.g. they have a line like:

    systemdunitdir = systemd.get_variable(pkgconfig: 'systemdsystemunitdir', pkgconfig_define: ['rootprefix', systemd_root_prefix])

With b0d3095fd6 landing
This would mean all these downstream packages need to be patched to use `prefix` next to `rootprefix`.
(Both need to be kept to keep backwards compat with using older versions of systemd).

This puts a big burden on downstream packages.
Instead we should not break the existing behaviour and keep the old behaviour of systemd.pc.in around.
I've changed systemd.pc.in such that either setting prefix, rootprefix or root_prefix will all have
the same effect. This way we do not break any downstream packages.

- [0](caa788b37f/meson.build (L464))
- [1](https://gitlab.freedesktop.org/mobile-broadband/ModemManager/-/blame/main/meson.build#L204)
- [2](49cdb468c2/src/daemon/systemd/system/meson.build (L1))
2023-11-21 12:51:08 +00:00
Florian Schmaus
f380473edf systemctl-show: only show available memory if it was artifically limited
Systemd 255 changed the semantic of MemoryAvailable with 3565c709f587 ("cgroup:
Fix MemoryAvailable= by considering physical memory"). If there is no
artificial constraint, it will hold the amount of available physical memory,
while it previously contained UINT64_MAX.

While the change in MemoryAvailable's semantic is sensible, it causes
`systemctl status` to always display the available physical memory. This
creates a lot of noise, especially since systemd recently started to also show
the "peak" memory. For example

$ systemctl status foo
…
Memory: 3.9G (available: 21.2G peak: 5.4G)
…

However, while peak memory is a unit specific value, the available memory, when
not derived from artificial memory limits, is a generic property that holds the
same value for all units that are not under memory accounting
constraints. Displaying it under those circumstances can therefore be
considered being noisy.

Before 3565c709f587 ("cgroup: Fix MemoryAvailable= by considering physical
memory") "systemctl status" would only show the available memory if it was
caused by a explicit memory limitation due to MemoryHigh or MemoryMax.

This commit restores this behavior by supressing displaying the available
memory if is is merely the available phyiscal memory. For example

$ systemctl status foo
…
Memory: 3.9G (peak: 5.4G)
…

Fixes #30102.
2023-11-21 12:50:07 +00:00
Lennart Poettering
dc78603a58 TODO: register more mime types 2023-11-21 13:12:50 +01:00
Yu Watanabe
e00f1dda7d in-addr: improve log message for e.g. [DHCPv4] AllowList=
Closes #30107.
2023-11-21 09:32:50 +00:00
Luca Boccassi
b595fd62e4 man: correct version tags in systemd-vmspawn
We ended up merging some changes earlier

Fixes https://github.com/systemd/systemd/issues/30091
2023-11-21 09:01:40 +09:00
Luca Boccassi
fe68cbda00
Merge pull request #30108 from mrc0mmand/packit-testing-farm
packit: run tests on Fedora Rawhide via Testing Farm
2023-11-20 23:02:42 +00:00
Frantisek Sumsal
04dc383b40 packit: run tests on Fedora Rawhide via Testing Farm
Let's utilize the full power of Packit and run some tests with the just
built RPMs. This makes use of the Fedora infrastructure provided by
the Testing Farm project [0][1].

With the current configuration, the `tests` job runs tests from the
Fedora tests repository [2] in a very similar fashion like Ubuntu CI
does, just with different metadata all around it. ATTOW there are only
two tests, which are wrappers around unit tests and integration tests;
the latter one currently runs only nspawn-based tests, since there's no
KVM on the test VMs, and, for now, I'd like to see how well the infra is
going to manage our upstream traffic and how stable the whole thing is
end up being before increasing the work load.

[0] https://docs.testing-farm.io/Testing%20Farm/0.1/index.html
[1] https://packit.dev/docs/configuration/upstream/tests
[2] https://src.fedoraproject.org/tests/systemd
2023-11-20 21:45:59 +01:00
Frantisek Sumsal
f258a76332 test: don't use ddebug() before it's defined
I'm pretty sure this is not the only case, but it's the one I recently
noticed. Even though we call ddebug() from a function, that function is
called before ddebug() is defined, resulting in the same issue as if we
called just ddebug() in its place, i.e.:

..//test-functions: line 276: ddebug: command not found
2023-11-20 21:26:17 +01:00
Frantisek Sumsal
6162caa288 test: move a couple of binaries to the BASICTOOLS array
As they're not optional.
2023-11-20 21:26:14 +01:00
Frantisek Sumsal
8ddbd9e078 test: support NO_BUILD=yes on Fedora 2023-11-20 21:26:11 +01:00
Frantisek Sumsal
b54bc139ae test: make the LOOKS_LIKE_* variables proper booleans 2023-11-20 21:26:08 +01:00
Luca Boccassi
38c2583984
Merge pull request #30074 from YHNdnzj/hibernate-unsupported
hibernate-util: if asked to bypass space check, accept the case when we have no swap space at all
2023-11-20 15:46:21 +00:00
Yu Watanabe
dd59d5e57c libsystemd-network: introduce triple_timestamp_from_cmsg()
Follow-up for 461ef3981f1a45150b6e2047bb3c789ac50ba3cf.

This should fix compile error on x32 and riscv32.
2023-11-20 15:44:23 +00:00
Luca Boccassi
cd92a5a7d2
Merge pull request #30104 from poettering/pcrlock-empty-object-fix
pcrlock: fix for parsing corrupted userspace event log
2023-11-20 15:43:25 +00:00
Luca Boccassi
ad470cc155
Merge pull request #30095 from yuwata/kernel-install-exit-code
kernel-install: exit code
2023-11-20 13:33:06 +00:00
Luca Boccassi
42c1df5e2d test: add simple test case for invalid userspace log records 2023-11-20 14:27:38 +01:00
Lennart Poettering
c7da9e9a65 pcrlock: check for embedded NUL bytes 2023-11-20 14:27:38 +01:00
Lennart Poettering
8c8d2cfd4b pcrlock: make sure we don't choke on empty records
Follow-up for a43427013949

CID#1523832
2023-11-20 14:27:27 +01:00
Vito Caputo
165fb931ea man: add note about journald forwarding being sync
This footgun should at least be documented, if there's not going
to be a shortcut setting to establish the async `journalctl
--follow` equivalent.

Fixes: https://github.com/systemd/systemd/issues/2815
2023-11-20 12:00:36 +00:00
Martin Joerg
42c50fdf31 man: Fix example for systemd-run 2023-11-20 11:58:44 +00:00
Luca Boccassi
514c70eb52 test-condition: skip group test during Debian package build
The group names won't match in a package build chroot and the test might
fail, skip it.

https://buildd.debian.org/status/fetch.php?pkg=systemd&arch=hppa&ver=255%7Erc2-2&stamp=1700424353&raw=0
2023-11-20 10:51:42 +00:00
Yu Watanabe
0c710e0377 test: add test cases about plugin exit code 2023-11-20 10:17:54 +09:00
Yu Watanabe
e42931b0ac kernel-install: propagate failures in plugins
This fixes a regression introduced by
42551ea7e923bac5df12b20e3e735a487d38dcd5.

In the shell script version, plugin failures are propagated to the
caller. But after the commit, failures in plugins are logged, but never
propagated as the exit code of the execution.

Fixes #30087.
2023-11-20 09:55:53 +09:00
onenowy
a3f5976ded hwdb: add Predator PHN16-71
enable microphone mute, predator sense button and fix the keyboard backlight up button changes display brightness.
2023-11-19 12:39:59 +00:00
Yu Watanabe
4bf4b439b2
Merge pull request #30070 from weblate/weblate-systemd-master
Translations update from Fedora Weblate
2023-11-18 22:59:20 +09:00
Mike Yuan
0e8f09561f
hibernate-util: if asked to bypass space check, accept the case when we
have no swap space at all

But I shall still recommend
https://chrisdown.name/2018/01/02/in-defence-of-swap.html
to everyone ;-)

Fixes #30083
2023-11-18 20:15:42 +08:00
Mike Yuan
500ec22d09
hibernate-util: report no available swap as no enough swap space
Otherwise, ENOENT or ENXIO may be directly returned as error through
bus.

Should help to generate clearer error message for #30083.
2023-11-18 20:15:41 +08:00
Yu Watanabe
fbf946ce22 network/dhcp: actually refuse to assign DHCP option when an invalid string is passed
Prompted by #30029.
2023-11-18 11:19:17 +00:00
Luca Boccassi
67df554047
Merge pull request #30078 from yuwata/test-setup-logging
test: call test_setup_logging()
2023-11-18 11:18:22 +00:00
Charles Lee
32bf76c50c po: Translated using Weblate (Chinese (Simplified) (zh_CN))
Currently translated at 100.0% (227 of 227 strings)

Co-authored-by: Charles Lee <lchopn@gmail.com>
Translate-URL: https://translate.fedoraproject.org/projects/systemd/master/zh_CN/
Translation: systemd/main
2023-11-18 12:18:18 +01:00
Weblate
e5c6aa7230 po: Update translation files
Updated by "Update PO files to match POT (msgmerge)" hook in Weblate.

Co-authored-by: Weblate <noreply@weblate.org>
Translate-URL: https://translate.fedoraproject.org/projects/systemd/master/
Translation: systemd/main
2023-11-18 12:18:18 +01:00
Charles Lee
36552cacce po: Translated using Weblate (Chinese (Simplified) (zh_CN))
Currently translated at 100.0% (227 of 227 strings)

Co-authored-by: Charles Lee <lchopn@gmail.com>
Translate-URL: https://translate.fedoraproject.org/projects/systemd/master/zh_CN/
Translation: systemd/main
2023-11-18 12:18:18 +01:00
Yu Watanabe
5acea42501 fuzz: always call fuzz_setup_logging() 2023-11-18 03:04:27 +09:00
Yu Watanabe
965040d811 test: always call test_setup_logging() 2023-11-18 03:04:27 +09:00
Luca Boccassi
48bfc6791d mkosi ci: enable jammy-proposed
This will bring in the fix for rawhide/tumbleweed builds (new libsolv
capable of handling zstd). If all goes well it will migrate to jammy
proper in a week and it can be reverted
2023-11-17 14:14:18 +00:00
Christian Hesse
111df871ee NEWS: drop duplicate 'of' 2023-11-17 21:55:32 +09:00
Luca Boccassi
41113e1c10
Merge pull request #30064 from bluca/unbork_direct_io
loop-util: restart loop_configure and reopen FD when O_DIRECT fails
2023-11-17 09:40:09 +00:00
Luca Boccassi
91b3e889ed
Merge pull request #30066 from bluca/test
fsck/shell test fixes
2023-11-17 09:39:48 +00:00
Luca Boccassi
dcddb2fc6b test: avoid asserting on default user shell
In some build environments it might differ:

/* test_get_user_creds_one("root", "root", 0, 0, "/root", "/usr/bin/bash") */
got "root", 0, 0, "/root", "/bin/sh": Success
Assertion 'path_equal(rshell, shell)' failed at src/test/test-user-util.c:345, function test_get_user_creds_one(). Aborting.

https://buildd.debian.org/status/fetch.php?pkg=systemd&arch=alpha&ver=255%7Erc2-1&stamp=1700147880&raw=0
2023-11-16 23:17:31 +00:00
Luca Boccassi
210dcd8fc6 test: minix fsck not found on alpha
It seems even this one is not everywhere, so relax the test:

/* test_fsck_exists */
Assertion 'fsck_exists_for_fstype("minix") == 1' failed at src/test/test-path-util.c:624, function test_fsck_exists(). Aborting.

https://buildd.debian.org/status/fetch.php?pkg=systemd&arch=alpha&ver=255%7Erc2-1&stamp=1700147880&raw=0
2023-11-16 23:01:46 +00:00
Luca Boccassi
d579c42e9d loop-util: use the right error variable in log_debug_errno after fd_reopen 2023-11-16 21:13:10 +00:00
Luca Boccassi
f5bb0a3163 loop-util: restart loop_configure and reopen FD when O_DIRECT fails
On kernel 5.10.178, when a squashfs file is stored on an EXT4 filesystem
backed by a dm-crypt volume, dissecting fails:

$ SYSTEMD_LOG_LEVEL=debug systemd-dissect /var/foo/bar.raw
Opened '/var/foo/bar.raw' in O_RDONLY access mode, with O_DIRECT enabled.
Couldn't find any partition table to derive sector size of.
loop2: Acquired exclusive lock.
Could not enable direct IO mode, proceeding in buffered IO mode.
Successfully acquired /dev/loop2, devno=7:2, nr=2, diskseq=87
Opened /dev/loop2 (fd=3, whole_block_devnum=7:2, diskseq=87).
      Name: bar.raw
      Size: 67.2M
 Sec. Size: 512
     Arch.: n/a

Successfully forked off '(sd-dissect)' as PID 4110.
Mounting /proc/self/fd/3 (squashfs) on /tmp/dissect-Zk3K5F (MS_RDONLY|MS_NODEV "")...
Failed to mount /proc/self/fd/3 (type squashfs) on /tmp/dissect-Zk3K5F (MS_RDONLY|MS_NODEV ""): Input/output error
Failed to mount dissected image: Input/output error
Failed to read /etc/hostname of image: No such file or directory
/etc/machine-id file of image is empty.
Failed to read has-init-system boolean: Input/output error
(sd-dissect) failed with exit status 1.
Failed to acquire image metadata: Input/output error

The kernel shows I/O errors:

kernel: blk_update_request: I/O error, dev loop2, sector 0 op 0x0:(READ) flags 0x800 phys_seg 1 prio class 0
kernel: SQUASHFS error: Failed to read block 0x0: -5
kernel: unable to read squashfs_super_block

This is independent of a particular filesystem and can be reproduced
reliably in my setup, starting from freshly formatted disks.

Instead of continuing when O_DIRECT fails, start over the setup
process without the flag, including opening a new FD, to make the
kernel happy.
2023-11-16 21:12:40 +00:00
Luca Boccassi
905dd9d6e6
Merge pull request #30055 from YHNdnzj/logind-handle-action
logind-action: several cleanups
2023-11-16 16:04:37 +00:00
Lennart Poettering
face0d0efa update TODO 2023-11-16 13:46:55 +01:00
Lennart Poettering
3c28ebace0 update TODO 2023-11-16 13:34:25 +01:00