]> git.ipfire.org Git - thirdparty/systemd.git/log
thirdparty/systemd.git
21 months agoresolvectl: add basic ANSI markup to --help text 31141/head
Lennart Poettering [Wed, 31 Jan 2024 14:56:58 +0000 (15:56 +0100)] 
resolvectl: add basic ANSI markup to --help text

Underline the sections, as we nowadays do.

21 months agoresolvectl: add JSON output support for "resolvectl query"
Lennart Poettering [Wed, 31 Jan 2024 10:28:12 +0000 (11:28 +0100)] 
resolvectl: add JSON output support for "resolvectl query"

It's easy to add. Let's do so.

This only covers record lookups, i.e. with the --type= switch.

The higher level lookups are not covered, I opted instead to print a
message there to use --type= instead.

I am a bit reluctant to defining a new JSON format for the high-level
lookups, hence I figured for now a helpful error is good enough, that
points people to the right use.

Fixes: #29755
21 months agotest: use a dropin for the journald snippet
Frantisek Sumsal [Wed, 31 Jan 2024 09:45:13 +0000 (10:45 +0100)] 
test: use a dropin for the journald snippet

The original way of appending to /etc/systemd/journald.conf doesn't work
anymore, since we no longer ship the default configs in /etc/.

21 months agoman: always install bootctl
Franck Bui [Wed, 31 Jan 2024 07:33:22 +0000 (08:33 +0100)] 
man: always install bootctl

Since dedb925eafee8214ae565b861dfacfc02085f158 /usr/bin/bootctl is always built
so does its man page.

21 months agoMerge pull request #30847 from keszybz/some-docs-updates
Lennart Poettering [Wed, 31 Jan 2024 10:09:56 +0000 (11:09 +0100)] 
Merge pull request #30847 from keszybz/some-docs-updates

Some docs updates

21 months agoupdate TODO
Lennart Poettering [Wed, 31 Jan 2024 09:10:49 +0000 (10:10 +0100)] 
update TODO

21 months agomkosi: Stop using file provides with CentOS/Fedora
Daan De Meyer [Tue, 30 Jan 2024 21:36:12 +0000 (22:36 +0100)] 
mkosi: Stop using file provides with CentOS/Fedora

dnf5 does not download filelists metadata by default anymore as this
consists of a pretty big chunk of the repository metadata. Let's make
sure the filelists metadata doesn't have to be downloaded by dnf5 by
removing any usage of file provides from our package lists.

21 months agohomed: Add InhibitSuspend() method
Adrian Vovk [Sun, 21 Jan 2024 01:29:40 +0000 (20:29 -0500)] 
homed: Add InhibitSuspend() method

This returns an FD that can be used to temporarily inhibit the automatic
locking on system suspend behavior of homed. As long as the FD is open,
LockAllHomes() won't lock that home directory on suspend. This allows
desktop environments to implement custom more complicated behavior

21 months agoMerge pull request #31039 from AdrianVovk/slice-freeze-thaw
Lennart Poettering [Wed, 31 Jan 2024 08:48:05 +0000 (09:48 +0100)] 
Merge pull request #31039 from AdrianVovk/slice-freeze-thaw

Rework slice recursive freeze/thaw

21 months agoMerge pull request #30968 from poettering/per-user-creds
Lennart Poettering [Wed, 31 Jan 2024 08:47:12 +0000 (09:47 +0100)] 
Merge pull request #30968 from poettering/per-user-creds

per-user encrypted credentials

21 months agomeson: fix installation of html doc aliases
Franck Bui [Tue, 30 Jan 2024 08:34:17 +0000 (09:34 +0100)] 
meson: fix installation of html doc aliases

Apparently since 9289e093ae6fd5484f9119e1ee07d1dffe37cd10, "ln_s" takes
*absolute* paths only.

21 months agomeson: don't install broken tmpfiles config with sshd?confdir == 'no'
Frantisek Sumsal [Tue, 30 Jan 2024 10:25:19 +0000 (11:25 +0100)] 
meson: don't install broken tmpfiles config with sshd?confdir == 'no'

20-systemd-ssh-generator.conf expands SSHCONFDIR, which is bogus when we
build with -Dsshconfdir=no. Similarly, avoid expanding SSHDCONFDIR in
20-systemd-userdb.conf when building with -Dsshconfdir=no.

Follow-up 6c7fc5d5f2.

