Commit Graph
62865 Commits
Author SHA1 Message Date
Yu Watanabe 31c35de1a4 test: add tests for error code propagation from mkdir_xyz() 2023-03-03 22:58:49 +09:00
Yu Watanabe c1b1492a94 mkdir: fix error code on failure
Before:
====
$ systemctl edit network.target
Failed to create directories for "/etc/systemd/system/network.target.d/override.conf": No such file or directory
====

After:
====
$ systemctl edit network.target
Failed to create directories for "/etc/systemd/system/network.target.d/override.conf": Permission denied
====

Fixes #26652.
2023-03-03 22:52:09 +09:00
Lennart Poettering 16a9ad557d Merge pull request #26355 from poettering/journal-no-rtc
journald: support ordering journal entries by boot ID if no RTC is available
2023-03-03 13:13:13 +01:00
Lennart Poettering 11875a98e4 nspawn: drop unused arg 2023-03-02 20:54:31 +01:00
Luca Boccassi a41ac8ac40 Merge pull request #26628 from msizanoen1/utf8-quote-valid
escape: Ensure that output is always valid UTF-8
2023-03-02 17:33:16 +00:00
Michal Koutný edd84b8e4b meson: Copy files with git only in true git repository
When mkosi is run from git-worktree(1), the .git is not a repository
directory but a textfile pointing to the real git dir
(e.g. /home/user/systemd/.git/worktrees/systemd-worktree). This git dir
is not bind mounted into build environment and it fails with:

> fatal: not a git repository: /home/user/systemd/.git/worktrees/systemd-worktree
> test/meson.build:190:16: ERROR: Command `/usr/bin/env -u GIT_WORK_TREE /usr/bin/git --git-dir=/root/src/.git ls-files ':/test/dmidecode-dumps/*.bin'` failed with status 128.

There is already a fallback to use shell globbing instead of ls-files,
use it with git worktrees as well.
2023-03-02 15:04:40 +00:00
msizanoen1 0b82a6fa5d escape: add missing non-NULL parameter assertions 2023-03-02 19:55:47 +07:00
msizanoen1 582843ee37 test-escape: Add tests for escaping bogus UTF-8 sequences 2023-03-02 19:55:47 +07:00
msizanoen1 00f57157f3 escape: Ensure that output is always valid UTF-8
This ensures that shell string escape operations will not produce output
with invalid UTF-8 from the input by escaping invalid UTF-8 data as if
they were single byte characters.
2023-03-02 19:55:12 +07:00
Lennart Poettering c48f13d8e1 update TODO 2023-03-02 10:18:24 +01:00
Lennart Poettering 4601c7aa8f test: add test for journals without RTC
This adds a test for checking we can safely order boot IDs via the
timestamp of their most recent known entry. It takes a set of journal
files (supplied by a user) and that are partially corrupted, and ensures
we get a clear, defined order of boot IDs out of it.
2023-03-02 10:18:24 +01:00
Lennart Poettering 262299dccb journal: use boot-id/timestamp info for odering entries
With this we should be able to determine on systems without
battery-backed RTC even during early boot whether a boot is supposed to
be earlier than another.

Fixes: #662
2023-03-02 10:03:15 +01:00
Lennart Poettering 34af74946e sd-journal: track newest open journal file per boot ID
This is useful to later order boot IDs by time, addressing #662.

Basically, this determines the most recently written for each boot ID
from all currently open journal files. This is then stored in a hash
table (which maps the boot ID to a prioq of journal files, ordered by
their timestamp).

Why is this useful? If systems lack a battery-buffered RTC they will
initially have a system clock basically starting at zero. Later they
might acquire an NTP fix, or at least roughly monotonic time via a
stored timestamp. Thus, log entries written early during boot tend to be
badly timestamped, and those written most recently are likely to have
most accurate timestamps. Thus, if we track the newest entry for each
boot ID we likely can order the boot ID via their timestamps.

This commit only add the logic to maintain the hash table/prioq. It
doesn't actually make use of this information for ordering yet. A later
patch adds that.
2023-03-02 10:03:15 +01:00
Lennart Poettering 206f0f397e journal-file: journal-file: extend journal header to always carry offset of most recent entry
This way we can quickly find the most recent entry, without searching or
traversing entry array chains.

