]> git.ipfire.org Git - thirdparty/systemd.git/log
thirdparty/systemd.git
8 weeks agoMerge pull request #32352 from DaanDeMeyer/test
Daan De Meyer [Tue, 23 Apr 2024 09:27:23 +0000 (11:27 +0200)] 
Merge pull request #32352 from DaanDeMeyer/test

test: Various mkosi integration test improvements

8 weeks agomkosi: Run integration tests in CI 32352/head
Daan De Meyer [Fri, 19 Apr 2024 08:54:38 +0000 (10:54 +0200)] 
mkosi: Run integration tests in CI

We do the image build and run the tests in a btrfs loopback so we
can make use of btrfs subvolumes and COW to keep the disk space
requirements to a minimum and speed up the ephemeral copies we make
of the image to run the tests.

We also switch to building debug packages and publishing the built
packages as artifacts.

8 weeks agotest: Various mkosi integration test improvements
Daan De Meyer [Fri, 19 Apr 2024 07:17:58 +0000 (09:17 +0200)] 
test: Various mkosi integration test improvements

- Stop using logging module since the default output formatting is
  pretty bad. Prefer print() for now.
- Log less, logging the full mkosi command line is rather verbose,
  especially when it contains multi-line dropins.
- Streamline the journalctl command we output for debugging failed
  tests.
- Don't force usage of the disk image format.
- Don't force running without unit tests.
- Don't force disabling RuntimeBuildSources.
- Update documentation to streamline the command for running a single
  test and remove sudo as it's not required anymore.
- Improve the console output by having the test unit's output logged
  to both the journal and the console.
- Disable journal console log forwarding as we have journal forwarding
  as a better alternative.
- Delete existing journal file before running test.
- Delete journal files of succeeded tests to reduce disk usage.
- Rename system_mkosi target to just mkosi
- Pass in mkosi source directory explicitly to accomodate arbitrary
  build directory locations.
- Add test interactive debugging if stdout is connected to a tty
- Stop explicitly using the 'system' image since it'll likely be
  dropped soon.
- Only forward journal if we're not running in debugging mode.
- Stop using testsuite.target and instead just add the necessary
  extras to the main testsuite unit via the credential dropin.
- Override type to idle so test output is not interleaved with
  status output.
- Don't build mkosi target by default
- Always add the mkosi target if mkosi is found
- Remove dependency of the integration tests on the mkosi target
  as otherwise the image is always built, even though we configure
  it to not be built by default.
- Move mkosi output, cache and build directory into build/ so that
  invocations from meson and regular invocations share the same
  directories.
- Various aesthetic cleanups.

8 weeks agomkosi: Deal with ubuntu's special debug packages
Daan De Meyer [Tue, 23 Apr 2024 07:09:37 +0000 (09:09 +0200)] 
mkosi: Deal with ubuntu's special debug packages

Building debug packages on ubuntu requires the "debug" option to be
specified explicitly. Debug packages on Ubuntu have the .ddeb extension,
so let's make sure we handle that by copying the .ddeb packages in the
build script as well.

8 weeks agomkosi: Use -fdebug-prefix-map= instead of -ffile-prefix-map=
Daan De Meyer [Mon, 22 Apr 2024 21:45:50 +0000 (23:45 +0200)] 
mkosi: Use -fdebug-prefix-map= instead of -ffile-prefix-map=

-ffile-prefix-map= implies -fmacro-prefix-map= which is incompatible
with our definition of PROJECT_FILE.

See https://github.com/systemd/systemd/issues/32417.

-fdebug-prefix-map= only affects debuginfo without affecting macros.

8 weeks agomkosi: Update to latest
Daan De Meyer [Mon, 22 Apr 2024 13:26:35 +0000 (15:26 +0200)] 
mkosi: Update to latest

8 weeks agomkosi: mask isc-dhcp-server
Luca Boccassi [Mon, 22 Apr 2024 23:01:39 +0000 (00:01 +0100)] 
mkosi: mask isc-dhcp-server

isc-dhcp-server does not ship units, only sysv scripts, so the mkosi
presets that disable it have no effect. The generated unit is started on
each boot and fails, causing delays and noise.

Mask it so that the generated unit is overridden. It is installed only
to bring in binaries used by the networkd tests anyway.

8 weeks agoMerge pull request #32413 from yuwata/network-radv-validator
Luca Boccassi [Mon, 22 Apr 2024 23:02:34 +0000 (01:02 +0200)] 
Merge pull request #32413 from yuwata/network-radv-validator

network/radv: several cleanups for validating configs

