]> git.ipfire.org Git - thirdparty/systemd.git/log
thirdparty/systemd.git
14 months agoman: add an example to (re-)apply new settings to a network interface 26668/head
Yu Watanabe [Sat, 4 Mar 2023 05:57:10 +0000 (14:57 +0900)] 
man: add an example to (re-)apply new settings to a network interface

Closes #26601.

14 months agoman: sync the default .link file in example
Yu Watanabe [Sat, 4 Mar 2023 05:33:10 +0000 (14:33 +0900)] 
man: sync the default .link file in example

14 months agoMerge pull request #26653 from poettering/tmpfile-linkable-replace
Yu Watanabe [Fri, 3 Mar 2023 17:53:59 +0000 (02:53 +0900)] 
Merge pull request #26653 from poettering/tmpfile-linkable-replace

teach link_tmpfile() to optionally replace files

14 months agoREADME: update CentOS CI URLs to the new instance
Frantisek Sumsal [Fri, 3 Mar 2023 16:57:15 +0000 (17:57 +0100)] 
README: update CentOS CI URLs to the new instance

14 months agosystemctl: explicitly cast the constants to uint64_t
Frantisek Sumsal [Fri, 3 Mar 2023 11:17:27 +0000 (12:17 +0100)] 
systemctl: explicitly cast the constants to uint64_t

Otherwise under certain conditions `va_arg()` might get garbage instead
of the expected value, i.e.:

$ sudo build-o0/systemctl disable asdfasfaf
sd_bus_message_appendv: Got uint64_t: 0
Failed to disable unit: Unit file asdfasfaf.service does not exist.

$ sudo build-o1/systemctl disable asdfasfaf
sd_bus_message_appendv: Got uint64_t: 7954875719681572864
Failed to disable unit: Invalid argument

(reproduced on an armv7hl machine)

Resolves: #26568
Follow-up to: bf1bea43f15
Related issue: https://github.com/systemd/systemd/pull/14470#discussion_r362893735

14 months agoMerge pull request #26646 from poettering/nspawn-private
Luca Boccassi [Fri, 3 Mar 2023 15:57:13 +0000 (15:57 +0000)] 
Merge pull request #26646 from poettering/nspawn-private

nspawn: ensure all mount propagation is turned off between host and container, except for the "tunnel" dir

14 months agoMerge pull request #26649 from yuwata/parse-timstamp
Luca Boccassi [Fri, 3 Mar 2023 15:56:53 +0000 (15:56 +0000)] 
Merge pull request #26649 from yuwata/parse-timstamp

test: fix and extend test for parse_timestamp()