21 months agotest: explicitly set nsec3-iterations to 0
Frantisek Sumsal [Tue, 30 Jan 2024 15:27:58 +0000 (16:27 +0100)] 
test: explicitly set nsec3-iterations to 0

knot v3.2 and later does this by default. knot v3.1 still has the default set to
10, but it also introduced a warning that the default will be changed to 0 in
later versions, so it effectively complains about its own default, which then
fails the config check. Let's just set the value explicitly to zero to avoid
that.

~# knotc --version
knotc (Knot DNS), version 3.1.6
~# grep nsec3-iterations test/knot-data/knot.conf || echo nope
nope
~# knotc -c /build/test/knot-data/knot.conf conf-check
warning: config, policy[auto_rollover_nsec3].nsec3-iterations defaults to 10, since version 3.2 the default becomes 0
Configuration is valid

Follow-up to 0652cf8e7b.

21 months agocore: Fail to start/stop/reload unit if frozen 31039/head
Adrian Vovk [Wed, 24 Jan 2024 00:50:21 +0000 (19:50 -0500)] 
core: Fail to start/stop/reload unit if frozen

Previously, unit_{start,stop,reload} would call the low-level cgroup
unfreeze function whenever a unit was started, stopped, or reloaded. It
did so with no error checking. This call would ultimately recurse up the
cgroup tree, and unfreeze all the parent cgroups of the unit, unless an
error occurred (in which case I have no idea what would happen...)

After the freeze/thaw rework in a previous commit, this can no longer
work. If we recursively thaw the parent cgroups of the unit, there may
be sibling units marked as PARENT_FROZEN which will no longer actually
have frozen parents. Fixing this is a lot more complicated than simply
disallowing start/stop/reload on a frozen unit

Fixes https://github.com/systemd/systemd/issues/15849

21 months agocore: Rework recursive freeze/thaw
Adrian Vovk [Sun, 21 Jan 2024 20:05:20 +0000 (15:05 -0500)] 
core: Rework recursive freeze/thaw

This commit overhauls the way freeze/thaw works recursively:

First, it introduces new FreezerActions that are like the existing
FREEZE and THAW but indicate that the action was initiated by a parent
unit. We also refactored the code to pass these FreezerActions through
the whole call stack so that we can make use of them. FreezerState was
extended similarly, to be able to differentiate between a unit that's
frozen manually and a unit that's frozen because a parent is frozen.

Next, slices were changed to check recursively that all their child
units can be frozen before it attempts to freeze them. This is different
from the previous behavior, that would just check if the unit's type
supported freezing at all. This cleans up the code, and also ensures
that the behavior of slices corresponds to the unit's actual ability
to be frozen

Next, we make it so that if you FREEZE a slice, it'll PARENT_FREEZE
all of its children. Similarly, if you THAW a slice it will PARENT_THAW
its children.

Finally, we use the new states available to us to refactor the code
that actually does the cgroup freezing. The code now looks at the unit's
existing freezer state and the action being requested, and decides what
next state is most appropriate. Then it puts the unit in that state.
For instance, a RUNNING unit with a request to PARENT_FREEZE will
put the unit into the PARENT_FREEZING state. As another example, a
FROZEN unit who's parent is also FROZEN will transition to
PARENT_FROZEN in response to a request to THAW.

Fixes https://github.com/systemd/systemd/issues/30640
Fixes https://github.com/systemd/systemd/issues/15850

21 months agoMerge pull request #31109 from yuwata/nspawn-resolve-network-interface-before-move
Lennart Poettering [Tue, 30 Jan 2024 16:09:11 +0000 (17:09 +0100)] 
Merge pull request #31109 from yuwata/nspawn-resolve-network-interface-before-move

nspawn: resolve network interface names before move to container namespace

21 months agoMerge pull request #31120 from YHNdnzj/strv-env-non-pure
Lennart Poettering [Tue, 30 Jan 2024 16:08:49 +0000 (17:08 +0100)] 
Merge pull request #31120 from YHNdnzj/strv-env-non-pure

env-util: drop _pure_ for strv_env_get_n

21 months agoMerge pull request #31124 from keszybz/various-small-tweaks
Lennart Poettering [Tue, 30 Jan 2024 16:08:21 +0000 (17:08 +0100)] 
Merge pull request #31124 from keszybz/various-small-tweaks

Various small tweaks

21 months agoupdate TODO 30968/head
Lennart Poettering [Mon, 15 Jan 2024 14:03:09 +0000 (15:03 +0100)] 
update TODO