8 weeks agonetwork: add .link file to match 80-namespace.network
Lennart Poettering [Mon, 22 Apr 2024 15:30:58 +0000 (17:30 +0200)] 
network: add .link file to match 80-namespace.network

This file makes clear the interface shall be owned by networkd.

This does what 658169e6d307b5b1aea0d82b4a6430fa9d529c68 did for nspawn's
regular devices for the devices defined through
8aee931e7ae1adb01eeac0e1e4c0aef6ed3969ec too.

8 weeks agonetwork: add "mac" to alternatives name policy by default
Lennart Poettering [Mon, 22 Apr 2024 15:30:11 +0000 (17:30 +0200)] 
network: add "mac" to alternatives name policy by default

Alternative names are basically free, hence add "mac" there too, to make
it easier to see what names could be used as primary options too.

8 weeks agokernel-install/60-ukify: also search in {/run,/usr/local/lib}/kernel/
Mike Yuan [Mon, 22 Apr 2024 16:06:11 +0000 (00:06 +0800)] 
kernel-install/60-ukify: also search in {/run,/usr/local/lib}/kernel/

After db26d8025e5bbc188f93b645124126bbc550caa5,
kernel-install takes config files under /run/
and /usr/local/lib/ into account too. The same
should apply to ukify.

Note that ukify when invoked alone searches under
/run/systemd/, /etc/systemd/, /usr/local/lib/systemd/,
and /usr/lib/systemd/, respectively, which is against
our usual order...

8 weeks agomachined: fix invalid edge case in machine_new
Sam Leonard [Mon, 22 Apr 2024 15:11:28 +0000 (16:11 +0100)] 
machined: fix invalid edge case in machine_new

8 weeks agoDocument effective owner of stdout/stderr log file upon creation
Guido Leenders [Fri, 19 Apr 2024 11:30:32 +0000 (13:30 +0200)] 
Document effective owner of stdout/stderr log file upon creation

The log files defined using file:, append: or truncate: inherit the owner and other privileges from the effective user running systemd.

The log files are NOT created using the "User", "Group" or "UMask" defined in the service.

8 weeks agoukify: swap the ordering of config search paths
Yu Watanabe [Mon, 22 Apr 2024 16:34:46 +0000 (01:34 +0900)] 
ukify: swap the ordering of config search paths

Let's follow our usual ordering.

Follow-up for a05fa30f88e522101c8412deecd7f598e2254b20.

8 weeks agotest: ensure all architecture ids we define definitely fit into .v/ patterns
Lennart Poettering [Mon, 22 Apr 2024 15:32:51 +0000 (17:32 +0200)] 
test: ensure all architecture ids we define definitely fit into .v/ patterns

Just some safety checks so that we never regress on this: make sure all
architectur IDs we define are embeddable safely in .v/ entry file names.

8 weeks agoMerge pull request #32412 from weblate/weblate-systemd-main
Frantisek Sumsal [Mon, 22 Apr 2024 18:02:32 +0000 (20:02 +0200)] 
Merge pull request #32412 from weblate/weblate-systemd-main

Translations update from Fedora Weblate

8 weeks agotest: Rework TEST-02-UNITTESTS
Daan De Meyer [Sat, 20 Apr 2024 19:13:18 +0000 (21:13 +0200)] 
test: Rework TEST-02-UNITTESTS

Currently, A large amount of unit test output is logged directly
to the console instead of to the per test log file as any subprocesses
executed by a test manager will detect that stderr is not connected
to the journal and log directly to /dev/console instead.

To solve this issue, let's make sure all tests are connected directly
to the journal by running them with systemd-run. We also simplify the
entire test script by getting rid of the custom queue and replicating
it with xargs instead. By using bash's function export feature, we can
make our run_test() function available to the bash subprocess spawned
by xargs.

Once a test is finished, we read its logs from the journal and put them
in the appropriate file if needed.

8 weeks agoMerge pull request #32392 from DaanDeMeyer/executor-log-level
Daan De Meyer [Mon, 22 Apr 2024 17:26:52 +0000 (19:26 +0200)] 
Merge pull request #32392 from DaanDeMeyer/executor-log-level

core: Set a sensible systemd-executor log level in test runs

8 weeks agopo: Update translation files 32412/head
Weblate [Mon, 22 Apr 2024 17:15:01 +0000 (19:15 +0200)] 
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/main/
Translation: systemd/main

8 weeks agopo: Translated using Weblate (Slovenian)
Martin Srebotnjak [Mon, 22 Apr 2024 17:15:01 +0000 (19:15 +0200)] 
po: Translated using Weblate (Slovenian)

Currently translated at 10.7% (25 of 233 strings)

po: Translated using Weblate (Slovenian)