14 months agoman: fix typo (#26655)
наб [Fri, 3 Mar 2023 14:01:51 +0000 (15:01 +0100)] 
man: fix typo (#26655)

14 months agohwdb: port to flink_tmpfile() 26653/head
Lennart Poettering [Fri, 3 Mar 2023 10:30:13 +0000 (11:30 +0100)] 
hwdb: port to flink_tmpfile()

And modernize heavily while doing so.

Fixes: #21787
(Strictly speaking, this leaves a race window open: the the system is
powered off in the short interval when we linked in the prepared hwdb
file into the dir under a temporary name and are about to rename it to
the final name, then the file might be left over after all. But this
minimizes the window so much that this shouldn't be an issue in
real-life. Key after all is that with this change we'll build up the
hwdb file under O_TMPFILE, and thus are robust to power loss during the
slow operation)

14 months agotmpfile-util: teach link_tmpfile() to optionally replace files
Lennart Poettering [Fri, 3 Mar 2023 10:27:42 +0000 (11:27 +0100)] 
tmpfile-util: teach link_tmpfile() to optionally replace files

14 months agoMerge pull request #26355 from poettering/journal-no-rtc
Lennart Poettering [Fri, 3 Mar 2023 12:13:13 +0000 (13:13 +0100)] 
Merge pull request #26355 from poettering/journal-no-rtc

journald: support ordering journal entries by boot ID if no RTC is available

14 months agotime-util: refuse non-zero gmtoff with non-UTC timezone 26649/head
Yu Watanabe [Fri, 3 Mar 2023 07:00:59 +0000 (16:00 +0900)] 
time-util: refuse non-zero gmtoff with non-UTC timezone

Also this moves the range check for gmtoff to parse_timestamp_impl(), to
address the post-merge comment:
https://github.com/systemd/systemd/pull/26409#discussion_r1118650190

14 months agotime-util: extend comment a bit
Yu Watanabe [Fri, 3 Mar 2023 06:55:42 +0000 (15:55 +0900)] 
time-util: extend comment a bit

14 months agotime-util: rename len -> tz_offset
Yu Watanabe [Fri, 3 Mar 2023 06:51:56 +0000 (15:51 +0900)] 
time-util: rename len -> tz_offset

And merge parse_timestamp_with_tz() with parse_timestamp_impl().
Addresses the post-merge comment:
https://github.com/systemd/systemd/pull/26409#discussion_r1118647440

14 months agotime-util: fix typo
Yu Watanabe [Fri, 3 Mar 2023 06:24:23 +0000 (15:24 +0900)] 
time-util: fix typo

Follow-up for 7a9afae6040af0417d893328cb44b622dcdcb94f.

14 months agomeson: extend timeout for test-time-util
Yu Watanabe [Fri, 3 Mar 2023 04:22:27 +0000 (13:22 +0900)] 
meson: extend timeout for test-time-util

The test forks so many child processes, and may hit the default time
limit on slow environment or running with sanitizers.

14 months agotest: test parse_timestamp() in various timezone
Yu Watanabe [Fri, 3 Mar 2023 03:09:59 +0000 (12:09 +0900)] 
test: test parse_timestamp() in various timezone

14 months agonspawn: disable propagation for selected host API bind mounts 26646/head
Lennart Poettering [Thu, 2 Mar 2023 18:01:39 +0000 (19:01 +0100)] 
nspawn: disable propagation for selected host API bind mounts

We bind mount two selected inodes from the host into our container.
Let's turn off propagation for that, since we just want those inodes,
nothing else.

With this change "grep master: /proc/self/mountinfo" should list only
the mount propagation "tunnel" dir, and nothing else anymore.

14 months agonspawn: disconnect mounts propagation from host on our container dir
Lennart Poettering [Thu, 2 Mar 2023 17:28:37 +0000 (18:28 +0100)] 
nspawn: disconnect mounts propagation from host on our container dir

@brauner noticed that in invoked containers the root directory is set to
still receive mounts from the host. We should disable that, and
guarantee we live in our own world, because that's what an
(nspawn-style) container *is* after all: a whole new world.

This hence mounts the container subtree to MS_PRIVATE after getting the
root dir in place. Note that this will later be set to MS_SHARED again.
The MS_PRIVATE disconnects mounts from the host, the MS_SHARED then
establishes a new peer group for mount propagation events, so that
payload service managers (such as systemd) can take benefit of
propagation further down the tree.

14 months agotest: clear tzname[] after timezone is changed
Yu Watanabe [Fri, 3 Mar 2023 03:07:25 +0000 (12:07 +0900)] 
test: clear tzname[] after timezone is changed

Fixes the issue reported in fe56f21ae3943e79ce9faeb40b79c7093c50e644.

14 months agotest: use get_timezones() to iterate all known timezones
Yu Watanabe [Fri, 3 Mar 2023 10:40:40 +0000 (19:40 +0900)] 
test: use get_timezones() to iterate all known timezones

14 months agonspawn: drop unused arg
Lennart Poettering [Thu, 2 Mar 2023 17:28:23 +0000 (18:28 +0100)] 
nspawn: drop unused arg

14 months agoMerge pull request #26628 from msizanoen1/utf8-quote-valid
Luca Boccassi [Thu, 2 Mar 2023 17:33:16 +0000 (17:33 +0000)] 
Merge pull request #26628 from msizanoen1/utf8-quote-valid

escape: Ensure that output is always valid UTF-8

14 months agomeson: Copy files with git only in true git repository
Michal Koutný [Wed, 1 Mar 2023 21:54:06 +0000 (22:54 +0100)] 
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.

14 months agoescape: add missing non-NULL parameter assertions 26628/head
msizanoen1 [Thu, 2 Mar 2023 11:37:02 +0000 (18:37 +0700)] 
escape: add missing non-NULL parameter assertions

14 months agotest-escape: Add tests for escaping bogus UTF-8 sequences
msizanoen1 [Wed, 1 Mar 2023 14:48:08 +0000 (21:48 +0700)] 
test-escape: Add tests for escaping bogus UTF-8 sequences

14 months agoescape: Ensure that output is always valid UTF-8
msizanoen1 [Wed, 1 Mar 2023 10:35:17 +0000 (17:35 +0700)] 
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.

14 months agoupdate TODO 26355/head
Lennart Poettering [Wed, 8 Feb 2023 12:40:10 +0000 (13:40 +0100)] 
update TODO

14 months agotest: add test for journals without RTC
Lennart Poettering [Wed, 8 Feb 2023 10:29:49 +0000 (11:29 +0100)] 
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.

14 months agojournal: use boot-id/timestamp info for odering entries
Lennart Poettering [Wed, 8 Feb 2023 10:10:49 +0000 (11:10 +0100)] 
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
14 months agosd-journal: track newest open journal file per boot ID
Lennart Poettering [Wed, 8 Feb 2023 10:10:32 +0000 (11:10 +0100)] 
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.

14 months agojournal-file: journal-file: extend journal header to always carry offset of most...
Lennart Poettering [Tue, 31 Jan 2023 18:20:27 +0000 (19:20 +0100)] 
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.

14 months agoMerge pull request #26627 from mrc0mmand/TEST-17-tweaks
Luca Boccassi [Wed, 1 Mar 2023 23:11:05 +0000 (23:11 +0000)] 
Merge pull request #26627 from mrc0mmand/TEST-17-tweaks

test: skip the hwdb update related tests w/ sanitizers and w/o accel

14 months agoMerge pull request #26632 from poettering/dissect-arch-nspawn
Luca Boccassi [Wed, 1 Mar 2023 22:53:16 +0000 (22:53 +0000)] 
Merge pull request #26632 from poettering/dissect-arch-nspawn

dissect: determine arch from DDI and use it for nspawn

14 months agotree-wide: error handling modernizations
Lennart Poettering [Wed, 1 Mar 2023 08:37:41 +0000 (09:37 +0100)] 
tree-wide: error handling modernizations

14 months agotest: a couple of format-related tweaks 26627/head
Frantisek Sumsal [Wed, 1 Mar 2023 10:19:02 +0000 (11:19 +0100)] 
test: a couple of format-related tweaks

14 months agotest: skip the hwdb update related tests w/ sanitizers and w/o accel
Frantisek Sumsal [Wed, 1 Mar 2023 10:06:42 +0000 (11:06 +0100)] 
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.

14 months agovirt: correctly detect QEMU emulated pSeries guests
Frantisek Sumsal [Wed, 1 Mar 2023 12:57:03 +0000 (13:57 +0100)] 
virt: correctly detect QEMU emulated pSeries guests

Resolves: #26629

14 months agonspawn: fix DDI arch → personality() propagation 26632/head
Lennart Poettering [Wed, 1 Mar 2023 15:50:12 +0000 (16:50 +0100)] 
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.

14 months agodissect: show intended architecture of a disk image
Lennart Poettering [Wed, 1 Mar 2023 15:09:57 +0000 (16:09 +0100)] 
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.

14 months agobuild(deps): bump systemd/mkosi
dependabot[bot] [Wed, 1 Mar 2023 13:16:37 +0000 (13:16 +0000)] 
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>
14 months agobuild(deps): bump github/codeql-action from 2.1.29 to 2.2.5
dependabot[bot] [Wed, 1 Mar 2023 13:16:57 +0000 (13:16 +0000)] 
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>
14 months agobuild(deps): bump actions/labeler from 4.0.1 to 4.0.2
dependabot[bot] [Wed, 1 Mar 2023 09:58:46 +0000 (09:58 +0000)] 
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>
14 months agobuild(deps): bump meson from 1.0.0 to 1.0.1 in /.github/workflows
dependabot[bot] [Wed, 1 Mar 2023 09:57:34 +0000 (09:57 +0000)] 
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>
14 months agobuild(deps): bump actions/checkout from 3.2.0 to 3.3.0
dependabot[bot] [Wed, 1 Mar 2023 09:58:39 +0000 (09:58 +0000)] 
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>
14 months agoMerge pull request #26393 from poettering/mempress
Luca Boccassi [Wed, 1 Mar 2023 12:28:12 +0000 (12:28 +0000)] 
Merge pull request #26393 from poettering/mempress

watch and act on memory pressure in most of our long-running services, including PID 1

14 months agoupdate TODO 26393/head
Lennart Poettering [Wed, 15 Feb 2023 10:27:07 +0000 (11:27 +0100)] 
update TODO

14 months agodoc: add document explaining memory pressure handling
Lennart Poettering [Thu, 23 Feb 2023 15:45:52 +0000 (16:45 +0100)] 
doc: add document explaining memory pressure handling

14 months agotest: add test for the new memory pressure unit file settings, and that they work
Lennart Poettering [Thu, 23 Feb 2023 16:41:35 +0000 (17:41 +0100)] 
test: add test for the new memory pressure unit file settings, and that they work

14 months agounits: let systemd --user manage its own memory pressure handling
Lennart Poettering [Fri, 24 Feb 2023 09:42:10 +0000 (10:42 +0100)] 
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.

14 months agopid1: add unit file settings to control memory pressure logic
Lennart Poettering [Wed, 15 Feb 2023 18:00:14 +0000 (19:00 +0100)] 
pid1: add unit file settings to control memory pressure logic

14 months agopid1: also process memory pressure events (and SIGRTMIN+18)
Lennart Poettering [Wed, 15 Feb 2023 10:22:02 +0000 (11:22 +0100)] 
pid1: also process memory pressure events (and SIGRTMIN+18)

14 months agouserdbd: hook up memory pressure and sigrtmin18
Lennart Poettering [Thu, 23 Feb 2023 09:35:00 +0000 (10:35 +0100)] 
userdbd: hook up memory pressure and sigrtmin18

14 months agonspawn: hook up memory pressure + sigrtmin+18
Lennart Poettering [Thu, 23 Feb 2023 09:31:59 +0000 (10:31 +0100)] 
nspawn: hook up memory pressure + sigrtmin+18

14 months agoportabled: hook up SIGRTMIN+18 and memory pressure
Lennart Poettering [Thu, 23 Feb 2023 09:29:52 +0000 (10:29 +0100)] 
portabled: hook up SIGRTMIN+18 and memory pressure

14 months agonetworkd: hook up SIGRTMIN+18 and memory pressure
Lennart Poettering [Thu, 23 Feb 2023 09:28:03 +0000 (10:28 +0100)] 
networkd: hook up SIGRTMIN+18 and memory pressure

14 months agoimportd: hook up memory pressure, SIGRTMIN-18 (and in fact SIGINT + SIGTERM)
Lennart Poettering [Thu, 23 Feb 2023 09:25:27 +0000 (10:25 +0100)] 
importd: hook up memory pressure, SIGRTMIN-18 (and in fact SIGINT + SIGTERM)

14 months agotimesyncd: hook up memory pressure + sigrtmin18
Lennart Poettering [Thu, 23 Feb 2023 09:22:28 +0000 (10:22 +0100)] 
timesyncd: hook up memory pressure + sigrtmin18

14 months agologind: hook up memory pressure + SIGRTMIN+18
Lennart Poettering [Thu, 23 Feb 2023 09:19:24 +0000 (10:19 +0100)] 
logind: hook up memory pressure + SIGRTMIN+18

14 months agohomed: hook up memory pressure/SIGRTMIN+18 handling
Lennart Poettering [Thu, 16 Feb 2023 11:33:18 +0000 (12:33 +0100)] 
homed: hook up memory pressure/SIGRTMIN+18 handling

14 months agoudevd: enable memory pressure/SIGRTMIN+18 logic
Lennart Poettering [Thu, 16 Feb 2023 11:30:24 +0000 (12:30 +0100)] 
udevd: enable memory pressure/SIGRTMIN+18 logic

14 months agomachined: add support for memory pressure + SIGRTMIN+18
Lennart Poettering [Wed, 15 Feb 2023 10:31:45 +0000 (11:31 +0100)] 
machined: add support for memory pressure + SIGRTMIN+18

14 months agojournald: hook up journald with the memory pressure and SIGRTMIN+18 logic
Lennart Poettering [Tue, 14 Feb 2023 17:49:50 +0000 (18:49 +0100)] 
journald: hook up journald with the memory pressure and SIGRTMIN+18 logic

14 months agoresolved: flush caches on memory pressure and support SIGRTMIN+18
Lennart Poettering [Tue, 14 Feb 2023 15:13:59 +0000 (16:13 +0100)] 
resolved: flush caches on memory pressure and support SIGRTMIN+18

14 months agoshared: add a common SIGRTMIN-18 handler
Lennart Poettering [Tue, 14 Feb 2023 15:37:05 +0000 (16:37 +0100)] 
shared: add a common SIGRTMIN-18 handler

14 months agoMerge pull request #26548 from poettering/user-record-ambient
Luca Boccassi [Tue, 28 Feb 2023 23:40:57 +0000 (23:40 +0000)] 
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

14 months agoupdate NEWS 26548/head
Lennart Poettering [Wed, 22 Feb 2023 17:43:45 +0000 (18:43 +0100)] 
update NEWS

14 months agotest: test setting ambient caps via pam_systemd.so
Lennart Poettering [Wed, 22 Feb 2023 17:05:18 +0000 (18:05 +0100)] 
test: test setting ambient caps via pam_systemd.so

14 months agopam_systemd: process the two new capabilities user records fields in pam_systemd
Lennart Poettering [Fri, 17 Feb 2023 21:49:16 +0000 (22:49 +0100)] 
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
14 months agohomectl: make the new caps field configurable via homectl
Lennart Poettering [Fri, 17 Feb 2023 21:25:47 +0000 (22:25 +0100)] 
homectl: make the new caps field configurable via homectl

14 months agouser-record: extend user records with an ambient and bounding caps set field
Lennart Poettering [Fri, 17 Feb 2023 21:22:16 +0000 (22:22 +0100)] 
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.

14 months agomkosi: add some really basic tools to default mkosi image
Lennart Poettering [Wed, 22 Feb 2023 12:04:46 +0000 (13:04 +0100)] 
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.

14 months agoMerge pull request #26608 from medhefgo/boot-arm
Luca Boccassi [Tue, 28 Feb 2023 18:48:45 +0000 (18:48 +0000)] 
Merge pull request #26608 from medhefgo/boot-arm

boot: Some ARM fixes

14 months agoman: fix typo in systemd.generator
Antonio Alvarez Feijoo [Tue, 28 Feb 2023 15:04:03 +0000 (16:04 +0100)] 
man: fix typo in systemd.generator

14 months agoboot: Provide div0 handlers for ARM 26608/head
Jan Janssen [Mon, 27 Feb 2023 17:43:07 +0000 (18:43 +0100)] 
boot: Provide div0 handlers for ARM

This is a cleaner approach to 59833064742310bfccf028b0278811ba5cff8dcf.

14 months agoboot: Fix data model detection for ARM
Jan Janssen [Mon, 27 Feb 2023 14:58:42 +0000 (15:58 +0100)] 
boot: Fix data model detection for ARM

For whatever reason, ARM does not define __ILP32__.

14 months agopsi-util: fix error handling
Lennart Poettering [Mon, 27 Feb 2023 18:02:41 +0000 (19:02 +0100)] 
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.

14 months agosd-event: handle kernels that set CONFIG_PSI_DEFAULT_DISABLED more gracefully
Lennart Poettering [Mon, 27 Feb 2023 18:05:19 +0000 (19:05 +0100)] 
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.

14 months agoMerge pull request #26605 from poettering/noxenix
Luca Boccassi [Tue, 28 Feb 2023 12:14:16 +0000 (12:14 +0000)] 
Merge pull request #26605 from poettering/noxenix

journal error message fixes

14 months agojournald: remove triplicate logging about failure to write log lines 26605/head
Lennart Poettering [Mon, 27 Feb 2023 14:48:45 +0000 (15:48 +0100)] 
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
14 months agojournald: always pass error code to logging function, even if we don't use it with %m
Lennart Poettering [Mon, 27 Feb 2023 14:47:11 +0000 (15:47 +0100)] 
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.

14 months agojournald: upgrade log message about missing mmap() support to LOG_ERR
Lennart Poettering [Mon, 27 Feb 2023 14:42:59 +0000 (15:42 +0100)] 
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.

14 months agojournald: downgrade various log messages from LOG_WARNING to LOG_INFO
Lennart Poettering [Mon, 27 Feb 2023 14:40:48 +0000 (15:40 +0100)] 
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.

14 months agojournald: start log message uppercase, like every other one around
Lennart Poettering [Mon, 27 Feb 2023 14:39:24 +0000 (15:39 +0100)] 
journald: start log message uppercase, like every other one around

14 months agojournald: make sure shall_try_append_again() logs about all return codes passed in...
Lennart Poettering [Mon, 27 Feb 2023 14:35:01 +0000 (15:35 +0100)] 
journald: make sure shall_try_append_again() logs about all return codes passed in, not just some

14 months agosystemctl: print better message if default target is masked
David Tardon [Wed, 2 Mar 2022 20:02:21 +0000 (21:02 +0100)] 
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.

14 months agotests: temporarily disable time-util failing tests
Luca Boccassi [Mon, 27 Feb 2023 18:42:04 +0000 (18:42 +0000)] 
tests: temporarily disable time-util failing tests

These are failing since https://github.com/systemd/systemd/pull/26409
disable for now

14 months agoRevert "dissect-image: don't probe swap partitions needlessly"
Lennart Poettering [Mon, 27 Feb 2023 12:45:17 +0000 (13:45 +0100)] 
Revert "dissect-image: don't probe swap partitions needlessly"

This reverts commit df4524cb3796529b435af309f5e6a2d92bcdaaa0.

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
14 months agoupdate TODO
Lennart Poettering [Mon, 27 Feb 2023 18:02:35 +0000 (19:02 +0100)] 
update TODO

14 months agotest: add coverage test for udevadm
David Tardon [Fri, 11 Nov 2022 14:28:25 +0000 (15:28 +0100)] 
test: add coverage test for udevadm

14 months agoMerge pull request #26578 from thkukuk/main
Yu Watanabe [Sat, 25 Feb 2023 22:54:11 +0000 (07:54 +0900)] 
Merge pull request #26578 from thkukuk/main

sd-login: add sd_uid_get_login_time interface #26574

14 months agorules: remove redundant duplicate comparisons
Dmitry V. Levin [Sat, 25 Feb 2023 20:00:00 +0000 (20:00 +0000)] 
rules: remove redundant duplicate comparisons

$ grep -F -n -o 'ENV{DISKSEQ}=="?*", ' rules.d/60-persistent-storage.rules
139:ENV{DISKSEQ}=="?*",
139:ENV{DISKSEQ}=="?*",
140:ENV{DISKSEQ}=="?*",
140:ENV{DISKSEQ}=="?*",

Reported-by: Alexey Gladkov <legion@kernel.org>
Fixes: 17d97d4c90f8 ("udev: create disk/by-diskseq symlink only when the device has diskseq")
Fixes: 583dc6d933d8 ("udev: also create partition /dev/disk/by-diskseq/ symlinks")
14 months agosd-login: document that result is in microseconds 26578/head
Thorsten Kukuk [Fri, 24 Feb 2023 13:51:00 +0000 (14:51 +0100)] 
sd-login: document that result is in microseconds

14 months agosd-login: add sd_uid_get_login_time interface #26574
Thorsten Kukuk [Fri, 24 Feb 2023 08:47:52 +0000 (09:47 +0100)] 
sd-login: add sd_uid_get_login_time interface #26574

14 months agotpm2-util: use compound initialization when allocating tpm2 objects
Lennart Poettering [Fri, 24 Feb 2023 17:20:50 +0000 (18:20 +0100)] 
tpm2-util: use compound initialization when allocating tpm2 objects

14 months agotree-wide: Use correct SPDX license identifier
Jan Janssen [Fri, 24 Feb 2023 18:23:01 +0000 (19:23 +0100)] 
tree-wide: Use correct SPDX license identifier

14 months agoman: add two missing commands to synopsys
Lennart Poettering [Fri, 24 Feb 2023 13:24:18 +0000 (14:24 +0100)] 
man: add two missing commands to synopsys

14 months agoupdate TODO
Lennart Poettering [Fri, 24 Feb 2023 16:08:56 +0000 (17:08 +0100)] 
update TODO

14 months agoMerge pull request #26579 from poettering/manager-env-clean-up
Lennart Poettering [Fri, 24 Feb 2023 13:11:57 +0000 (14:11 +0100)] 
Merge pull request #26579 from poettering/manager-env-clean-up

service manager env var clean-up fixes

14 months agomempool: fix tile alignment check
Lennart Poettering [Fri, 24 Feb 2023 09:41:47 +0000 (10:41 +0100)] 
mempool: fix tile alignment check

We should check alignment *after* determining the pointer points into
our pool, not before. Otherwise might might end up checking alignment of
the pointer relative to our base, even though it is taken relative to
some other base.

Follow-up for: a2b052b29f8bc141e94a4af95d1653a38a57eaeb
See: https://github.com/systemd/systemd/pull/26393#issuecomment-1442295012