21 months agoman: document new user-scoped credentials
Lennart Poettering [Tue, 16 Jan 2024 15:56:12 +0000 (16:56 +0100)] 
man: document new user-scoped credentials

21 months agotest: add integration test for per-user creds
Lennart Poettering [Tue, 16 Jan 2024 14:22:31 +0000 (15:22 +0100)] 
test: add integration test for per-user creds

21 months agocreds: go via IPC service when unprivileged and trying to access services
Lennart Poettering [Tue, 16 Jan 2024 10:05:22 +0000 (11:05 +0100)] 
creds: go via IPC service when unprivileged and trying to access services

Fixes: #30191
21 months agocreds-util: add IPC client wrapper for new varlink apis
Lennart Poettering [Wed, 17 Jan 2024 20:45:12 +0000 (21:45 +0100)] 
creds-util: add IPC client wrapper for new varlink apis

21 months agocreds: allow Varlink clients to encrypt/decrypt their own credentials without polkit...
Lennart Poettering [Wed, 17 Jan 2024 20:44:01 +0000 (21:44 +0100)] 
creds: allow Varlink clients to encrypt/decrypt their own credentials without polkit authentication

Now that we have the concept of scoped credentials, we can allow
unprivileged clients to encrypt/decrypt them as longed as they are
scoped to them.

21 months agocreds-tool: add --user/--uid= to operate with scoped credentials
Lennart Poettering [Mon, 15 Jan 2024 16:43:15 +0000 (17:43 +0100)] 
creds-tool: add --user/--uid= to operate with scoped credentials

21 months agocreds-util: add a concept of "user-scoped" credentials
Lennart Poettering [Mon, 15 Jan 2024 16:36:44 +0000 (17:36 +0100)] 
creds-util: add a concept of "user-scoped" credentials

So far credentials are a concept for system services only: to encrypt or
decrypt credential you must be privileged, as only then you can access
the TPM and the host key.

Let's break this up a bit: let's add a "user-scoped" credential, that
are specific to users. Internally this works by adding another step to
the acquisition of the symmetric encryption key for the credential: if a
"user-scoped" credential is used we'll generate an symmetric encryption
key K as usual, but then we'll use it to calculate

    K' = HMAC(K, flags || uid || machine-id || username)

and then use the resulting K' as encryption key instead. This basically
includes the (public) user's identity in the encryption key, ensuring
that only if the right user credentials are specified the correct key
can be acquired.

21 months agoMerge pull request #31121 from YHNdnzj/notify-man
Lennart Poettering [Tue, 30 Jan 2024 16:04:31 +0000 (17:04 +0100)] 
Merge pull request #31121 from YHNdnzj/notify-man

notify: a few cleanups

21 months agoMerge pull request #31126 from poettering/sleep-error-msg
Lennart Poettering [Tue, 30 Jan 2024 16:04:15 +0000 (17:04 +0100)] 
Merge pull request #31126 from poettering/sleep-error-msg

sleep: change log level of some log messages

21 months agovarlink: add short comment that the log message is checked in test
Yu Watanabe [Mon, 29 Jan 2024 02:07:17 +0000 (11:07 +0900)] 
varlink: add short comment that the log message is checked in test

Follow-up for 038e4554627c610ae6799d74f9f4bce530d7c283.

21 months agosocket-util: check for sysconf() error before using value
Luca Boccassi [Tue, 30 Jan 2024 12:16:26 +0000 (12:16 +0000)] 
socket-util: check for sysconf() error before using value

Otherwise -1 will be casted to uint32_t. Found by coverity.

CID#1533989

Follow-up for 7e8aa5c2eebd86efe9bbf36d8db1e98964611aab

21 months agoconf-parser: fix OOM check
Antonio Alvarez Feijoo [Tue, 30 Jan 2024 10:59:54 +0000 (11:59 +0100)] 
conf-parser: fix OOM check

21 months agonspawn: resolve network interface names before moving to container network namespace 31109/head
Yu Watanabe [Sat, 27 Jan 2024 18:27:41 +0000 (03:27 +0900)] 
nspawn: resolve network interface names before moving to container network namespace

To escape a kernel issue fixed by
https://github.com/torvalds/linux/commit/8e15aee621618a3ee3abecaf1fd8c1428098b7ef,
let's resolve provided interface names earlier, and adjust the interface
name pairs with the result.

Fixes #31104.