Currently translated at 9.8% (23 of 233 strings)

Co-authored-by: Martin Srebotnjak <miles@filmsi.net>
Translate-URL: https://translate.fedoraproject.org/projects/systemd/main/sl/
Translation: systemd/main

8 weeks agonetwork/radv: drop unnecessary conditions 32413/head
Yu Watanabe [Sat, 20 Apr 2024 05:36:55 +0000 (14:36 +0900)] 
network/radv: drop unnecessary conditions

sd_radv_set_xyz() will handle invalid values gracefully.

8 weeks agonetwork/radv: warn about non-zero preference with zero lifetime
Yu Watanabe [Sat, 20 Apr 2024 05:36:40 +0000 (14:36 +0900)] 
network/radv: warn about non-zero preference with zero lifetime

Note that the misconfiguration will be handled gracefully. So it is not
necessary to adjust value here. Let's only warn about that.

8 weeks agonetwork/radv: verify [IPv6Prefix] section or friends in network_adjust_radv()
Yu Watanabe [Sat, 20 Apr 2024 05:34:05 +0000 (14:34 +0900)] 
network/radv: verify [IPv6Prefix] section or friends in network_adjust_radv()

Previously, network_drop_invalid_pref64_prefixes() was never called.
This also fixes that.

8 weeks agoman: fix typo
Yu Watanabe [Mon, 22 Apr 2024 16:41:31 +0000 (01:41 +0900)] 
man: fix typo

Follow-up for 403492793a63d85737cfee4fd80f5d3778b1c901.

8 weeks agoman: fix typo
Yu Watanabe [Mon, 22 Apr 2024 16:40:24 +0000 (01:40 +0900)] 
man: fix typo

Follow-up for fef46ffb5b3a98cb557c9f77d230fbb220355b9e.

8 weeks agoMerge pull request #32401 from bluca/chores
Luca Boccassi [Mon, 22 Apr 2024 16:40:55 +0000 (18:40 +0200)] 
Merge pull request #32401 from bluca/chores

RC1 chores

8 weeks agoMerge pull request #32396 from YHNdnzj/verb-required
Luca Boccassi [Mon, 22 Apr 2024 16:14:10 +0000 (18:14 +0200)] 
Merge pull request #32396 from YHNdnzj/verb-required

shared/verbs: show list of verbs when missing

8 weeks agomount-util: Silence noisy trace log message 32392/head
Daan De Meyer [Mon, 22 Apr 2024 16:01:06 +0000 (18:01 +0200)] 
mount-util: Silence noisy trace log message

8 weeks agoMerge pull request #32369 from DaanDeMeyer/serial
Lennart Poettering [Mon, 22 Apr 2024 15:48:14 +0000 (17:48 +0200)] 
Merge pull request #32369 from DaanDeMeyer/serial

terminal-util: Enable line wrapping in reset_terminal_fd()

8 weeks agoMerge pull request #32402 from poettering/tpm2-setup-pcrextend-order
Lennart Poettering [Mon, 22 Apr 2024 15:47:51 +0000 (17:47 +0200)] 
Merge pull request #32402 from poettering/tpm2-setup-pcrextend-order

units: order tpm2-setup-early and pcrphase-initrd against each other

8 weeks agoMerge pull request #32399 from poettering/doc-fixes-256
Lennart Poettering [Mon, 22 Apr 2024 15:41:39 +0000 (17:41 +0200)] 
Merge pull request #32399 from poettering/doc-fixes-256

various documentation fixes (plus minor other work)

8 weeks agoupdate TODO
Lennart Poettering [Mon, 22 Apr 2024 15:30:06 +0000 (17:30 +0200)] 
update TODO

8 weeks agonspawn: fix typo
Mike Yuan [Mon, 22 Apr 2024 15:00:22 +0000 (23:00 +0800)] 
nspawn: fix typo

Follow-up for edd3d4d7c2373e0d53b09894ce6405ff697185aa

8 weeks agocore: Set a sensible systemd-executor log level in test runs
Daan De Meyer [Fri, 19 Apr 2024 20:48:06 +0000 (22:48 +0200)] 
core: Set a sensible systemd-executor log level in test runs

8 weeks agoUpdate translation files 32401/head
Luca Boccassi [Mon, 22 Apr 2024 13:46:24 +0000 (14:46 +0100)] 
Update translation files

8 weeks agonspawn: ensure single-process container running as --user can access credentials
Luca Boccassi [Thu, 14 Mar 2024 23:44:20 +0000 (23:44 +0000)] 
nspawn: ensure single-process container running as --user can access credentials