This is relevant later, as it it allows us to quickly determine the most
recent timestamps of each journal file, in a roughly atomic way.
2023-03-02 10:03:15 +01:00
Luca Boccassi 7a67afe331 Merge pull request #26627 from mrc0mmand/TEST-17-tweaks
test: skip the hwdb update related tests w/ sanitizers and w/o accel
2023-03-01 23:11:05 +00:00
Luca Boccassi f05f2334ee Merge pull request #26632 from poettering/dissect-arch-nspawn
dissect: determine arch from DDI and use it for nspawn
2023-03-01 22:53:16 +00:00
Lennart Poettering 1406bd66e4 tree-wide: error handling modernizations 2023-03-01 22:52:55 +00:00
Frantisek Sumsal 90169eb92a test: a couple of format-related tweaks 2023-03-01 17:53:55 +01:00
Frantisek Sumsal ea91b45e0e test: skip the hwdb update related tests w/ sanitizers and w/o accel
systemd-hwdb update is an expensive operation by itself, and when
running with sanitizers and in a VM without acceleration this cost is
exacerbated even further, making the test run for a very long time.

For example, in the daily CentOS CI ppc64le job with ASan+UBSan one
systemd-hwdb update takes more than 7 minutes; in the regular Arch job
with KVM it takes over 2 minutes.