21 months agosd-device: use new interface name resolvers
Yu Watanabe [Sat, 27 Jan 2024 18:35:06 +0000 (03:35 +0900)] 
sd-device: use new interface name resolvers

21 months agosd-netlink: unify network interface name getter and resolvers
Yu Watanabe [Sat, 27 Jan 2024 17:49:22 +0000 (02:49 +0900)] 
sd-netlink: unify network interface name getter and resolvers

This makes rtnl_resolve_interface() always check the existence of the
resolved interface, which previously did not when a decimal formatted
ifindex is provided, e.g. "1" or "42".

21 months agosleep: upgrade fatal log message to LOG_ERR 31126/head
Lennart Poettering [Tue, 30 Jan 2024 10:32:56 +0000 (11:32 +0100)] 
sleep: upgrade fatal log message to LOG_ERR

21 months agosleep: upgrade some unexpected errors to LOG_WARNING log messages
Lennart Poettering [Tue, 30 Jan 2024 10:32:41 +0000 (11:32 +0100)] 
sleep: upgrade some unexpected errors to LOG_WARNING log messages

21 months agosleep: remove redundant debug log message
Lennart Poettering [Tue, 30 Jan 2024 10:31:56 +0000 (11:31 +0100)] 
sleep: remove redundant debug log message

21 months agosleep: add mising error message
Lennart Poettering [Tue, 30 Jan 2024 10:14:42 +0000 (11:14 +0100)] 
sleep: add mising error message

21 months agoman/networkd.conf: remove strange comment 31124/head
Zbigniew Jędrzejewski-Szmek [Thu, 25 Jan 2024 20:31:30 +0000 (21:31 +0100)] 
man/networkd.conf: remove strange comment

Does anyone even read those pages‽

21 months agopstore: align table
Zbigniew Jędrzejewski-Szmek [Thu, 25 Jan 2024 17:34:08 +0000 (18:34 +0100)] 
pstore: align table

21 months agojournald: inline one variable declaration
Zbigniew Jędrzejewski-Szmek [Thu, 25 Jan 2024 15:38:28 +0000 (16:38 +0100)] 
journald: inline one variable declaration

21 months agoshared/pretty-print: inline one more variable declaration
Zbigniew Jędrzejewski-Szmek [Thu, 14 Dec 2023 09:58:19 +0000 (10:58 +0100)] 
shared/pretty-print: inline one more variable declaration

21 months agoshared/pretty-print: use normal else-if cascade
Zbigniew Jędrzejewski-Szmek [Thu, 14 Dec 2023 09:57:05 +0000 (10:57 +0100)] 
shared/pretty-print: use normal else-if cascade

This is not a hot path, but it seems silly to evalute subsequent branches,
which can never match once one has matched. Also, it makes the code harder to
read, because the reader has to first figure out that only one branch can
match.

21 months agobsod: do not use STRLEN
Zbigniew Jędrzejewski-Szmek [Fri, 8 Dec 2023 08:56:43 +0000 (09:56 +0100)] 
bsod: do not use STRLEN

The compiler optimizes strlen away, so we can use the simplest form that is
type safe and more natural. STRLEN is only for array initialization.

21 months agobasic/alloc-util: drop unnecessary parens
Zbigniew Jędrzejewski-Szmek [Tue, 23 Jan 2024 12:01:43 +0000 (13:01 +0100)] 
basic/alloc-util: drop unnecessary parens

By definition, a parameter cannot contain a comma because commas
are used to delimit parameters. So we also don't need to use parens
when the use site is delimited by commas.

21 months agoenv-util: drop _pure_ for strv_env_get_n 31120/head
Mike Yuan [Mon, 29 Jan 2024 17:50:47 +0000 (01:50 +0800)] 
env-util: drop _pure_ for strv_env_get_n

This function calls getenv() internally, making it
non-pure, as envvars can change between two calls
even if passed arguments are the same.

21 months agoenv-util: don't use strlen_ptr if known non-NULL
Mike Yuan [Mon, 29 Jan 2024 17:50:01 +0000 (01:50 +0800)] 
env-util: don't use strlen_ptr if known non-NULL

21 months agonotify: warn if notify msg specified along with --booted 31121/head
Mike Yuan [Mon, 29 Jan 2024 18:12:15 +0000 (02:12 +0800)] 
notify: warn if notify msg specified along with --booted