When starting a container with --user, the new uid will be resolved and switched to
only in the inner child, at the end of the setup, by spawning getent. But the
credentials are set up in the outer child, long before the user is resolvable,
and the directories/files are made only readable by root and read-only, which
means they cannot be changed later and made visible to the user.

When this particular combination is specified, it is obvious the caller wants
the single-process container to be able to use credentials, so make them world
readable only in that specific case.

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

2 months agomkosi: Drop workaround to re-enable serial console line wrapping 32369/head
Daan De Meyer [Mon, 22 Apr 2024 08:21:13 +0000 (10:21 +0200)] 
mkosi: Drop workaround to re-enable serial console line wrapping

Since we do it in reset_terminal_fd() now, there's no need to carry
this workaround anymore.

2 months agoterminal-util: Enable line wrapping in reset_terminal_fd()
Daan De Meyer [Fri, 19 Apr 2024 19:58:18 +0000 (21:58 +0200)] 
terminal-util: Enable line wrapping in reset_terminal_fd()

The qemu seabios firmware disables serial console line wrapping. Let's
make sure we re-enable it again when we reset a terminal to some sane
defaults.

To avoid potentially blocking on writing to the terminal, we put it
in nonblocking mode and add a timeout of 50ms.

2 months agofd-util: Return 1 from fd_nonblock() if we actually change the mode
Daan De Meyer [Mon, 22 Apr 2024 08:16:40 +0000 (10:16 +0200)] 
fd-util: Return 1 from fd_nonblock() if we actually change the mode

2 months agoUpdate systemd.pot
Luca Boccassi [Mon, 22 Apr 2024 13:10:56 +0000 (14:10 +0100)] 
Update systemd.pot

2 months agoUpdate autosuspend hwdb
Luca Boccassi [Mon, 22 Apr 2024 13:08:55 +0000 (14:08 +0100)] 
Update autosuspend hwdb

2 months agoUpdate hwdb
Luca Boccassi [Mon, 22 Apr 2024 13:08:14 +0000 (14:08 +0100)] 
Update hwdb

2 months agoNEWS: update contributors list
Luca Boccassi [Mon, 22 Apr 2024 13:04:33 +0000 (14:04 +0100)] 
NEWS: update contributors list

2 months agoNEWS: mention ExecMainHandoverTimestamp
Luca Boccassi [Mon, 22 Apr 2024 13:26:24 +0000 (14:26 +0100)] 
NEWS: mention ExecMainHandoverTimestamp

2 months agoman: document that IPAccounting= works for system services only 32399/head
Lennart Poettering [Mon, 22 Apr 2024 11:08:22 +0000 (13:08 +0200)] 
man: document that IPAccounting= works for system services only

Fixes: #20356
2 months agoman: be explicit that we don't proxy SO_PEER*, SCM_RIGHTS and co.
Lennart Poettering [Mon, 22 Apr 2024 11:06:48 +0000 (13:06 +0200)] 
man: be explicit that we don't proxy SO_PEER*, SCM_RIGHTS and co.

Fixes: #22744
2 months agoman: document that ReadOnlyPaths= doesn't affect ability to connect to AF_UNIX
Lennart Poettering [Mon, 22 Apr 2024 11:02:08 +0000 (13:02 +0200)] 
man: document that ReadOnlyPaths= doesn't affect ability to connect to AF_UNIX

Fixes: #23470
2 months agoman: document that "systemctl set-environment" cannot be used to unset env vars confi...
Lennart Poettering [Mon, 22 Apr 2024 10:57:38 +0000 (12:57 +0200)] 
man: document that "systemctl set-environment" cannot be used to unset env vars configured via config file

Fixes: #28167
2 months agoman: say explicitly that $LESS + $LESSCHARSET have no effect on less invocations...
Lennart Poettering [Mon, 22 Apr 2024 10:39:30 +0000 (12:39 +0200)] 
man: say explicitly that $LESS + $LESSCHARSET have no effect on less invocations by systemd tools

Fixes: #29479
2 months agoresolved: tighten the rules a bit on valid DNS-SD service identifiers
Lennart Poettering [Mon, 22 Apr 2024 10:32:54 +0000 (12:32 +0200)] 
resolved: tighten the rules a bit on valid DNS-SD service identifiers

Let's insist that the ID is suitable for inclusion in a filename, as one
of the most basic of requirements.

2 months agoresolved: rename DnssdService "name" field to "id"
Lennart Poettering [Mon, 22 Apr 2024 10:30:16 +0000 (12:30 +0200)] 
resolved: rename DnssdService "name" field to "id"

"name" is a bit confusing since this field is *not* the DNS-SD service
identifier, bust just some string derived from the .dnssd filename that
is used as handle for the service. Let's hence give it a better name:
"id".

