Commit graph

62845 commits

Author SHA1 Message Date
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](1d13106206...d13ff85610)

---
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](ec3cf9c605...32dc499307)

---
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](e54e5b338f...5c7539237e)

---
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](755da8c3cf...ac59398561)

---
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
Lennart Poettering bf1b9ae487 pam_systemd: process the two new capabilities user records fields in pam_systemd
And also: by default, for the systemd-user service and for local
sessions (i.e. those assigned to a seat): let's imply CAP_WAKE_SYSTEM
for them by default. Yes, let's pass one specific capability by default to local
unprivileged users.

The capability services exactly once purpose: to allow system wake-up
from suspend via alarm clocks, hence is relatively limited in focus. By
adding this tools such as GNOME's Alarm Clock app can simply allocate a
CLOCK_REALTIME_ALARM (or ask systemd --user to do this) timer and it
will wake up the system as necessary.

Note that systemd --user will not pass the ambient caps on by default,
so even with this change, individual services need to use
AmbientCapabilities= to pass this on to the individual programs.

Fixes: #17564 #21382
2023-02-28 21:42:29 +01:00
Lennart Poettering fada2c75a4 homectl: make the new caps field configurable via homectl 2023-02-28 21:42:29 +01:00
Lennart Poettering 8e1bc689de user-record: extend user records with an ambient and bounding caps set field
In particular the ambieht caps field is useful: we can use it later to
pass caps such as CAP_WAKE_ALARM to regular users on login.
2023-02-28 21:42:29 +01:00
Lennart Poettering b65a4aec05 mkosi: add some really basic tools to default mkosi image
"passwd" and "pscap" are extremely useful to debug basic OS behaviour,
and tiny. So let's add them to our default development images, just to
save us some headaches.
2023-02-28 21:42:29 +01:00
Luca Boccassi 9ea9865361
Merge pull request #26608 from medhefgo/boot-arm
boot: Some ARM fixes
2023-02-28 18:48:45 +00:00
Antonio Alvarez Feijoo 835b781fc1 man: fix typo in systemd.generator 2023-02-28 15:37:29 +00:00
Jan Janssen ce7180b680 boot: Provide div0 handlers for ARM
This is a cleaner approach to 5983306474.
2023-02-28 14:37:05 +01:00
Jan Janssen d14eb24925 boot: Fix data model detection for ARM
For whatever reason, ARM does not define __ILP32__.
2023-02-28 14:37:05 +01:00
Lennart Poettering 90ec8ebe33 psi-util: fix error handling
We checked ERRNO_IS_NOT_SUPPORTED on a possible positive non-error code,
which isn't right.

Fix that. Also add caching, since we are about to call this more often.
2023-02-28 12:16:59 +00:00
Lennart Poettering 9897f5ddea sd-event: handle kernels that set CONFIG_PSI_DEFAULT_DISABLED more gracefully
If CONFIG_PSI_DEFAULT_DISABLED is set in the kernel, then the PSI files
will be there, and you can open them, but read()/write() will fail.
Which is terrible, since that happens so late. But anyway, handle this
gracefully.
2023-02-28 12:15:13 +00:00
Luca Boccassi 68a5526734
Merge pull request #26605 from poettering/noxenix
journal error message fixes
2023-02-28 12:14:16 +00:00
Lennart Poettering 0631aabdf5 journald: remove triplicate logging about failure to write log lines
Let's log exactly at one place about failed writing of log lines to
journal file: in shall_try_append_again().

Then, if we decide to suppress a retry-after-vacuum because we already
vacuumed anyway then say this explicitly as "supressed rotation",
because that's what we do here.

This removes triplicate logging about the same error, and logs exactly
once, plus optional one "suppressed rotation" message. (plus more debug
output). The triplicate logging was bad in particular because it had no
understanding of the actual error codes and just showed generic UNIX
error strings ("Not a XENIX named type file"). By relying on
shall_try_append_again() to do all logging we now get very clean error
strings for all conditions.

Fixes: #26496
2023-02-28 09:32:42 +01:00
Lennart Poettering 32b0678c86 journald: always pass error code to logging function, even if we don't use it with %m
We always want to pass the error code along with the log call, so that
it can add it to structured logging, even if the format string does not
contain %m.
2023-02-28 09:32:42 +01:00
Lennart Poettering 8253cb35fa journald: upgrade log message about missing mmap() support to LOG_ERR
in this case we really cannot proceed and fail. Let's log about this
loudly, since we simply fail the operation to write anything.
2023-02-28 09:32:42 +01:00
Lennart Poettering ab84a03fda journald: downgrade various log messages from LOG_WARNING to LOG_INFO
None of these conditions are real issues, but they can simply happen
because we just swtched from /run to /var as backend for logging and
there are old files from different boots with different systemd versions
and so on.

Let's not make more noise than necessary: still log, but not consider it
a warning, but just some normal thing.

We are handling these issues safely after all: by rotating and starting
anew, i.e. there's no reason to be concerned.
2023-02-28 09:32:42 +01:00
Lennart Poettering 07a06f5d0c journald: start log message uppercase, like every other one around 2023-02-28 09:32:42 +01:00
Lennart Poettering d6df3bfbb8 journald: make sure shall_try_append_again() logs about all return codes passed in, not just some 2023-02-28 09:32:42 +01:00
David Tardon 7c78a19322 systemctl: print better message if default target is masked
If the default target is masked, `systemctl get-default` prints

  Failed to get default target: Operation not possible due to RF-kill

That's a bit too cryptic, so let's make it clear what's actually
happening.

Fixes #26589.
2023-02-28 06:45:15 +09:00
Luca Boccassi fe56f21ae3 tests: temporarily disable time-util failing tests
These are failing since https://github.com/systemd/systemd/pull/26409
disable for now
2023-02-27 21:37:58 +00:00
Lennart Poettering 41aca66ba4 Revert "dissect-image: don't probe swap partitions needlessly"
This reverts commit df4524cb37.

This commit is just wrong. The thing is that we *don't* know
automatically that the partition contains a swap image, because it could
be encrypted.

Hence revert.

Fixes: #26595
2023-02-27 19:11:17 +01:00