21 months agonotify: don't exit silently when --exec but no msg
Mike Yuan [Mon, 29 Jan 2024 18:07:35 +0000 (02:07 +0800)] 
notify: don't exit silently when --exec but no msg

Before this commit, if --exec is used but no message shall
be sent, we silently ignore --exec and exit, which is pretty
surprising. Therefore, let's emit clear error instead.

21 months agoman/systemd-notify: don't say "the latter" if more than 2 options
Mike Yuan [Mon, 29 Jan 2024 17:59:59 +0000 (01:59 +0800)] 
man/systemd-notify: don't say "the latter" if more than 2 options

21 months agonotify: if execve() failed, always show original error
Mike Yuan [Sun, 28 Jan 2024 16:17:09 +0000 (00:17 +0800)] 
notify: if execve() failed, always show original error

21 months agonotify: deduplicate ppid handling
Mike Yuan [Sun, 28 Jan 2024 16:15:00 +0000 (00:15 +0800)] 
notify: deduplicate ppid handling

21 months agonotify: minor modernizations
Mike Yuan [Sun, 28 Jan 2024 16:14:21 +0000 (00:14 +0800)] 
notify: minor modernizations

21 months agoMerge pull request #31106 from poettering/bus-creds-pidref
Luca Boccassi [Mon, 29 Jan 2024 19:19:17 +0000 (19:19 +0000)] 
Merge pull request #31106 from poettering/bus-creds-pidref

sd-bus: port "sd_bus_creds" object to pidfds and use it everywhere

21 months agoupdate TODO 31106/head
Lennart Poettering [Fri, 26 Jan 2024 17:42:33 +0000 (18:42 +0100)] 
update TODO

21 months agoman: document the new APIs
Lennart Poettering [Fri, 26 Jan 2024 18:00:43 +0000 (19:00 +0100)] 
man: document the new APIs

21 months agotree-wide: port various things over to new pidref helpers
Lennart Poettering [Fri, 26 Jan 2024 17:41:24 +0000 (18:41 +0100)] 
tree-wide: port various things over to new pidref helpers

THis not only mkaes a lot of code shorter, but also safer, as we pin the
clients via a pidfd.

21 months agobus-util: add helper for getting PidRef structs from bus
Lennart Poettering [Fri, 26 Jan 2024 17:40:09 +0000 (18:40 +0100)] 
bus-util: add helper for getting PidRef structs from bus

This adds two helpers: one for extracting a PidRef from an sd_bus_creds
object, and one from doing this from and sd_bus_message object.

21 months agosd-bus: tighten rules on sd_bus_query_sender_creds() a bit
Lennart Poettering [Fri, 26 Jan 2024 17:01:25 +0000 (18:01 +0100)] 
sd-bus: tighten rules on sd_bus_query_sender_creds() a bit

Let's always derive credentials from a bus name or a conneciton fd if we
can, because they pin things.

Let's not go via PID really, because it's always racy to do so.

Note that this doesn't change much, since we wouldn't use such augmented
data for auth anyway (because it will be masked in the
sd_bus_creds.augmented mask as untrusted). But still, let's prefer
trusted data over untrusted data.

21 months agosd-bus: also read supplementary gids from bus driver
Lennart Poettering [Fri, 26 Jan 2024 16:09:02 +0000 (17:09 +0100)] 
sd-bus: also read supplementary gids from bus driver

21 months agosd-bus: add pidfd to the sd_bus_creds structure
Lennart Poettering [Fri, 26 Jan 2024 15:46:09 +0000 (16:46 +0100)] 
sd-bus: add pidfd to the sd_bus_creds structure

Let's continue with the pidfd'ification, and include pidfd in our
sd_bus_creds structure tha tracks a peers credentials.

21 months agosocket-util: start SO_PEERGROUP loop with sysconf(_SC_NGROUPS_MAX), too
Lennart Poettering [Mon, 29 Jan 2024 09:18:30 +0000 (10:18 +0100)] 
socket-util: start SO_PEERGROUP loop with sysconf(_SC_NGROUPS_MAX), too

We do this for getgroups_malloc() hence we should do this here too,
after all whether we do it for a socket peer or for ourselves doesn't
make too much of a difference.

21 months agoFix bug where systemd-tmpfiles gets stuck on fifos in tmp.
r-vdp [Mon, 29 Jan 2024 10:21:12 +0000 (11:21 +0100)] 
Fix bug where systemd-tmpfiles gets stuck on fifos in tmp.