While we are at it, switch from basename() to path_extract_filename().

2 months agoresolved: rename DnssdService.filename field to .path
Lennart Poettering [Mon, 22 Apr 2024 10:23:03 +0000 (12:23 +0200)] 
resolved: rename DnssdService.filename field to .path

It contains a full path, not just a filename, hence name it
appropriately.

2 months agoman: document missing resolved D-Bus APIs
Lennart Poettering [Mon, 22 Apr 2024 10:02:51 +0000 (12:02 +0200)] 
man: document missing resolved D-Bus APIs

Fixes: #29598
2 months agoman: document that StateDirectory= trumps ProtectSystem=strict explicitly
Lennart Poettering [Mon, 22 Apr 2024 09:48:20 +0000 (11:48 +0200)] 
man: document that StateDirectory= trumps ProtectSystem=strict explicitly

Fixes: #29798
2 months agoman: document explicitly that LogExtraFields= and LogFilterPatterns= are for system...
Lennart Poettering [Mon, 22 Apr 2024 09:37:41 +0000 (11:37 +0200)] 
man: document explicitly that LogExtraFields= and LogFilterPatterns= are for system service only for now

Fixes: #29956
2 months agoman: document explicitly that bind restrictions cannot be escaped by opening a new...
Lennart Poettering [Mon, 22 Apr 2024 09:34:59 +0000 (11:34 +0200)] 
man: document explicitly that bind restrictions cannot be escaped by opening a new netns

And while we are at it reword the introductary sentence a bit to make it
clearer.

Fixes: #30555
2 months agoman: explicitly document the various systemd.journald.max_level_*= kernel cmdline...
Lennart Poettering [Mon, 22 Apr 2024 09:26:42 +0000 (11:26 +0200)] 
man: explicitly document the various systemd.journald.max_level_*= kernel cmdline options

Fixes: #31327
2 months agojournald: bring order of MaxLevelXYZ= setting explanations in sync with listed names
Lennart Poettering [Mon, 22 Apr 2024 09:26:26 +0000 (11:26 +0200)] 
journald: bring order of MaxLevelXYZ= setting explanations in sync with listed names

2 months agoman: explicitly say that BindPaths=/BindReadOnlyPaths= opens a new mount
Lennart Poettering [Mon, 22 Apr 2024 09:18:45 +0000 (11:18 +0200)] 
man: explicitly say that BindPaths=/BindReadOnlyPaths= opens a new mount
namespace

Fixes: #32339
2 months agoman: run update-man-rules again
Lennart Poettering [Mon, 22 Apr 2024 10:03:00 +0000 (12:03 +0200)] 
man: run update-man-rules again

2 months agocore: add ExecMainHandoverTimestamp property recording time-of-execve
Luca Boccassi [Fri, 19 Apr 2024 23:50:16 +0000 (00:50 +0100)] 
core: add ExecMainHandoverTimestamp property recording time-of-execve

Enable the exec_fd logic for Type=notify* services too, and change it
to send a timestamp instead of a '1' byte. Record the timestamp in a
new ExecMainHandoverTimestamp property so that users can track accurately
when control is handed over from systemd to the service payload, so
that latency and startup performance can be trivially and accurately
tracked and attributed.

2 months agounits: merge two After= lines 32402/head
Lennart Poettering [Mon, 22 Apr 2024 13:15:05 +0000 (15:15 +0200)] 
units: merge two After= lines

2 months agotpm2-setup-early: order against pcrphase-initrd
Lennart Poettering [Mon, 22 Apr 2024 12:47:58 +0000 (14:47 +0200)] 
tpm2-setup-early: order against pcrphase-initrd

Right now systemd-tpm2-setup-early and systemd-pcrphase-initrd.service
are not ordered against each other. However, they require the same slow
resource to operate: the TPM2. If we allow them to access the device
simultaneously, the kernel resource manager like has to save/restore TPM
state while they operate, slowing things down further.

hence, let's avoid all this mess, and just order them against each other
so that the shared resource is first used in full by one and then by the
other.

I opted to order systemd-pcrphase-initrd before
systemd-tpm2-setup-early, since there's value in having the former as
early as possible in userspace, to be a good marker for the transition
from kernel to first userspace. I can see no benefit in the opposite
order however.

2 months agoshared/verbs: show list of verbs when missing 32396/head
Mike Yuan [Mon, 22 Apr 2024 09:40:53 +0000 (17:40 +0800)] 
shared/verbs: show list of verbs when missing

Replaces #32062

As discussed in #32062, making 'help' the default verb
is not very appealing for two reasons:

1) If the verb is missing, showing a help which is pages long
   isn't really helpful to locate the problem.
   (https://github.com/systemd/systemd/pull/32062#issuecomment-2064997158)

2) We want to reserve the right to set default verbs to be
   more useful ones, instead of help. E.g. 'busctl' lists all
   bus peers by default.

So, when there are more than 2 verbs, let's instead add
the list of available verbs to the "Command verb required"
message, that serves as a hint. That way we try to be friendlier
to users, but still make the problem obvious.

2 months agopo: Translated using Weblate (Slovenian)
Martin Srebotnjak [Mon, 22 Apr 2024 07:15:09 +0000 (09:15 +0200)] 
po: Translated using Weblate (Slovenian)

Currently translated at 2.1% (5 of 233 strings)

po: Added translation using Weblate (Slovenian)

Co-authored-by: Martin Srebotnjak <miles@filmsi.net>
Translate-URL: https://translate.fedoraproject.org/projects/systemd/main/sl/
Translation: systemd/main

2 months agoshared/verbs: minor modernization
Mike Yuan [Mon, 22 Apr 2024 09:33:54 +0000 (17:33 +0800)] 
shared/verbs: minor modernization

2 months agoMerge pull request #32347 from yuwata/sd-radv-reachable-time
Luca Boccassi [Mon, 22 Apr 2024 12:04:25 +0000 (14:04 +0200)] 
Merge pull request #32347 from yuwata/sd-radv-reachable-time

sd-radv: allow to configure reachable time

2 months agocore: Check for TERM=dumb in show_status()
Daan De Meyer [Sun, 21 Apr 2024 09:21:14 +0000 (11:21 +0200)] 
core: Check for TERM=dumb in show_status()

We shouldn't try to use any ANSI escape sequences if TERM=dumb.
Also, the "\r\n" we output can get interpreted as a double newline
(for example by Github Actions), so let's output just "\n" when
TERM=dumb to clean up the CI logs.

2 months agoMerge pull request #32389 from keszybz/bin-sbin-merge
Luca Boccassi [Mon, 22 Apr 2024 11:07:48 +0000 (13:07 +0200)] 
Merge pull request #32389 from keszybz/bin-sbin-merge

Try PATH without sbin even if compiled with split-bin=true

2 months agotpm2-util: add generic wrapper tpm2_context_new_or_warn() that wrpas tpm2_context_new...
Lennart Poettering [Mon, 22 Apr 2024 07:46:23 +0000 (09:46 +0200)] 
tpm2-util: add generic wrapper tpm2_context_new_or_warn() that wrpas tpm2_context_new and logs about errors

We so far just print a short log message that is not very useful, let's
add some recognizable error codes, and output better log messages if we
can't get TPM stuff to work.

Fixes: #31925
2 months agosd-event: fix fd leak when fd is owned by IO event source
Yu Watanabe [Sun, 21 Apr 2024 20:22:24 +0000 (05:22 +0900)] 
sd-event: fix fd leak when fd is owned by IO event source

When an IO event source owns relevant fd, replacing with a new fd leaks
the previously assigned fd.
===
sd_event_add_io(event, &s, fd, ...);
sd_event_source_set_io_fd_own(s, true);
sd_event_source_set_io_fd(s, new_fd);  <-- The previous fd is not closed.
sd_event_source_unref(s);  <-- new_fd is closed as expected.
===

Without the change, valgrind reports the leak:
==998589==
==998589== FILE DESCRIPTORS: 4 open (3 std) at exit.
==998589== Open file descriptor 4:
==998589==    at 0x4F119AB: pipe2 (in /usr/lib64/libc.so.6)
==998589==    by 0x408830: test_sd_event_source_set_io_fd (test-event.c:862)
==998589==    by 0x403302: run_test_table (tests.h:171)
==998589==    by 0x408E31: main (test-event.c:935)
==998589==
==998589==
==998589== HEAP SUMMARY:
==998589==     in use at exit: 0 bytes in 0 blocks
==998589==   total heap usage: 33,305 allocs, 33,305 frees, 1,283,581 bytes allocated
==998589==
==998589== All heap blocks were freed -- no leaks are possible
==998589==
==998589== For lists of detected and suppressed errors, rerun with: -s
==998589== ERROR SUMMARY: 0 errors from 0 contexts (suppressed: 0 from 0)

2 months agobuild(deps): bump pkg/arch from `ccc32ea` to `124b1da`
dependabot[bot] [Mon, 22 Apr 2024 09:26:12 +0000 (09:26 +0000)] 
build(deps): bump pkg/arch from `ccc32ea` to `124b1da`

Bumps pkg/arch from `ccc32ea` to `124b1da`.