Since the hwdb update is also tested in other places (like
TEST-01-BASIC and the test-hwdb meson test), let's skip it if we detect
we run with sanitizers and with plain QEMU.
2023-03-01 17:53:55 +01:00
Frantisek Sumsal 8c7a6c742a virt: correctly detect QEMU emulated pSeries guests
Resolves: #26629
2023-03-01 16:52:27 +00:00
Lennart Poettering 4c27749b8c nspawn: fix DDI arch → personality() propagation
Since quite a while the propagation from the DDI arch into the
personality() wasn't hooked up anymore. Let's fix that: when the DDI has
a determined arch, automatically propagate this into the personality.
2023-03-01 17:08:28 +01:00
Lennart Poettering 2348043f17 dissect: show intended architecture of a disk image
We already determine the architecture of disk images and make a choice,
and store it per partition. Let's make this accessible globally.
2023-03-01 17:08:28 +01:00
dependabot[bot] 1016c8ad94 build(deps): bump systemd/mkosi
Bumps [systemd/mkosi](https://github.com/systemd/mkosi) from 1d131062066fe7b5a83b87319b4464b186adbb1c to d13ff85610c6fb01a2fff0a8187729ebe4a05595.
- [Release notes](https://github.com/systemd/mkosi/releases)
- [Changelog](https://github.com/systemd/mkosi/blob/main/NEWS.md)
- [Commits](https://github.com/systemd/mkosi/compare/1d131062066fe7b5a83b87319b4464b186adbb1c...d13ff85610c6fb01a2fff0a8187729ebe4a05595)

---
updated-dependencies:
- dependency-name: systemd/mkosi
  dependency-type: direct:production
...

Signed-off-by: dependabot[bot] <support@github.com>
2023-03-01 14:58:47 +00:00
dependabot[bot] ef1e3104a6 build(deps): bump github/codeql-action from 2.1.29 to 2.2.5
Bumps [github/codeql-action](https://github.com/github/codeql-action) from 2.1.29 to 2.2.5.
- [Release notes](https://github.com/github/codeql-action/releases)
- [Changelog](https://github.com/github/codeql-action/blob/main/CHANGELOG.md)
- [Commits](https://github.com/github/codeql-action/compare/ec3cf9c605b848da5f1e41e8452719eb1ccfb9a6...32dc499307d133bb5085bae78498c0ac2cf762d5)

---
updated-dependencies:
- dependency-name: github/codeql-action
  dependency-type: direct:production
  update-type: version-update:semver-minor
...

Signed-off-by: dependabot[bot] <support@github.com>
2023-03-01 14:58:18 +00:00
dependabot[bot] 17d4646ed8 build(deps): bump actions/labeler from 4.0.1 to 4.0.2
Bumps [actions/labeler](https://github.com/actions/labeler) from 4.0.1 to 4.0.2.
- [Release notes](https://github.com/actions/labeler/releases)
- [Commits](https://github.com/actions/labeler/compare/e54e5b338fbd6e6cdb5d60f51c22335fc57c401e...5c7539237e04b714afd8ad9b4aed733815b9fab4)

---
updated-dependencies:
- dependency-name: actions/labeler
  dependency-type: direct:production
  update-type: version-update:semver-patch
...

Signed-off-by: dependabot[bot] <support@github.com>
2023-03-01 13:14:53 +00:00
dependabot[bot] 31a14e4d3e build(deps): bump meson from 1.0.0 to 1.0.1 in /.github/workflows
Bumps [meson](https://github.com/mesonbuild/meson) from 1.0.0 to 1.0.1.
- [Release notes](https://github.com/mesonbuild/meson/releases)
- [Commits](https://github.com/mesonbuild/meson/compare/1.0.0...1.0.1)

---
updated-dependencies:
- dependency-name: meson
  dependency-type: direct:production
  update-type: version-update:semver-patch
...

Signed-off-by: dependabot[bot] <support@github.com>
2023-03-01 13:14:26 +00:00
dependabot[bot] 7afcf8b193 build(deps): bump actions/checkout from 3.2.0 to 3.3.0
Bumps [actions/checkout](https://github.com/actions/checkout) from 3.2.0 to 3.3.0.
- [Release notes](https://github.com/actions/checkout/releases)
- [Changelog](https://github.com/actions/checkout/blob/main/CHANGELOG.md)
- [Commits](https://github.com/actions/checkout/compare/755da8c3cf115ac066823e79a1e1788f8940201b...ac593985615ec2ede58e132d2e21d2b1cbd6127c)

---
updated-dependencies:
- dependency-name: actions/checkout
  dependency-type: direct:production
  update-type: version-update:semver-minor
...

Signed-off-by: dependabot[bot] <support@github.com>
2023-03-01 13:13:04 +00:00
Luca Boccassi adee01643d Merge pull request #26393 from poettering/mempress
watch and act on memory pressure in most of our long-running services, including PID 1
2023-03-01 12:28:12 +00:00
Lennart Poettering 3d092a70b2 update TODO 2023-03-01 09:43:24 +01:00
Lennart Poettering a4b13ae1be doc: add document explaining memory pressure handling 2023-03-01 09:43:24 +01:00
Lennart Poettering 3b7101183c test: add test for the new memory pressure unit file settings, and that they work 2023-03-01 09:43:24 +01:00
Lennart Poettering 9d03637404 units: let systemd --user manage its own memory pressure handling
Let's make things systematic: the per-user and the per-system manager
should manage their own memory pressure, as they are, well, managers of
things.

This is particularly relevant and the per-user service manager should
watch its own "init.scope" subcgroup, instead of the main service unit
cgroup, and hence $MEMORY_PRESSURE_WATCH as set by the per-system
service manager would simply be wrong.
2023-03-01 09:43:24 +01:00
Lennart Poettering 6bb0084204 pid1: add unit file settings to control memory pressure logic 2023-03-01 09:43:23 +01:00
Lennart Poettering 29e6b0c171 pid1: also process memory pressure events (and SIGRTMIN+18) 2023-03-01 09:43:23 +01:00
Lennart Poettering ee32689f39 userdbd: hook up memory pressure and sigrtmin18 2023-03-01 09:43:23 +01:00
Lennart Poettering 988851b6f9 nspawn: hook up memory pressure + sigrtmin+18 2023-03-01 09:43:23 +01:00
Lennart Poettering fdeb10b87f portabled: hook up SIGRTMIN+18 and memory pressure 2023-03-01 09:43:23 +01:00
Lennart Poettering 6daaeafe93 networkd: hook up SIGRTMIN+18 and memory pressure 2023-03-01 09:43:23 +01:00
Lennart Poettering 82fa9f28f9 importd: hook up memory pressure, SIGRTMIN-18 (and in fact SIGINT + SIGTERM) 2023-03-01 09:43:23 +01:00
Lennart Poettering 6e6e45076b timesyncd: hook up memory pressure + sigrtmin18 2023-03-01 09:43:23 +01:00
Lennart Poettering 92e1a20998 logind: hook up memory pressure + SIGRTMIN+18 2023-03-01 09:43:23 +01:00
Lennart Poettering 11d78c31e4 homed: hook up memory pressure/SIGRTMIN+18 handling 2023-03-01 09:43:23 +01:00
Lennart Poettering 79d905af0a udevd: enable memory pressure/SIGRTMIN+18 logic 2023-03-01 09:43:23 +01:00
Lennart Poettering 4bdb8bd9ec machined: add support for memory pressure + SIGRTMIN+18 2023-03-01 09:43:23 +01:00
Lennart Poettering 375c34d8cd journald: hook up journald with the memory pressure and SIGRTMIN+18 logic 2023-03-01 09:43:23 +01:00
Lennart Poettering bb3517181b resolved: flush caches on memory pressure and support SIGRTMIN+18 2023-03-01 09:43:23 +01:00
Lennart Poettering 9b2c161481 shared: add a common SIGRTMIN-18 handler 2023-03-01 09:43:23 +01:00
Luca Boccassi 45db7b53e7 Merge pull request #26548 from poettering/user-record-ambient
add ambient/bounding set fields to user records, and set CAP_WAKE_ALARM by default for local regular user sessions
2023-02-28 23:40:57 +00:00
Lennart Poettering a1012609f3 update NEWS 2023-02-28 21:42:29 +01:00
Lennart Poettering d7fce219ae test: test setting ambient caps via pam_systemd.so 2023-02-28 21:42:29 +01:00