Fixes #30690.

21 months agoMerge pull request #31108 from yuwata/core-trivial-cleanups
Mike Yuan [Sat, 27 Jan 2024 18:08:54 +0000 (02:08 +0800)] 
Merge pull request #31108 from yuwata/core-trivial-cleanups

core: several trivial cleanups

21 months agocore/service: introduce SERVICE_STATE_WITH_{MAIN,CONTROL}_PROCESS() 31108/head
Yu Watanabe [Fri, 26 Jan 2024 07:11:10 +0000 (16:11 +0900)] 
core/service: introduce SERVICE_STATE_WITH_{MAIN,CONTROL}_PROCESS()

21 months agocore/socket: introduce SOCKET_STATE_WITH_PROCESS() helper function
Yu Watanabe [Fri, 26 Jan 2024 06:23:20 +0000 (15:23 +0900)] 
core/socket: introduce SOCKET_STATE_WITH_PROCESS() helper function

21 months agocore/unit: update outdated comment
Yu Watanabe [Thu, 25 Jan 2024 09:21:41 +0000 (18:21 +0900)] 
core/unit: update outdated comment

Follow-up for 37eb258e91c780fd6fe5e44110abd9da71dce6de.

21 months agounits: Order pcrlock services after systemd-remounts-fs.service
Daan De Meyer [Fri, 26 Jan 2024 10:29:35 +0000 (11:29 +0100)] 
units: Order pcrlock services after systemd-remounts-fs.service

These write to /var and as such need to wait until after the rootfs
has been remounted read-write.

21 months agotimesyncd: make the transmit timestamp in requests fully random
David Venhoek [Fri, 26 Jan 2024 09:40:03 +0000 (10:40 +0100)] 
timesyncd: make the transmit timestamp in requests fully random

This improves security against off-path attackers, and avoids leaking
the current system time.

21 months agotest: use lstat() instead of stat(follow_symlinks=False)
Frantisek Sumsal [Fri, 26 Jan 2024 13:28:20 +0000 (14:28 +0100)] 
test: use lstat() instead of stat(follow_symlinks=False)

This makes the test compatible with Python 3.9, as the follow_symlinks
keyword was introduced in Python 3.10.

21 months agoMerge pull request #31105 from mrc0mmand/test-nspawn
Luca Boccassi [Fri, 26 Jan 2024 21:13:15 +0000 (21:13 +0000)] 
Merge pull request #31105 from mrc0mmand/test-nspawn

test: set -ex separately

21 months agoupdate TODO
Lennart Poettering [Fri, 26 Jan 2024 20:42:39 +0000 (21:42 +0100)] 
update TODO

21 months agotest: clean up the code a bit 31105/head
Frantisek Sumsal [Fri, 26 Jan 2024 17:09:09 +0000 (18:09 +0100)] 
test: clean up the code a bit

21 months agopackit: add a libarchive runtime dependency too
Frantisek Sumsal [Fri, 26 Jan 2024 10:08:26 +0000 (11:08 +0100)] 
packit: add a libarchive runtime dependency too

Addresses https://github.com/systemd/systemd/pull/31075#issuecomment-1911117026:

[   40.039232] testsuite-50.sh[624]: ++ systemd-dissect --make-archive /tmp/tmp.RZEq3t/minimal_0.raw
[   40.044745] testsuite-50.sh[625]: ++ sha256sum
[   40.066693] systemd-dissect[621]: libarchive.so.13 is not installed: libarchive.so.13: cannot open shared object file: No such file or directory
[   40.068577] systemd-dissect[621]: Archive support not available (compiled without libarchive, or libarchive not installed?).
[   40.092242] systemd-dissect[624]: libarchive.so.13 is not installed: libarchive.so.13: cannot open shared object file: No such file or directory
[   40.095716] systemd-dissect[624]: Archive support not available (compiled without libarchive, or libarchive not installed?).
[   40.100510] testsuite-50.sh[538]: + test e3b0c44298fc1c149afbf4c8996fb92427ae41e4649b934ca495991b7852b855 '!=' ''
[   40.100510] testsuite-50.sh[538]: + test e3b0c44298fc1c149afbf4c8996fb92427ae41e4649b934ca495991b7852b855 = e3b0c44298fc1c149afbf4c8996fb92427ae41e4649b934ca495991b7852b855
[   40.108249] testsuite-50.sh[627]: + tar t
[   40.113791] testsuite-50.sh[626]: + systemd-dissect --make-archive /tmp/tmp.RZEq3t/minimal_0.raw
[   40.120300] testsuite-50.sh[628]: + grep etc/os-release
[   40.176288] systemd-dissect[626]: libarchive.so.13 is not installed: libarchive.so.13: cannot open shared object file: No such file or directory
[   40.180273] systemd-dissect[626]: Archive support not available (compiled without libarchive, or libarchive not installed?).
[   40.184017] testsuite-50.sh[627]: tar: This does not look like a tar archive
[   40.185430] testsuite-50.sh[627]: tar: Exiting with failure status due to previous errors