---
updated-dependencies:
- dependency-name: pkg/arch
  dependency-type: direct:production
...

Signed-off-by: dependabot[bot] <support@github.com>
2 months agoman: fix typo
Yu Watanabe [Mon, 22 Apr 2024 09:44:15 +0000 (18:44 +0900)] 
man: fix typo

Follow-ups for 418f2dc75564330d4ff6c86193f4a3c8ffbb1f1b.

2 months agotest-network: add test for [IPv6SendRA] ReachableTimeSec= and RetransmitSec= 32347/head
Yu Watanabe [Wed, 21 Feb 2024 05:27:29 +0000 (14:27 +0900)] 
test-network: add test for [IPv6SendRA] ReachableTimeSec= and RetransmitSec=

2 months agoman: slightly rephrase RetransmitSec= setting
Yu Watanabe [Sat, 20 Apr 2024 05:41:45 +0000 (14:41 +0900)] 
man: slightly rephrase RetransmitSec= setting

2 months agonetwork/radv: introduce ReachableTimeSec= setting
Yu Watanabe [Wed, 21 Feb 2024 05:08:57 +0000 (14:08 +0900)] 
network/radv: introduce ReachableTimeSec= setting

To make the reachable time in the RA header sent by networkd
configurable.

2 months agosd-radv: allow to configure reachable time in RA header
Yu Watanabe [Wed, 21 Feb 2024 05:01:15 +0000 (14:01 +0900)] 
sd-radv: allow to configure reachable time in RA header

2 months agoMerge pull request #32391 from DaanDeMeyer/optimization
Luca Boccassi [Mon, 22 Apr 2024 09:21:04 +0000 (11:21 +0200)] 
Merge pull request #32391 from DaanDeMeyer/optimization

mkosi: Add environment variable to set the optimization level

2 months agoMerge pull request #31987 from flatcar-hub/krnowak/usr-perm-check
Lennart Poettering [Mon, 22 Apr 2024 09:14:35 +0000 (11:14 +0200)] 
Merge pull request #31987 from flatcar-hub/krnowak/usr-perm-check

sysext: Fix issues with merged hierarchy mode

2 months agoMerge pull request #32387 from DaanDeMeyer/unit-test-fixes
Daan De Meyer [Mon, 22 Apr 2024 08:51:45 +0000 (10:51 +0200)] 
Merge pull request #32387 from DaanDeMeyer/unit-test-fixes

Various unit test improvements

2 months agomkosi: Explicitly disable fortify for debian/ubuntu 32391/head
Daan De Meyer [Mon, 22 Apr 2024 08:49:32 +0000 (10:49 +0200)] 
mkosi: Explicitly disable fortify for debian/ubuntu

We do the same for the other distributions, so let's do so for
debian/ubuntu as well.

2 months agoNEWS: reword a few sentences
Zbigniew Jędrzejewski-Szmek [Mon, 22 Apr 2024 08:49:09 +0000 (10:49 +0200)] 
NEWS: reword a few sentences

2 months agomkosi: Use awk to avoid dpkg-buildpackage warning
Daan De Meyer [Mon, 22 Apr 2024 08:48:52 +0000 (10:48 +0200)] 
mkosi: Use awk to avoid dpkg-buildpackage warning

Let's strip unnecessary whitespace to avoid a dpkg-buildpackage
warning.

2 months agomkosi: Add environment variable to set the optimization level
Daan De Meyer [Mon, 22 Apr 2024 07:32:35 +0000 (09:32 +0200)] 
mkosi: Add environment variable to set the optimization level

2 months agosd-path: rename output param 32389/head
Zbigniew Jędrzejewski-Szmek [Mon, 22 Apr 2024 07:55:17 +0000 (09:55 +0200)] 
sd-path: rename output param

As requested in review.

2 months agoTry path without sbin even if compiled with split-bin=true
Zbigniew Jędrzejewski-Szmek [Thu, 18 Apr 2024 14:11:06 +0000 (16:11 +0200)] 
Try path without sbin even if compiled with split-bin=true

I'm working on the transition to merged sbin in Fedora. While the transition is
happening (and probably for a while after), we need to compile systemd with
split-bin=true to support systems upgraded from previous versions. But when the
system has been upgraded and already has /usr/sbin that is a symlink, be nice
and give $PATH without sbin.

We check for both /usr/sbin and /usr/local/sbin. If either exists and is not a
symlink to ./bin, we retain previous behaviour. This means that if both are
converted, we get the same behaviour as split-bin=false, and otherwise we
get the same behaviour as before.

sd-path uses the same logic. This is not a hot path, so I got rid of the nulstr
macros that duplicated the logic.