Follow-up for b68f4ca.

21 months agotest: fix the container ID check
Frantisek Sumsal [Fri, 26 Jan 2024 14:44:39 +0000 (15:44 +0100)] 
test: fix the container ID check

It never worked, but the fail was masked by missing set -e, see the
previous commit.

Also, throw env into the test container and dump the environment on
container start, to make potential failures easier to debug.

21 months agoman: add working example for sd_bus_set_watch_bind()
Luca Boccassi [Wed, 13 Dec 2023 14:01:17 +0000 (14:01 +0000)] 
man: add working example for sd_bus_set_watch_bind()

This example is able to deal with D-Bus going away and reappearing,
like on soft-reboot, so link it in both manpages.

21 months agotest: set -ex separately
Frantisek Sumsal [Fri, 26 Jan 2024 14:29:49 +0000 (15:29 +0100)] 
test: set -ex separately

We call the entrypoint.sh script using `bash entrypoint.sh`, so -ex from
the shebang won't be used in that case. Whoopsie.

21 months agocore: add SYSTEMD_VERITY_SHARING env var for local development
Luca Boccassi [Tue, 23 Jan 2024 16:01:31 +0000 (16:01 +0000)] 
core: add SYSTEMD_VERITY_SHARING env var for local development

When running an image that cannot be mounted (e.g.: key missing intentionally
for development purposes), there's a retry loop that takes some time
and slows development down. Add an env var to disable it.

21 months agoMerge pull request #31095 from bluca/test_time_tz
Daan De Meyer [Fri, 26 Jan 2024 08:02:34 +0000 (09:02 +0100)] 
Merge pull request #31095 from bluca/test_time_tz

test: unset TZ before timezone-sensitive unit tests are run

21 months agoMerge pull request #31048 from YHNdnzj/fstab-modernization
Daan De Meyer [Fri, 26 Jan 2024 08:01:19 +0000 (09:01 +0100)] 
Merge pull request #31048 from YHNdnzj/fstab-modernization

fstab-util/generator: a few cleanups/improvements

21 months agosd-bus: fix exiting event loop when sd_bus_set_exit_on_disconnect is used
Luca Boccassi [Thu, 25 Jan 2024 20:31:39 +0000 (20:31 +0000)] 
sd-bus: fix exiting event loop when sd_bus_set_exit_on_disconnect is used

If sd_bus_set_exit_on_disconnect is used and the bus is part of an event
loop, and the D-Bus connection goes away (e.g.: soft-reboot), sd-bus
will always exit() the program instead of returning from the loop, as
the reference to the event is removed before it is checked.

21 months agoMerge pull request #31092 from DaanDeMeyer/auto-features
Daan De Meyer [Fri, 26 Jan 2024 07:59:16 +0000 (08:59 +0100)] 
Merge pull request #31092 from DaanDeMeyer/auto-features

mkosi: Use --auto-features=enabled for meson

21 months agoCI: set TZ= in a unit test run to ensure tests don't break 31095/head
Luca Boccassi [Fri, 26 Jan 2024 00:25:04 +0000 (00:25 +0000)] 
CI: set TZ= in a unit test run to ensure tests don't break

21 months agotest: unset TZ before timezone-sensitive unit tests are run
Luca Boccassi [Fri, 26 Jan 2024 00:22:38 +0000 (00:22 +0000)] 
test: unset TZ before timezone-sensitive unit tests are run

Some tests have hard-coded results that need to match, and change if
the caller has a timezone set via the TZ= environment variable, as it
is the case during reproducible build tests. Unset it.

21 months agomkosi: Use --auto-features=enabled for meson 31092/head
Daan De Meyer [Thu, 25 Jan 2024 14:37:51 +0000 (15:37 +0100)] 
mkosi: Use --auto-features=enabled for meson