2 months agotest: Don't allocate scope if already running in unit with delegated cgroup 32387/head
Daan De Meyer [Sun, 21 Apr 2024 16:31:53 +0000 (18:31 +0200)] 
test: Don't allocate scope if already running in unit with delegated cgroup

If we're already running in a unit with delegation turned on, let's
skip allocation of a scope unit and cgroup subroot. This allows journald
to correctly attribute the logs of all subprocesses spawned by tests such
as test-execute to the test-execute service when the test is running in a service.

2 months agotest: Use log_setup()
Daan De Meyer [Sun, 21 Apr 2024 16:29:43 +0000 (18:29 +0200)] 
test: Use log_setup()

Specifically, this will make tests log to the journal if stderr is
connected to the journal. This means we get proper log priorities
and such compared to if we just logged to stderr.

2 months agotest-execute: Use new assertion macros
Daan De Meyer [Sun, 21 Apr 2024 12:22:19 +0000 (14:22 +0200)] 
test-execute: Use new assertion macros

2 months agotest: Add ASSERT_ERROR() and ASSERT_ERROR_ERRNO()
Daan De Meyer [Sun, 21 Apr 2024 12:16:08 +0000 (14:16 +0200)] 
test: Add ASSERT_ERROR() and ASSERT_ERROR_ERRNO()

For when we expect something to fail with a specific error.

2 months agotest: Make sure test_fdset_close_others does not affect logging fds
Daan De Meyer [Sun, 21 Apr 2024 19:21:10 +0000 (21:21 +0200)] 
test: Make sure test_fdset_close_others does not affect logging fds

2 months agotest-bpf-restrict-fs: Add @application to allowed filesystems as well
Daan De Meyer [Sat, 20 Apr 2024 07:44:35 +0000 (09:44 +0200)] 
test-bpf-restrict-fs: Add @application to allowed filesystems as well

We might be booting from virtiofs which is fuse so we need @application
as well.

2 months agotest-bpf-firewall: Skip if ping is not available
Daan De Meyer [Sat, 20 Apr 2024 11:29:00 +0000 (13:29 +0200)] 
test-bpf-firewall: Skip if ping is not available

2 months agoMerge pull request #32386 from DaanDeMeyer/mkosi
Daan De Meyer [Mon, 22 Apr 2024 07:26:59 +0000 (09:26 +0200)] 
Merge pull request #32386 from DaanDeMeyer/mkosi

Various mkosi improvements

2 months agomkosi: Install various system users/groups in opensuse images 32386/head
Daan De Meyer [Sun, 21 Apr 2024 19:37:39 +0000 (21:37 +0200)] 
mkosi: Install various system users/groups in opensuse images

These don't get pulled in automatically and there doesn't seem to
be a "system-users" package so install the ones we need for the
integration tests manually.

2 months agomkosi: Backport Fedora basic users/groups sysusers files to CentOS
Daan De Meyer [Sun, 21 Apr 2024 18:49:14 +0000 (20:49 +0200)] 
mkosi: Backport Fedora basic users/groups sysusers files to CentOS

CentOS does not ship these sysusers dropins which set up basic system
users and groups. Until we can move to CentOS Stream 10, let's add the
dropins ourselves to make sure the base system users/groups are available
on CentOS.

2 months agomkosi: Install procps-ng in all images
Daan De Meyer [Sat, 20 Apr 2024 13:55:34 +0000 (15:55 +0200)] 
mkosi: Install procps-ng in all images

Required for TEST-01-BASIC.

2 months agomkosi: Make sure systemd-libs is updated on Arch
Daan De Meyer [Sat, 20 Apr 2024 12:22:27 +0000 (14:22 +0200)] 
mkosi: Make sure systemd-libs is updated on Arch

The Arch Linux PKGBUILD does not (yet) have versioned dependencies
between the systemd packages, causing systemd-libs to not get updated
to 256-devel if systemd 256-devel is installed. Let's explicitly install
the newer version of systemd-libs as well for now until this problem is
fixed.

2 months agomkosi: Make sure ping is installed
Daan De Meyer [Sat, 20 Apr 2024 11:28:35 +0000 (13:28 +0200)] 
mkosi: Make sure ping is installed

Required for test-bpf-firewall.

2 months agomkosi: Disable rpm package notes
Daan De Meyer [Sat, 20 Apr 2024 07:43:14 +0000 (09:43 +0200)] 
mkosi: Disable rpm package notes

This introduces dependencies on various environment variables set
by rpmbuild which will not be set when rerunning meson inside the
VM/container so let's disable package notes to avoid these dependencies,
as the package notes aren't terribly useful in this scenario anyway.