21 months agoMerge pull request #31083 from yuwata/core-several-cleanups
Yu Watanabe [Thu, 25 Jan 2024 20:30:01 +0000 (05:30 +0900)] 
Merge pull request #31083 from yuwata/core-several-cleanups

core: several cleanups

21 months agoMerge pull request #31090 from poettering/bpf-lsm-rename
Luca Boccassi [Thu, 25 Jan 2024 18:20:25 +0000 (18:20 +0000)] 
Merge pull request #31090 from poettering/bpf-lsm-rename

rename a bunch of bpf related .c/.h files, and functions there in to make naming of systematic

21 months agomkosi: Fix formatting in build script
Daan De Meyer [Thu, 25 Jan 2024 14:37:27 +0000 (15:37 +0100)] 
mkosi: Fix formatting in build script

21 months agodissect: add --make-archive option to convert DDI to tarball
Lennart Poettering [Wed, 24 Jan 2024 11:28:41 +0000 (12:28 +0100)] 
dissect: add --make-archive option to convert DDI to tarball

21 months agoman: Document ranges for distributions config files and local config files
Daan De Meyer [Wed, 24 Jan 2024 11:24:11 +0000 (12:24 +0100)] 
man: Document ranges for distributions config files and local config files

Let's recommend that config files and drop-ins in /usr use the range
0-49 and config files in /etc and /run use the range 50-99 so that
files in /run and /etc will generally always override files from
/usr.

21 months agofstab-generator: drop unapplicable options for /usr/ too 31048/head
Mike Yuan [Mon, 22 Jan 2024 16:00:46 +0000 (00:00 +0800)] 
fstab-generator: drop unapplicable options for /usr/ too

We already drop these for /sysroot/usr/ in parse_fstab
(1e9b2e4fdd8d04e3fbfadbc0b92dc138c819c221). Let's make
things consistent, and do the same for /usr/ too (after
switch-root).

21 months agofstab-generator: modernize write_extra_dependencies
Mike Yuan [Mon, 15 Jan 2024 17:04:44 +0000 (01:04 +0800)] 
fstab-generator: modernize write_extra_dependencies

21 months agofstab-generator: add missing assertions
Mike Yuan [Tue, 23 Jan 2024 14:40:17 +0000 (22:40 +0800)] 
fstab-generator: add missing assertions

21 months agofstab-generator: drop unneeded initialization
Mike Yuan [Mon, 22 Jan 2024 16:33:51 +0000 (00:33 +0800)] 
fstab-generator: drop unneeded initialization

21 months agofstab-util: clean up fstab_filter_options
Mike Yuan [Sat, 20 Jan 2024 14:16:52 +0000 (22:16 +0800)] 
fstab-util: clean up fstab_filter_options

Let's get rid of the confusing goto so that the flow is more
straightforward. Note that the behavior is slightly changed:
previously, ret_filtered would be an empty string even if
the original opts passed in is NULL, but after this commit
it returns NULL too. But this shouldn't matter, as all our
code handles NULL opts gracefully.

21 months agofstab-generator: drop assertions for mount opts
Mike Yuan [Thu, 25 Jan 2024 16:47:23 +0000 (00:47 +0800)] 
fstab-generator: drop assertions for mount opts

fstab_filter_options accepts NULL and (with later changes)
might even return NULL.

21 months agofileio: fputs_with_space → _with_separator and modernization
Mike Yuan [Mon, 22 Jan 2024 14:49:32 +0000 (22:49 +0800)] 
fileio: fputs_with_space → _with_separator and modernization

21 months agoMerge pull request #31089 from keszybz/drop-syscall-filtering-and-new-syscalls
Lennart Poettering [Thu, 25 Jan 2024 16:12:13 +0000 (17:12 +0100)] 
Merge pull request #31089 from keszybz/drop-syscall-filtering-and-new-syscalls

Drop syscall filtering and add new syscalls

21 months agocore: introduce unit_unwatch_pidref_done() helper function 31083/head
Yu Watanabe [Wed, 24 Jan 2024 07:11:28 +0000 (16:11 +0900)] 
core: introduce unit_unwatch_pidref_done() helper function

No functional change, just refactoring.

21 months agocore/unit: split out unit_kill_one()
Yu Watanabe [Thu, 25 Jan 2024 07:41:37 +0000 (16:41 +0900)] 
core/unit: split out unit_kill_one()

This also renames 'error' -> 'ret_error'.

No functional change, just refactoring.